funckja niekupione

This commit is contained in:
Mateusz Gruszczyński
2025-07-15 22:48:25 +02:00
parent 2c6887095d
commit 3b94f93892
6 changed files with 870 additions and 473 deletions

View File

@@ -87,9 +87,16 @@ Lista: <strong>{{ list.title }}</strong>
<ul id="items" class="list-group mb-3">
{% for item in items %}
<li data-name="{{ item.name|lower }}" id="item-{{ item.id }}" class="list-group-item d-flex justify-content-between align-items-center flex-wrap {% if item.purchased %}bg-success text-white{% else %}item-not-checked{% endif %}" id="item-{{ item.id }}">
<div class="d-flex align-items-center flex-wrap gap-2 flex-grow-1">
<input class="large-checkbox" type="checkbox" {% if item.purchased %}checked{% endif %} {% if list.is_archived %}disabled{% endif %}>
<li data-name="{{ item.name|lower }}" id="item-{{ item.id }}"
class="list-group-item d-flex justify-content-between align-items-center flex-wrap clickable-item
{% if item.purchased %}bg-success text-white{% elif item.not_purchased %}bg-warning text-dark{% else %}item-not-checked{% endif %}">
<div class="d-flex align-items-center gap-3 flex-grow-1">
<input id="checkbox-{{ item.id }}" class="large-checkbox" type="checkbox"
{% if item.purchased %}checked{% endif %}
{% if list.is_archived %}disabled{% endif %}>
<span id="name-{{ item.id }}" class="{% if item.purchased %}text-white{% else %}text-white{% endif %}">
{{ item.name }}
{% if item.quantity and item.quantity > 1 %}

View File

@@ -27,8 +27,16 @@
<ul id="items" class="list-group mb-3">
{% for item in items %}
<li data-name="{{ item.name|lower }}" id="item-{{ item.id }}" class="list-group-item d-flex justify-content-between align-items-center flex-wrap clickable-item {% if item.purchased %}bg-success text-white{% else %}item-not-checked{% endif %}" id="item-{{ item.id }}"> <div class="d-flex align-items-center gap-3 flex-grow-1">
<input class="large-checkbox" type="checkbox" {% if item.purchased %}checked{% endif %} {% if list.is_archived %}disabled{% endif %}>
<li data-name="{{ item.name|lower }}" id="item-{{ item.id }}"
class="list-group-item d-flex justify-content-between align-items-center flex-wrap clickable-item
{% if item.purchased %}bg-success text-white{% elif item.not_purchased %}bg-warning text-dark{% else %}item-not-checked{% endif %}">
<div class="d-flex align-items-center gap-3 flex-grow-1">
<input id="checkbox-{{ item.id }}" class="large-checkbox" type="checkbox"
{% if item.purchased %}checked{% endif %}
{% if list.is_archived %}disabled{% endif %}>
<span id="name-{{ item.id }}" class="{% if item.purchased %}text-white{% else %}text-white{% endif %}">
{{ item.name }}
{% if item.quantity and item.quantity > 1 %}
@@ -40,10 +48,25 @@
<small class="text-danger ms-4">[ <b>{{ item.note }}</b> ]</small>
{% endif %}
</div>
<button type="button" class="btn btn-sm btn-outline-info"
{% if list.is_archived %}disabled{% else %}onclick="openNoteModal(event, {{ item.id }})"{% endif %}>
📝
</button>
<div class="btn-group btn-group-sm" role="group">
{% if item.not_purchased %}
<button type="button" class="btn btn-outline-success"
{% if list.is_archived %}disabled{% else %}onclick="unmarkNotPurchased({{ item.id }})"{% endif %}>
✅ Przywróć
</button>
{% else %}
<button type="button" class="btn btn-outline-light"
{% if list.is_archived %}disabled{% else %}onclick="markNotPurchasedModal(event, {{ item.id }})"{% endif %}>
⚠️
</button>
<button type="button" class="btn btn-outline-light"
{% if list.is_archived %}disabled{% else %}onclick="openNoteModal(event, {{ item.id }})"{% endif %}>
📝
</button>
{% endif %}
</div>
</li>
{% else %}
<li id="empty-placeholder"