wersja 0.0.4 #7

Merged
gru merged 47 commits from zliczanie_wydatkow_i_poprawki_w_js into master 2025-07-28 22:17:13 +02:00
3 changed files with 32 additions and 15 deletions
Showing only changes of commit c6b089472a - Show all commits

13
app.py
View File

@@ -1196,11 +1196,10 @@ def view_list(list_id):
is_owner = current_user.id == shopping_list.owner_id
for item in items:
if item.added_by_id != item.owner_id:
item.added_by = item.added_by_user.username if item.added_by_user else "?"
if item.added_by != shopping_list.owner_id:
item.added_by_display = item.added_by_user.username if item.added_by_user else "?"
else:
item.added_by = None
item.added_by_display = None
return render_template(
"list.html",
@@ -1330,10 +1329,10 @@ def shared_list(token=None, list_id=None):
)
for item in items:
if item.added_by_id != item.owner_id:
item.added_by = item.added_by_user.username if item.added_by_user else "?"
if item.added_by != shopping_list.owner_id:
item.added_by_display = item.added_by_user.username if item.added_by_user else "?"
else:
item.added_by = None
item.added_by_display = None
return render_template(
"list_share.html",

View File

@@ -110,14 +110,23 @@
<div class="info-line ms-4 small d-flex flex-wrap gap-2" id="info-{{ item.id }}">
{% set info_parts = [] %}
{% if item.note %}
<span class="text-danger">[ <b>{{ item.note }}</b> ]</span>
{% set _ = info_parts.append('<span class="text-danger">[ <b>' ~ item.note ~ '</b> ]</span>') %}
{% endif %}
{% if item.not_purchased_reason %}
<span class="text-dark">[ <b>Powód: {{ item.not_purchased_reason }}</b> ]</span>
{% set _ = info_parts.append('<span class="text-dark">[ <b>Powód: ' ~ item.not_purchased_reason ~ '</b>
]</span>') %}
{% endif %}
{% if item.added_by and item.owner_id and item.added_by_id and item.added_by_id != item.owner_id %}
<span class="text-info">[ Dodał/a: <b>{{ item.added_by }}</b> ]</span>
{% if item.added_by_display %}
{% set _ = info_parts.append('<span class="text-info">[ Dodał/a: <b>' ~ item.added_by_display ~ '</b> ]</span>')
%}
{% endif %}
{% if info_parts %}
<div class="info-line ms-4 small d-flex flex-wrap gap-2" id="info-{{ item.id }}">
{{ info_parts | join(' ') | safe }}
</div>
{% endif %}
</div>

View File

@@ -44,14 +44,23 @@
</span>
<div class="info-line ms-4 small d-flex flex-wrap gap-2" id="info-{{ item.id }}">
{% set info_parts = [] %}
{% if item.note %}
<span class="text-danger">[ <b>{{ item.note }}</b> ]</span>
{% set _ = info_parts.append('<span class="text-danger">[ <b>' ~ item.note ~ '</b> ]</span>') %}
{% endif %}
{% if item.not_purchased_reason %}
<span class="text-dark">[ <b>Powód: {{ item.not_purchased_reason }}</b> ]</span>
{% set _ = info_parts.append('<span class="text-dark">[ <b>Powód: ' ~ item.not_purchased_reason ~ '</b>
]</span>') %}
{% endif %}
{% if item.added_by and item.owner_id and item.added_by_id and item.added_by_id != item.owner_id %}
<span class="text-info">[ Dodał/a: <b>{{ item.added_by }}</b> ]</span>
{% if item.added_by_display %}
{% set _ = info_parts.append('<span class="text-info">[ Dodał/a: <b>' ~ item.added_by_display ~ '</b> ]</span>')
%}
{% endif %}
{% if info_parts %}
<div class="info-line ms-4 small d-flex flex-wrap gap-2" id="info-{{ item.id }}">
{{ info_parts | join(' ') | safe }}
</div>
{% endif %}
</div>