Compare commits
2
Commits
cda3ad2203
...
4341351923
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4341351923 | ||
|
|
41b0b72532 |
@@ -441,9 +441,9 @@ def shared_list(token=None, list_id=None):
|
||||
]
|
||||
|
||||
for item in items:
|
||||
if item.added_by != shopping_list.owner_id:
|
||||
if item.added_by and item.added_by != shopping_list.owner_id:
|
||||
item.added_by_display = (
|
||||
item.added_by_user.username if item.added_by_user else "?"
|
||||
item.added_by_user.username if item.added_by_user else None
|
||||
)
|
||||
else:
|
||||
item.added_by_display = None
|
||||
|
||||
@@ -1149,16 +1149,36 @@ td select.tom-dark {
|
||||
|
||||
html, body {
|
||||
min-height: 100%;
|
||||
background:
|
||||
background-color: var(--app-bg);
|
||||
background-image:
|
||||
radial-gradient(circle at top left, rgba(39, 208, 125, 0.18), transparent 24%),
|
||||
radial-gradient(circle at top right, rgba(74, 144, 226, 0.16), transparent 22%),
|
||||
linear-gradient(180deg, #09111d 0%, #08121f 38%, #060d18 100%);
|
||||
background-repeat: no-repeat;
|
||||
color: var(--app-text);
|
||||
}
|
||||
|
||||
html {
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
body.app-body {
|
||||
position: relative;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
min-height: 100svh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
font-feature-settings: "ss01" on, "cv02" on;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
|
||||
@supports (padding: env(safe-area-inset-top)) {
|
||||
html, body {
|
||||
min-height: calc(100% + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
}
|
||||
|
||||
.app-backdrop {
|
||||
@@ -1170,7 +1190,7 @@ body.app-body {
|
||||
|
||||
.app-header {
|
||||
z-index: 1035;
|
||||
padding: 0.75rem 0 0;
|
||||
padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0 0;
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
@@ -1234,6 +1254,7 @@ body.app-body {
|
||||
}
|
||||
|
||||
.app-main {
|
||||
flex: 1 0 auto;
|
||||
padding: 1rem 0 2.5rem;
|
||||
}
|
||||
|
||||
@@ -1242,7 +1263,8 @@ body.app-body {
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
padding: 1rem 0 2rem;
|
||||
margin-top: auto;
|
||||
padding: 1rem 0 calc(1.35rem + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
|
||||
.app-footer__inner {
|
||||
@@ -1659,7 +1681,8 @@ body.app-body {
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
padding: 0.5rem 0 1rem;
|
||||
margin-top: auto;
|
||||
padding: 0.5rem 0 calc(0.85rem + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
|
||||
.app-footer__inner {
|
||||
@@ -1916,7 +1939,7 @@ input[type="checkbox"].form-check-input {
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
padding-bottom: 0.8rem;
|
||||
padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4135,6 +4158,16 @@ input[type="checkbox"].form-check-input,
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.shopping-item-text .item-added-by-meta {
|
||||
color: currentColor;
|
||||
opacity: .72;
|
||||
font-size: .92em;
|
||||
}
|
||||
|
||||
.shopping-item-text .item-added-by-meta b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.shopping-item-name,
|
||||
.shopping-item-text .info-line {
|
||||
overflow-wrap: break-word;
|
||||
|
||||
@@ -350,9 +350,12 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
|
||||
if (item.not_purchased_reason) {
|
||||
infoParts.push(`<span class="text-dark">[ <b>Powód: ${escapeHtml(item.not_purchased_reason)}</b> ]</span>`);
|
||||
}
|
||||
const addedByDisplay = item.added_by_display;
|
||||
if (addedByDisplay) {
|
||||
infoParts.push(`<span class="text-info">[ Dodał/a: <b>${escapeHtml(addedByDisplay)}</b> ]</span>`);
|
||||
const addedByDisplay = item.added_by_display || (isShare ? item.added_by : '');
|
||||
const addedById = item.added_by_id != null ? Number(item.added_by_id) : null;
|
||||
const ownerId = item.owner_id != null ? Number(item.owner_id) : null;
|
||||
const shouldShowAddedBy = !!addedByDisplay && (addedById === null || ownerId === null || addedById !== ownerId);
|
||||
if (shouldShowAddedBy) {
|
||||
infoParts.push(`<span class="item-added-by-meta">· dodał/a: <b>${escapeHtml(addedByDisplay)}</b></span>`);
|
||||
}
|
||||
const infoHtml = infoParts.length
|
||||
? `<span class="info-line small" id="info-${item.id}">${infoParts.join(' ')}</span>`
|
||||
@@ -375,7 +378,7 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
|
||||
|
||||
if (item.not_purchased) {
|
||||
actionButtons += `
|
||||
<button type="button" class="${wideBtn}" ${isArchived ? 'disabled' : `onclick="unmarkNotPurchased(${item.id})"`}>✅ Przywróć</button>`;
|
||||
<button type="button" class="${wideBtn}" ${isArchived ? 'disabled' : `onclick="unmarkNotPurchased(${item.id})"`}>Przywróć</button>`;
|
||||
} else if (!isShare || canShowShareActions || isOwner) {
|
||||
actionButtons += `
|
||||
<button type="button" class="${iconBtn}" ${canMarkNotPurchased ? `onclick="markNotPurchasedModal(event, ${item.id})"` : 'disabled'}>⚠️</button>`;
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="theme-color" content="#07111f">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<title>{% block title %}Live Lista Zakupów{% endblock %}</title>
|
||||
<link rel="icon" type="image/svg+xml" href="{{ url_for('favicon') }}">
|
||||
|
||||
@@ -132,9 +135,8 @@
|
||||
<p class="mb-1">
|
||||
<a href="https://git.linuxiarz.pl/gru/lista_zakupowa_live" target="_blank" class="link-success text-decoration-none">
|
||||
source code
|
||||
</a>
|
||||
</a> · v{{ APP_VERSION }}
|
||||
</p>
|
||||
<div class="small">v{{ APP_VERSION }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
{% set info_parts = [] %}
|
||||
{% if item.note %}{% set _ = info_parts.append('<span class="text-danger">[ <b>' ~ item.note ~ '</b> ]</span>') %}{% endif %}
|
||||
{% if item.not_purchased_reason %}{% set _ = info_parts.append('<span class="text-dark">[ <b>Powód: ' ~ item.not_purchased_reason ~ '</b> ]</span>') %}{% endif %}
|
||||
{% if item.added_by_display %}{% set _ = info_parts.append('<span class="text-info">[ Dodał/a: <b>' ~ item.added_by_display ~ '</b> ]</span>') %}{% endif %}
|
||||
{% if item.added_by_display %}{% set _ = info_parts.append('<span class="item-added-by-meta">· dodał/a: <b>' ~ item.added_by_display ~ '</b></span>') %}{% endif %}
|
||||
{% if info_parts %}
|
||||
<span class="info-line small" id="info-{{ item.id }}">{{ info_parts | join(' ') | safe }}</span>
|
||||
{% endif %}
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
{% if item.not_purchased %}
|
||||
<button type="button" class="btn btn-outline-light btn-sm shopping-action-btn shopping-action-btn--wide" {% if list.is_archived %}disabled{% else
|
||||
%}onclick="unmarkNotPurchased({{ item.id }})" {% endif %}>✅ Przywróć</button>
|
||||
%}onclick="unmarkNotPurchased({{ item.id }})" {% endif %}>Przywróć</button>
|
||||
{% elif not item.not_purchased %}
|
||||
<button type="button" class="btn btn-outline-light btn-sm shopping-action-btn" {% if list.is_archived %}disabled{% else
|
||||
%}onclick="markNotPurchasedModal(event, {{ item.id }})" {% endif %}>⚠️</button>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
{% set info_parts = [] %}
|
||||
{% if item.note %}{% set _ = info_parts.append('<span class="text-danger">[ <b>' ~ item.note ~ '</b> ]</span>') %}{% endif %}
|
||||
{% if item.not_purchased_reason %}{% set _ = info_parts.append('<span class="text-dark">[ <b>Powód: ' ~ item.not_purchased_reason ~ '</b> ]</span>') %}{% endif %}
|
||||
{% if item.added_by_display %}{% set _ = info_parts.append('<span class="text-info">[ Dodał/a: <b>' ~ item.added_by_display ~ '</b> ]</span>') %}{% endif %}
|
||||
{% if item.added_by_display %}{% set _ = info_parts.append('<span class="item-added-by-meta">· dodał/a: <b>' ~ item.added_by_display ~ '</b></span>') %}{% endif %}
|
||||
{% if info_parts %}
|
||||
<span class="info-line small" id="info-{{ item.id }}">{{ info_parts | join(' ') | safe }}</span>
|
||||
{% endif %}
|
||||
@@ -68,7 +68,7 @@
|
||||
{% if item.not_purchased %}
|
||||
<button type="button" class="btn btn-outline-light btn-sm shopping-action-btn shopping-action-btn--wide" {% if list.is_archived %}disabled{% else %}
|
||||
onclick="unmarkNotPurchased({{ item.id }})" {% endif %}>
|
||||
✅ Przywróć
|
||||
Przywróć
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-outline-light btn-sm shopping-action-btn" {% if list.is_archived %}disabled{% else %}
|
||||
|
||||
Reference in New Issue
Block a user