poprawki
This commit is contained in:
@@ -139,6 +139,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not list_id %}
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between align-items-center mt-4">
|
||||
<form method="get" class="d-flex align-items-center">
|
||||
@@ -170,4 +171,6 @@
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -122,6 +122,11 @@
|
||||
<div class="mb-4 border-top pt-3 mt-4">
|
||||
<h5 class="mb-3">🔐 Użytkownicy z dostępem</h5>
|
||||
|
||||
<a class="btn btn-outline-warning btn-sm mb-3"
|
||||
href="{{ url_for('admin_lists_access', list_id=list.id) }}">
|
||||
⚙️ Edytuj uprawnienia (admin)
|
||||
</a>
|
||||
|
||||
{% if permitted_users %}
|
||||
<ul class="list-group list-group-flush mb-3">
|
||||
{% for u in permitted_users %}
|
||||
|
||||
+58
-56
@@ -96,65 +96,67 @@
|
||||
|
||||
<!-- DOSTĘP DO LISTY -->
|
||||
<div class="card bg-secondary bg-opacity-10 text-white mb-5">
|
||||
<h5 class="mb-3">🔐 Dostęp do listy</h5>
|
||||
<div class="card-body">
|
||||
<h5 class="mb-3">🔐 Dostęp do listy</h5>
|
||||
|
||||
<!-- Link udostępniania -->
|
||||
<div class="mb-4">
|
||||
<label class="form-label">🔗 Link udostępniania (wejście przez link daje dostęp; zalogowani dostają
|
||||
uprawnienia na stałę po kliknięciu w link)</label>
|
||||
<!-- Link udostępniania -->
|
||||
<div class="mb-4">
|
||||
<label class="form-label">🔗 Link udostępniania (wejście przez link daje dostęp; zalogowani dostają
|
||||
uprawnienia na stałę po kliknięciu w link)</label>
|
||||
|
||||
{% if list.share_token %}
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control bg-dark text-white border-secondary"
|
||||
readonly value="{{ url_for('shared_list', token=list.share_token, _external=True) }}"
|
||||
id="sharedListUrl" aria-label="Udostępniony link">
|
||||
<a class="btn btn-outline-light" href="{{ url_for('shared_list', token=list.share_token) }}" target="_blank"
|
||||
title="Otwórz">
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-warning small">Brak tokenu udostępniania.</div>
|
||||
{% endif %}
|
||||
<div class="text-info small">Ustawienie „🌐 Publiczna” nie jest wymagane dla dostępu z linku.</div>
|
||||
</div>
|
||||
|
||||
<form method="post" class="m-0">
|
||||
<div class="row g-3 align-items-end mb-4">
|
||||
<div class="col-md-6">
|
||||
<label for="grant_username" class="form-label">➕ Nadaj dostęp użytkownikowi (login)</label>
|
||||
<input type="text" name="grant_username" id="grant_username"
|
||||
class="form-control bg-dark text-white border-secondary rounded" placeholder="np. marek">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button type="submit" class="btn btn-outline-light w-100">➕ Dodaj</button>
|
||||
</div>
|
||||
<!-- opcjonalnie, żeby rozróżnić akcje po stronie serwera -->
|
||||
<input type="hidden" name="action" value="grant">
|
||||
<!-- opcjonalnie zachowanie powrotu -->
|
||||
<input type="hidden" name="next" value="{{ request.path }}">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Lista uprawnionych -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">👥 Użytkownicy z dostępem</label>
|
||||
{% if permitted_users and permitted_users|length > 0 %}
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for u in permitted_users %}
|
||||
<li class="list-group-item bg-dark text-white d-flex justify-content-between align-items-center border-secondary">
|
||||
<div>
|
||||
<span class="fw-semibold">@{{ u.username }}</span>
|
||||
{% if list.share_token %}
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control bg-dark text-white border-secondary"
|
||||
readonly value="{{ url_for('shared_list', token=list.share_token, _external=True) }}"
|
||||
id="sharedListUrl" aria-label="Udostępniony link">
|
||||
<a class="btn btn-outline-light" href="{{ url_for('shared_list', token=list.share_token) }}" target="_blank"
|
||||
title="Otwórz">Otwórz
|
||||
</a>
|
||||
</div>
|
||||
<form method="post" onsubmit="return confirm('Odebrać dostęp użytkownikowi @{{ u.username }}?');">
|
||||
<input type="hidden" name="revoke_user_id" value="{{ u.id }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">🚫 Odbierz</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}<br>
|
||||
<div class="text-warning small">Brak dodanych uprawnień.</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="text-warning small">Brak tokenu udostępniania.</div>
|
||||
{% endif %}
|
||||
<div class="text-info small">Ustawienie „🌐 Publiczna” nie jest wymagane dla dostępu z linku.</div>
|
||||
</div>
|
||||
|
||||
<form method="post" class="m-0">
|
||||
<div class="row g-3 align-items-end mb-4">
|
||||
<div class="col-md-6">
|
||||
<label for="grant_username" class="form-label">➕ Nadaj dostęp użytkownikowi (login)</label>
|
||||
<input type="text" name="grant_username" id="grant_username"
|
||||
class="form-control bg-dark text-white border-secondary rounded" placeholder="np. marek">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button type="submit" class="btn btn-outline-light w-100">➕ Dodaj</button>
|
||||
</div>
|
||||
<!-- opcjonalnie, żeby rozróżnić akcje po stronie serwera -->
|
||||
<input type="hidden" name="action" value="grant">
|
||||
<!-- opcjonalnie zachowanie powrotu -->
|
||||
<input type="hidden" name="next" value="{{ request.path }}">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Lista uprawnionych -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">👥 Użytkownicy z dostępem</label>
|
||||
{% if permitted_users and permitted_users|length > 0 %}
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for u in permitted_users %}
|
||||
<li class="list-group-item bg-dark text-white d-flex justify-content-between align-items-center border-secondary">
|
||||
<div>
|
||||
<span class="fw-semibold">@{{ u.username }}</span>
|
||||
</div>
|
||||
<form method="post" onsubmit="return confirm('Odebrać dostęp użytkownikowi @{{ u.username }}?');">
|
||||
<input type="hidden" name="revoke_user_id" value="{{ u.id }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">🚫 Odbierz uprawnienia</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}<br>
|
||||
<div class="text-warning small">Brak dodanych uprawnień.</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
➕ Nadaj dostęp
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user