zmiany w edycji listy przez usera

This commit is contained in:
Mateusz Gruszczyński
2025-08-15 12:47:16 +02:00
parent feb2679d91
commit e2468c299d
4 changed files with 24 additions and 51 deletions

View File

@@ -20,52 +20,31 @@
value="{{ list.title }}" required>
</div>
<!-- Wydatek i właściciel -->
<div class="row mb-3">
<div class="col-md-6">
<label for="amount" class="form-label">💰 Całkowity wydatek (PLN)</label>
<input type="number" step="0.01" min="0" class="form-control bg-dark text-white border-secondary rounded"
id="amount" name="amount" value="{{ '%.2f'|format(total_expense) }}">
</div>
<div class="col-md-6">
<label for="owner_id" class="form-label">👤 Właściciel</label>
<select class="form-select bg-dark text-white border-secondary" id="owner_id" name="owner_id">
{% for user in users %}
<option value="{{ user.id }}" {% if list.owner_id==user.id %}selected{% endif %}>
{{ user.username }}
</option>
{% endfor %}
</select>
</div>
</div>
<!-- Statusy -->
<!-- Statusy listy -->
<div class="mb-4">
<label class="form-label">⚙️ Statusy listy</label>
<div class="d-flex flex-wrap gap-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="archived" name="archived" {% if list.is_archived
%}checked{% endif %}>
<label class="form-check-label" for="archived">📦 Archiwalna</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="public" name="public" {% if list.is_public %}checked{%
endif %}>
<input class="form-check-input" type="checkbox" id="public" name="is_public"
{% if list.is_public %}checked{% endif %}>
<label class="form-check-label" for="public">🌐 Publiczna</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="temporary" name="temporary" {% if list.is_temporary
%}checked{% endif %}>
<label class="form-check-label" for="temporary">⏳ Tymczasowa (podaj date i godzine wygasania)</label>
<input class="form-check-input" type="checkbox" id="temporary" name="is_temporary"
{% if list.is_temporary %}checked{% endif %}>
<label class="form-check-label" for="temporary">⏳ Tymczasowa</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="archived" name="is_archived"
{% if list.is_archived %}checked{% endif %}>
<label class="form-check-label" for="archived">📦 Archiwalna</label>
</div>
</div>
</div>
<!-- Data/godzina wygaśnięcia -->
<!-- Data/Godzina wygaśnięcia -->
<div class="row mb-4">
<div class="col-md-6">
<label for="expires_date" class="form-label">📅 Data wygaśnięcia</label>
@@ -79,17 +58,17 @@
</div>
</div>
<!-- Utworzono / Zmień miesiąc -->
<!-- Data utworzenia / Przenieś miesiąc -->
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">📆 Utworzono</label>
<p class="form-control-plaintext text-white">
<span class="badge bg-success rounded-pill text-dark ms-1">
{{ list.created_at.strftime('%Y-%m-%d') }}
</p>
</span>
</div>
<div class="col-md-6">
<label for="created_month" class="form-label">📁 Przenieś do miesiąca</label>
<input type="month" id="created_month" name="created_month"
<label for="move_to_month" class="form-label">📁 Przenieś do miesiąca</label>
<input type="month" id="move_to_month" name="move_to_month"
class="form-control bg-dark text-white border-secondary rounded">
</div>
</div>
@@ -108,16 +87,13 @@
</select>
</div>
<!-- Link udostępnienia -->
<div class="mb-4">
<label class="form-label">🔗 Link do udostępnienia</label>
<input type="text" class="form-control bg-dark text-white border-secondary rounded" readonly
value="{{ request.url_root }}share/{{ list.share_token }}">
<!-- Przyciski -->
<div class="btn-group mt-4" role="group">
<button type="submit" class="btn btn-outline-light">💾 Zapisz</button>
<a href="{{ url_for('main_page') }}" class="btn btn-outline-light">❌ Anuluj</a>
</div>
<button type="submit" class="btn btn-success me-2">💾 Zapisz zmiany</button>
</form>
</div>
</div>

View File

@@ -77,7 +77,7 @@
</div>
<div class="mt-3">
<button type="submit" class="btn btn-success">💾 Zapisz zmiany</button>
<button type="submit" class="btn btn-success">💾 Zapisz</button>
</div>
</form>

View File

@@ -28,7 +28,6 @@
{% if substrings_tomselect | select("in", request.path) | list | length > 0 %}
<link href="{{ url_for('static_bp.serve_css_lib', filename='tom-select.bootstrap5.min.css') }}" rel="stylesheet">
{% endif %}
</head>
<body class="bg-dark text-white">
@@ -118,7 +117,6 @@
<script src="{{ url_for('static_bp.serve_js_lib', filename='cropper.min.js') }}"></script>
{% endif %}
{% set substrings = ['/edit_my_list', '/admin/edit_list', '/admin/mass_edit_categories'] %}
{% if substrings | select("in", request.path) | list | length > 0 %}
<script src="{{ url_for('static_bp.serve_js_lib', filename='tom-select.complete.min.js') }}"></script>
@@ -127,7 +125,6 @@
{% endif %}
{% block scripts %}{% endblock %}
</body>
</html>

View File

@@ -76,7 +76,7 @@
</select>
<div class="btn-group mt-4" role="group">
<button type="submit" class="btn btn-outline-success">Zapisz</button>
<button type="submit" class="btn btn-outline-light">💾 Zapisz</button>
<a href="{{ url_for('main_page') }}" class="btn btn-outline-light">Anuluj</a>
</div>
</form>