Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3e03d7a8c |
No files matched your search
@@ -1,8 +1,3 @@
|
||||
# UWAGA:
|
||||
# Po zmianie pliku .env samo `docker compose restart` może nie wystarczyć.
|
||||
# Aby nowe wartości zostały na pewno wczytane do kontenerów, użyj:
|
||||
# docker compose up -d --force-recreate
|
||||
|
||||
# APP_PORT:
|
||||
# Domyślny port, na którym uruchamiana jest aplikacja Flask
|
||||
# Domyślnie: 8000
|
||||
@@ -11,30 +6,27 @@ APP_PORT=8000
|
||||
# SECRET_KEY:
|
||||
# Klucz używany przez Flask do zabezpieczenia sesji, tokenów i formularzy
|
||||
# Powinien być długi i trudny do odgadnięcia
|
||||
# Może zawierać znaki specjalne
|
||||
SECRET_KEY="supersekretnyklucz123"
|
||||
SECRET_KEY=supersekretnyklucz123
|
||||
|
||||
# SYSTEM_PASSWORD:
|
||||
# Hasło główne administratora systemowego, używane np. przy inicjalizacji
|
||||
# Domyślnie: admin
|
||||
# Może zawierać znaki specjalne
|
||||
SYSTEM_PASSWORD="admin"
|
||||
SYSTEM_PASSWORD=admin
|
||||
|
||||
# DEFAULT_ADMIN_USERNAME:
|
||||
# Domyślna nazwa użytkownika administratora (tworzona przy starcie)
|
||||
# Domyślnie: admin
|
||||
DEFAULT_ADMIN_USERNAME="admin"
|
||||
DEFAULT_ADMIN_USERNAME=admin
|
||||
|
||||
# DEFAULT_ADMIN_PASSWORD:
|
||||
# Domyślne hasło administratora
|
||||
# Domyślnie: admin123
|
||||
# Może zawierać znaki specjalne
|
||||
DEFAULT_ADMIN_PASSWORD="admin123"
|
||||
DEFAULT_ADMIN_PASSWORD=admin123
|
||||
|
||||
# UPLOAD_FOLDER:
|
||||
# Ścieżka (względna) do katalogu, gdzie zapisywane są wgrywane pliki
|
||||
# Domyślnie: uploads
|
||||
UPLOAD_FOLDER="uploads"
|
||||
UPLOAD_FOLDER=uploads
|
||||
|
||||
# SESSION_TIMEOUT_MINUTES:
|
||||
# Czas bezczynności użytkownika (w minutach), po którym sesja wygasa
|
||||
@@ -49,12 +41,8 @@ AUTH_COOKIE_MAX_AGE=86400
|
||||
# AUTHORIZED_COOKIE_VALUE:
|
||||
# Wartość ciasteczka uprawniającego do dostępu (np. do zasobów zabezpieczonych)
|
||||
# Powinna być trudna do przewidzenia
|
||||
# Chodzi o zabezpieczenie strony "hasłem głównym", czyli endpointem /system-auth
|
||||
# Może zawierać znaki specjalne
|
||||
# UWAGA: zmiana SYSTEM_PASSWORD nie unieważnia automatycznie wcześniej wydanych ciasteczek.
|
||||
# Aby wymusić ponowną autoryzację, zmień także AUTHORIZED_COOKIE_VALUE
|
||||
# lub wyczyść ciasteczka w przeglądarce.
|
||||
AUTHORIZED_COOKIE_VALUE="twoj_wlasny_hash"
|
||||
# Chodzi to o zabezpieczenie strony "hasłęm głównym czyli endpointem /system-auth"
|
||||
AUTHORIZED_COOKIE_VALUE=twoj_wlasny_hash
|
||||
|
||||
# SESSION_COOKIE_SECURE:
|
||||
# Określa, czy ciasteczko sesyjne (Flask session) ma mieć ustawiony atrybut "Secure".
|
||||
@@ -66,54 +54,39 @@ SESSION_COOKIE_SECURE=0
|
||||
# BCRYPT_PEPPER:
|
||||
# Dodatkowy „sekretny klucz” (pepper) dodawany do hasła przed zahashowaniem
|
||||
# Zwiększa bezpieczeństwo przechowywanych haseł
|
||||
# Może zawierać znaki specjalne
|
||||
BCRYPT_PEPPER="sekretnyKluczbcrypt"
|
||||
BCRYPT_PEPPER=sekretnyKluczbcrypt
|
||||
|
||||
# HEALTHCHECK_TOKEN:
|
||||
# Token wykorzystywany do sprawdzania stanu aplikacji (np. w Docker Compose)
|
||||
# Domyślnie: alamapsaikota123
|
||||
# Może zawierać znaki specjalne
|
||||
HEALTHCHECK_TOKEN="alamapsaikota123"
|
||||
HEALTHCHECK_TOKEN=alamapsaikota123
|
||||
|
||||
# Rodzaj bazy: sqlite, pgsql, mysql
|
||||
# Możliwe wartości: sqlite / pgsql / mysql
|
||||
DB_ENGINE="sqlite"
|
||||
# Mozliwe wartosci: sqlite / pgsql / mysql
|
||||
DB_ENGINE=sqlite
|
||||
|
||||
# --- Konfiguracja dla sqlite ---
|
||||
# Plik bazy będzie utworzony automatycznie w katalogu ./instance
|
||||
# Pozostałe zmienne są ignorowane przy DB_ENGINE=sqlite
|
||||
# Plik bazy bedzie utworzony automatycznie w katalogu ./instance
|
||||
# Pozostale zmienne sa ignorowane przy DB_ENGINE=sqlite
|
||||
|
||||
# --- Konfiguracja dla pgsql ---
|
||||
# Ustaw DB_ENGINE=pgsql
|
||||
# Domyślny port PostgreSQL to 5432
|
||||
# Wymaga działającego serwera PostgreSQL (np. kontener `postgres`)
|
||||
# Domyslny port PostgreSQL to 5432
|
||||
# Wymaga dzialajacego serwera PostgreSQL (np. kontener `postgres`)
|
||||
|
||||
# --- Konfiguracja dla mysql ---
|
||||
# Ustaw DB_ENGINE=mysql
|
||||
# Domyślny port MySQL to 3306
|
||||
# Wymaga kontenera z MySQL i użytkownika z dostępem do bazy
|
||||
# Domyslny port MySQL to 3306
|
||||
# Wymaga kontenera z MySQL i uzytkownika z dostepem do bazy
|
||||
|
||||
# Wspólne zmienne (dla pgsql, mysql)
|
||||
# Wspolne zmienne (dla pgsql, mysql)
|
||||
# DB_HOST = pgsql lub mysql zgodnie z deployem (profil w docker-compose.yml)
|
||||
|
||||
DB_HOST="pgsql"
|
||||
DB_HOST=pgsql
|
||||
DB_PORT=5432
|
||||
|
||||
# DB_NAME:
|
||||
# Nazwa bazy danych
|
||||
# Może zawierać znaki specjalne, ale zalecane są proste nazwy
|
||||
DB_NAME="myapp"
|
||||
|
||||
# DB_USER:
|
||||
# Użytkownik bazy danych
|
||||
# Może zawierać znaki specjalne
|
||||
DB_USER="user"
|
||||
|
||||
# DB_PASSWORD:
|
||||
# Hasło do bazy danych
|
||||
# Może zawierać znaki specjalne
|
||||
# Zalecane jest używanie wartości w cudzysłowach
|
||||
DB_PASSWORD="pass"
|
||||
DB_NAME=myapp
|
||||
DB_USER=user
|
||||
DB_PASSWORD=pass
|
||||
|
||||
# ========================
|
||||
# Nagłówki bezpieczeństwa
|
||||
@@ -191,14 +164,8 @@ UPLOADS_CACHE_CONTROL="max-age=3600, immutable"
|
||||
# Lista domyślnych kategorii tworzonych automatycznie przy starcie aplikacji,
|
||||
# jeśli nie istnieją w bazie danych.
|
||||
# Podaj w formacie CSV (oddzielone przecinkami) – kolejność zostanie zachowana.
|
||||
# Możesz dodać własne kategorie.
|
||||
# UWAGA: wielkość liter w nazwach jest zachowywana, ale porównywanie odbywa się
|
||||
# Możesz dodać własne kategorie
|
||||
# UWAGA: Wielkość liter w nazwach jest zachowywana, ale porównywanie odbywa się
|
||||
# bez rozróżniania wielkości liter (case-insensitive).
|
||||
# Domyślnie: poniższa lista
|
||||
DEFAULT_CATEGORIES="Spożywcze,Budowlane,Zabawki,Chemia,Inne,Elektronika,Odzież i obuwie,Artykuły biurowe,Kosmetyki i higiena,Motoryzacja,Ogród i rośliny,Zwierzęta,Sprzęt sportowy,Książki i prasa,Narzędzia i majsterkowanie,RTV / AGD,Apteka i suplementy,Artykuły dekoracyjne,Gry i hobby,Usługi,Pieczywo"
|
||||
|
||||
# Waluta używana w całej aplikacji (kwoty, paragony, analizy)
|
||||
# Użyj kodu ISO 4217 (np. PLN, EUR, USD, GBP)
|
||||
# Domyślnie: PLN (jeśli zmienna nie jest ustawiona)
|
||||
|
||||
CURRENCY_CODE=PLN
|
||||
@@ -3,15 +3,11 @@ venv
|
||||
env
|
||||
*.db
|
||||
__pycache__
|
||||
/uploads/
|
||||
uploads/
|
||||
.DS_Store
|
||||
db/mysql/*
|
||||
db/pgsql/*
|
||||
db/shopping.db
|
||||
*.swp
|
||||
version.txt
|
||||
deploy/varnish/default.vcl
|
||||
*.zip
|
||||
shopping_app/uploads/*
|
||||
!shopping_app/uploads/.uploads
|
||||
|
||||
deploy/varnish/default.vcl
|
||||
@@ -9,53 +9,22 @@ flask admins promote <username|id>
|
||||
flask admins demote <username|id>
|
||||
flask admins set-password <username|id> <password>
|
||||
|
||||
Opis:
|
||||
- list: pokazuje wszystkich uzytkownikow wraz z ID i rola
|
||||
- create: tworzy konto admina lub zwyklego uzytkownika
|
||||
- promote: nadaje uprawnienia administratora
|
||||
- demote: odbiera uprawnienia administratora
|
||||
- set-password: ustawia nowe haslo dla wskazanego konta
|
||||
|
||||
Listy
|
||||
-----
|
||||
flask lists copy-schedule --source-list-id 12 --when "2026-03-20 18:30"
|
||||
flask lists copy-schedule --source-list-id 12 --when "2026-03-20 18:30" --owner admin
|
||||
flask lists copy-schedule --source-list-id 12 --when "2026-03-20 18:30" --title "Zakupy piatkowe"
|
||||
flask lists move --list-id 12 --when "2026-03-21 09:00"
|
||||
flask lists move --list-id 12 --when "2026-03-21 09:00" --keep-item-times --keep-expiry
|
||||
flask lists archive --list-id 12
|
||||
flask lists unarchive --list-id 12
|
||||
flask lists assign-owner --list-id 12 --owner admin
|
||||
flask lists create-from-template --template-id 5 --owner admin --when "2026-03-22 08:00"
|
||||
flask lists create-from-template --template-id 5 --owner admin --title "Weekend"
|
||||
flask lists delete --list-id 12
|
||||
flask lists rename --list-id 12 --title "Nowa nazwa listy"
|
||||
flask lists duplicate-many --source-list-id 12 --when-list "2026-03-23 08:00,2026-03-24 08:00,2026-03-25 08:00"
|
||||
flask lists duplicate-many --source-list-id 12 --when-list "2026-03-23 08:00,2026-03-24 08:00" --owner admin --title-prefix "Sklep"
|
||||
|
||||
Zasady dzialania
|
||||
----------------
|
||||
- copy-schedule tworzy nowa liste na podstawie istniejacej
|
||||
- copy-schedule kopiuje pozycje i przypisane kategorie
|
||||
- copy-schedule ustawia nowy created_at na wartosc z parametru --when
|
||||
- kopiuje pozycje i przypisane kategorie
|
||||
- ustawia nowy created_at na wartosc z parametru --when
|
||||
- gdy lista byla tymczasowa i miala expires_at, termin wygasniecia jest przesuwany o ten sam odstep czasu
|
||||
- wydatki i paragony nie sa kopiowane
|
||||
- move przenosi istniejaca liste na wskazany dzien/godzine
|
||||
- move domyslnie przesuwa rowniez czasy pozycji i expires_at o ten sam offset czasu
|
||||
- move z opcja --keep-item-times zostawia added_at i purchased_at bez zmian
|
||||
- move z opcja --keep-expiry zostawia expires_at bez zmian
|
||||
- archive oznacza liste jako archiwalna
|
||||
- unarchive przywraca liste z archiwum
|
||||
- assign-owner zmienia wlasciciela listy
|
||||
- create-from-template tworzy nowa liste z szablonu dla wskazanego wlasciciela
|
||||
- create-from-template bez --when ustawia biezacy czas UTC
|
||||
- delete usuwa liste wraz z powiazanymi pozycjami, historią i paragonami zaleznymi od relacji bazy
|
||||
- rename zmienia tytul listy
|
||||
- duplicate-many tworzy wiele kopii tej samej listy dla wielu terminow przekazanych w --when-list
|
||||
- duplicate-many opcjonalnie pozwala zmienic wlasciciela i nadac prefiks nazwy nowym listom
|
||||
|
||||
|
||||
SZABLONY I HISTORIA:
|
||||
- Historia zmian listy jest widoczna w widoku listy wlasciciela.
|
||||
- Szablon mozna utworzyc z panelu admina lub z poziomu listy wlasciciela.
|
||||
- Admin moze szybko utworzyc liste z szablonu i zduplikowac liste jednym kliknieciem.
|
||||
- Operacje CLI takie jak copy-schedule, move, archive, unarchive, assign-owner, rename i create-from-template sa zapisywane w historii listy.
|
||||
- Historia zmian listy jest widoczna w widoku listy właściciela.
|
||||
- Szablon można utworzyć z panelu admina lub z poziomu listy właściciela.
|
||||
- Admin może szybko utworzyć listę z szablonu i zduplikować listę jednym kliknięciem.
|
||||
@@ -1,21 +1,51 @@
|
||||
# Aplikacja List Zakupów
|
||||
|
||||
Aplikacja webowa do zarządzania listami zakupów z obsługą użytkowników, OCR paragonów, statystykami i trybem współdzielenia.
|
||||
Prosta aplikacja webowa do zarządzania listami zakupów z obsługą użytkowników, OCR paragonów, statystykami i trybem współdzielenia.
|
||||
|
||||
## Główne funkcje
|
||||
|
||||
- Logowanie i zarządzanie użytkownikami (admin/user)
|
||||
- Tworzenie list zakupów z pozycjami i ilością
|
||||
- Wgrywanie paragonów (podstawowa obsługa OCR)
|
||||
- Archiwizacja i udostępnianie list (publiczne/prywatne)
|
||||
- Statystyki wydatków z podziałem na okresy, statystyki dla użytkowników
|
||||
- Panel administracyjny (statystyki, produkty, paragony, zarządzanie, użytkowmicy)
|
||||
- Tokeny API administratora i endpoint do pobierania ostatnich wydatków
|
||||
- Ujednolicony UI formularzy, tabel i przycisków oraz drobne usprawnienia UX
|
||||
|
||||
## Wymagania
|
||||
|
||||
- Docker
|
||||
- Python 3.9+
|
||||
- Docker (opcjonalnie dla produkcji)
|
||||
|
||||
## Instalacja
|
||||
## Instalacja lokalna (deweloperska)
|
||||
|
||||
1. Sklonuj repozytorium:
|
||||
|
||||
```bash
|
||||
git pull https://git.linuxiarz.pl/gru/lista_zakupowa_live.git
|
||||
git clone https://git.linuxiarz.pl/gru/lista_zakupowa_live.git
|
||||
cd lista_zakupowa_live
|
||||
```
|
||||
|
||||
1. Skonfiguruj `.env` z pliku `.env.example`
|
||||
2. Utwórz i uzupełnij plik `.env` (zobacz `.env example`).
|
||||
|
||||
3. Utwórz środowisko i zainstaluj zależności:
|
||||
|
||||
```bash
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
4. Uruchom aplikację:
|
||||
|
||||
```bash
|
||||
flask --app app.py run
|
||||
```
|
||||
|
||||
## Deploy z Docker Compose - stack (zalecana)
|
||||
|
||||
1. Skonfiguruj `.env`.
|
||||
|
||||
2.1 Uruchom: (pgsql)
|
||||
|
||||
@@ -35,16 +65,9 @@ Aplikacja webowa do zarządzania listami zakupów z obsługą użytkowników, OC
|
||||
bash deploy_docker.sh sqlite
|
||||
```
|
||||
|
||||
2.3 Restart:
|
||||
```bash
|
||||
bash deploy_docker.sh pgsql restart
|
||||
lub
|
||||
bash deploy_docker.sh sqlite restart
|
||||
```
|
||||
|
||||
Aplikacja będzie dostępna pod `http://localhost:8000`.
|
||||
|
||||
## Domyślne dane logowania - konfigurowane z pliku `.env`
|
||||
## Domyślne dane logowania
|
||||
|
||||
- Główne hasło systemowe: `admin`
|
||||
- Admin: `admin` / `admin123`
|
||||
@@ -57,79 +80,15 @@ Ustaw `DB_ENGINE` oraz odpowiednie zmienne w `.env`:
|
||||
|
||||
Przykład dla PostgreSQL:
|
||||
|
||||
```bash
|
||||
DB_ENGINE=pgsql
|
||||
DB_HOST=db
|
||||
DB_PORT=5432
|
||||
DB_NAME=myapp
|
||||
DB_USER=user
|
||||
DB_PASSWORD=pass
|
||||
```
|
||||
```env
|
||||
DB_ENGINE=pgsql
|
||||
DB_HOST=db
|
||||
DB_PORT=5432
|
||||
DB_NAME=myapp
|
||||
DB_USER=user
|
||||
DB_PASSWORD=pass
|
||||
```
|
||||
|
||||
## CLI
|
||||
|
||||
Opis komend administracyjnych znajduje sie w pliku `KOMENDY_CLI.txt`.
|
||||
|
||||
Komendy CLI uruchamiamy wewnatrz kontenera aplikacji. Najwygodniej wejsc do katalogu projektu i wykonac polecenie przez `docker compose exec app`.
|
||||
|
||||
Przykladowe:
|
||||
|
||||
```bash
|
||||
cd /opt/lista_zakupowa_live
|
||||
docker compose -f docker/compose.yml exec app sh -c 'flask lists copy-schedule --source-list-id 393 --when "2026-03-22 11:30" --owner admin'
|
||||
```
|
||||
|
||||
Dodatkowe przyklady:
|
||||
|
||||
```bash
|
||||
docker compose -f docker/compose.yml exec app sh -c 'flask lists move --list-id 393 --when "2026-03-23 08:00"'
|
||||
|
||||
docker compose -f docker/compose.yml exec app sh -c 'flask lists rename --list-id 393 --title "Zakupy na poniedzialek"'
|
||||
|
||||
docker compose -f docker/compose.yml exec app sh -c 'flask lists create-from-template --template-id 7 --owner admin --when "2026-03-24 09:15" --title "Poranna lista"'
|
||||
```
|
||||
|
||||
|
||||
## Uproszczenie UI i skalowanie
|
||||
|
||||
Interfejs korzysta z jednokolorowych, konturowych ikon SVG zapisanych lokalnie
|
||||
w `shopping_app/static/icons/tabler/`. Ikony są wykorzystywane także przez
|
||||
JavaScript (`shopping_app/static/js/ui_icons.js`). Nie wymagają CDN.
|
||||
|
||||
W `.env` można ustawić:
|
||||
|
||||
```dotenv
|
||||
UI_SCALE=100
|
||||
```
|
||||
|
||||
Obsługiwane wartości: `100` (domyślnie), `90`, `80`, `70`. Pozostałe wartości
|
||||
są traktowane jako `100`. Zmiana wymaga ponownego uruchomienia procesu Flask
|
||||
(np. odtworzenia kontenera aplikacji). Przy `100` globalne skalowanie nie jest
|
||||
włączane. Niższe wartości pomniejszają również tekst i obszary dotykowe,
|
||||
dlatego na telefonach rekomendowane jest `100`.
|
||||
|
||||
**Opcjonalnie:** aby zastąpić dołączone konturowe SVG oryginalnymi plikami
|
||||
projektu [Tabler Icons](https://github.com/tabler/tabler-icons) (licencja MIT),
|
||||
wykonaj przy dostępie do Internetu:
|
||||
|
||||
```bash
|
||||
python _tools/sync_tabler_icons.py
|
||||
```
|
||||
|
||||
Skrypt pobierze komplet oryginalnych ikon z repozytorium Tabler, odtworzy
|
||||
lokalny `sprite.svg`, bez wprowadzania zależności sieciowej w czasie działania
|
||||
aplikacji. Dołączone SVG mają spójny styl Tabler, ale bez uruchomienia tego
|
||||
skryptu nie należy traktować ich jako zweryfikowanych oryginalnych plików
|
||||
Tabler Icons.
|
||||
|
||||
Aktualizacja istniejącej instalacji: skopiuj zmodyfikowane pliki do katalogu
|
||||
projektu, zachowaj lokalne `.env`, a następnie odtwórz kontener `app` np.:
|
||||
|
||||
```bash
|
||||
docker compose --env-file .env -f docker/compose.yml up -d --force-recreate app
|
||||
```
|
||||
|
||||
Nie używaj trybu `deploy` skryptu `deploy_docker.sh` do wdrażania zmian tylko
|
||||
z rozpakowanego ZIP-a, ponieważ uruchamia on `git pull` i może nadpisać lokalny
|
||||
kod. Skalowanie przetestowano w Chromium; na innych silnikach oraz na
|
||||
fizycznych telefonach należy dodatkowo zweryfikować działanie modali i układ.
|
||||
Opis komend administracyjnych znajduje sie w pliku `CLI_OPIS.txt`.
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Opcjonalnie podmien lokalny zestaw konturowych SVG na oryginalne Tabler Icons.
|
||||
|
||||
Pobranie jest jednorazowe podczas aktualizacji projektu; przegladarka
|
||||
korzysta wylacznie z lokalnych plikow oraz sprite SVG.
|
||||
|
||||
Uzycie: python _tools/sync_tabler_icons.py
|
||||
Zrodlo: https://github.com/tabler/tabler-icons (MIT)
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
from pathlib import Path
|
||||
from urllib.request import Request, urlopen
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
BASE = Path(__file__).resolve().parents[1]
|
||||
ICON_DIR = BASE / 'shopping_app/static/icons/tabler'
|
||||
UPSTREAM = 'https://raw.githubusercontent.com/tabler/tabler-icons/main/icons/outline/'
|
||||
SVG_NS = 'http://www.w3.org/2000/svg'
|
||||
ET.register_namespace('', SVG_NS)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
names = sorted(x.stem for x in ICON_DIR.glob('*.svg') if x.name != 'sprite.svg')
|
||||
if not names:
|
||||
raise SystemExit('Nie znaleziono ikon do synchronizacji.')
|
||||
originals = {}
|
||||
for name in names:
|
||||
url = UPSTREAM + name + '.svg'
|
||||
try:
|
||||
with urlopen(Request(url, headers={'User-Agent': 'shopping-ui-icons/1.0'}), timeout=20) as result:
|
||||
source = result.read()
|
||||
element = ET.fromstring(source)
|
||||
if element.tag != '{%s}svg' % SVG_NS:
|
||||
raise ValueError('brak elementu svg')
|
||||
originals[name] = (source, element)
|
||||
print('OK', name)
|
||||
except Exception as exc:
|
||||
raise SystemExit(f'Nie pobrano {name}: {exc}. Nie zmieniono lokalnych ikon.') from exc
|
||||
|
||||
root = ET.Element('{%s}svg' % SVG_NS, {
|
||||
'class': 'ui-icon-sprite', 'width': '0', 'height': '0',
|
||||
'aria-hidden': 'true', 'focusable': 'false',
|
||||
})
|
||||
defs = ET.SubElement(root, '{%s}defs' % SVG_NS)
|
||||
for name in names:
|
||||
element = originals[name][1]
|
||||
symbol = ET.SubElement(defs, '{%s}symbol' % SVG_NS, {
|
||||
'id': 'ti-' + name, 'viewBox': element.get('viewBox', '0 0 24 24'),
|
||||
})
|
||||
for child in element:
|
||||
symbol.append(copy.deepcopy(child))
|
||||
ET.indent(root, space=' ')
|
||||
sprite_bytes = ET.tostring(root, encoding='utf-8')
|
||||
|
||||
# Najpierw pobierz i zwaliduj caly zestaw; zapis wykonaj dopiero po sukcesie.
|
||||
for name in names:
|
||||
(ICON_DIR / (name + '.svg')).write_bytes(originals[name][0])
|
||||
(ICON_DIR / 'sprite.svg').write_bytes(sprite_bytes)
|
||||
print(f'Zaktualizowano {len(names)} lokalnych SVG i sprite.svg.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,126 +1,85 @@
|
||||
import os
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
basedir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
|
||||
def env_str(name, default=None):
|
||||
value = os.environ.get(name)
|
||||
return default if value is None else value
|
||||
|
||||
|
||||
def env_int(name, default):
|
||||
value = os.environ.get(name)
|
||||
if value is None or value == "":
|
||||
return default
|
||||
try:
|
||||
return int(value)
|
||||
except (TypeError, ValueError):
|
||||
return default
|
||||
|
||||
|
||||
def env_bool(name, default=False):
|
||||
value = os.environ.get(name)
|
||||
if value is None:
|
||||
return default
|
||||
return str(value).strip().lower() in ("1", "true", "yes", "on")
|
||||
|
||||
|
||||
class Config:
|
||||
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_SAMESITE = "Lax"
|
||||
SESSION_COOKIE_SAMESITE = "Lax" # działa w HTTP i HTTPS
|
||||
|
||||
SECRET_KEY = os.environ.get("SECRET_KEY", "D8pceNZ8q%YR7^7F&9wAC2")
|
||||
|
||||
SECRET_KEY = env_str("SECRET_KEY", "D8pceNZ8q%YR7^7F&9wAC2")
|
||||
|
||||
APP_PORT = env_int("APP_PORT", 8000)
|
||||
|
||||
# 100% jest neutralne; inne wartości tylko z białej listy.
|
||||
_ui_scale = env_int("UI_SCALE", 100)
|
||||
UI_SCALE = _ui_scale if _ui_scale in (100, 90, 80, 70) else 100
|
||||
|
||||
DB_ENGINE = env_str("DB_ENGINE", "sqlite").lower()
|
||||
APP_PORT = int(os.environ.get("APP_PORT", "8000") or "8000")
|
||||
|
||||
DB_ENGINE = os.environ.get("DB_ENGINE", "sqlite").lower()
|
||||
if DB_ENGINE == "sqlite":
|
||||
SQLALCHEMY_DATABASE_URI = (
|
||||
f"sqlite:///{os.path.join(basedir, 'db', 'shopping.db')}"
|
||||
)
|
||||
|
||||
elif DB_ENGINE == "pgsql":
|
||||
db_user = quote_plus(env_str("DB_USER", "user"))
|
||||
db_password = quote_plus(env_str("DB_PASSWORD", "pass"))
|
||||
db_host = env_str("DB_HOST", "pgsql")
|
||||
db_port = env_str("DB_PORT", "5432")
|
||||
db_name = quote_plus(env_str("DB_NAME", "myapp"))
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = (
|
||||
f"postgresql://{db_user}:{db_password}@{db_host}:{db_port}/{db_name}"
|
||||
)
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = f"postgresql://{os.environ['DB_USER']}:{os.environ['DB_PASSWORD']}@{os.environ['DB_HOST']}:{os.environ.get('DB_PORT', 5432)}/{os.environ['DB_NAME']}"
|
||||
elif DB_ENGINE == "mysql":
|
||||
db_user = quote_plus(env_str("DB_USER", "user"))
|
||||
db_password = quote_plus(env_str("DB_PASSWORD", "pass"))
|
||||
db_host = env_str("DB_HOST", "mysql")
|
||||
db_port = env_str("DB_PORT", "3306")
|
||||
db_name = quote_plus(env_str("DB_NAME", "myapp"))
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = (
|
||||
f"mysql+pymysql://{db_user}:{db_password}@{db_host}:{db_port}/{db_name}"
|
||||
)
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{os.environ['DB_USER']}:{os.environ['DB_PASSWORD']}@{os.environ['DB_HOST']}:{os.environ.get('DB_PORT', 3306)}/{os.environ['DB_NAME']}"
|
||||
else:
|
||||
raise ValueError("Nieobsługiwany typ bazy danych.")
|
||||
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
SYSTEM_PASSWORD = os.environ.get("SYSTEM_PASSWORD", "admin")
|
||||
DEFAULT_ADMIN_USERNAME = os.environ.get("DEFAULT_ADMIN_USERNAME", "admin")
|
||||
DEFAULT_ADMIN_PASSWORD = os.environ.get("DEFAULT_ADMIN_PASSWORD", "admin123")
|
||||
UPLOAD_FOLDER = os.environ.get("UPLOAD_FOLDER", "uploads")
|
||||
AUTHORIZED_COOKIE_VALUE = os.environ.get("AUTHORIZED_COOKIE_VALUE", "cookievalue")
|
||||
BCRYPT_PEPPER = os.environ.get("BCRYPT_PEPPER", "sekretnyKluczBcrypt")
|
||||
SESSION_COOKIE_SECURE = os.environ.get("SESSION_COOKIE_SECURE", "0") == "1"
|
||||
HEALTHCHECK_TOKEN = os.environ.get("HEALTHCHECK_TOKEN", "alamapsaikota1234")
|
||||
|
||||
SYSTEM_PASSWORD = env_str("SYSTEM_PASSWORD", "admin")
|
||||
DEFAULT_ADMIN_USERNAME = env_str("DEFAULT_ADMIN_USERNAME", "admin")
|
||||
DEFAULT_ADMIN_PASSWORD = env_str("DEFAULT_ADMIN_PASSWORD", "admin123")
|
||||
try:
|
||||
AUTH_COOKIE_MAX_AGE = int(
|
||||
os.environ.get("AUTH_COOKIE_MAX_AGE", "86400") or "86400"
|
||||
)
|
||||
except ValueError:
|
||||
AUTH_COOKIE_MAX_AGE = 86400
|
||||
|
||||
_upload_folder = env_str("UPLOAD_FOLDER", "uploads")
|
||||
try:
|
||||
SESSION_TIMEOUT_MINUTES = int(
|
||||
os.environ.get("SESSION_TIMEOUT_MINUTES", "10080") or "10080"
|
||||
)
|
||||
except ValueError:
|
||||
SESSION_TIMEOUT_MINUTES = 10080
|
||||
|
||||
if os.path.isabs(_upload_folder):
|
||||
UPLOAD_FOLDER = _upload_folder
|
||||
else:
|
||||
UPLOAD_FOLDER = os.path.join(basedir, _upload_folder)
|
||||
|
||||
AUTHORIZED_COOKIE_VALUE = env_str("AUTHORIZED_COOKIE_VALUE", "cookievalue")
|
||||
BCRYPT_PEPPER = env_str("BCRYPT_PEPPER", "sekretnyKluczBcrypt")
|
||||
SESSION_COOKIE_SECURE = env_bool("SESSION_COOKIE_SECURE", False)
|
||||
HEALTHCHECK_TOKEN = env_str("HEALTHCHECK_TOKEN", "alamapsaikota1234")
|
||||
ENABLE_HSTS = os.environ.get("ENABLE_HSTS", "0") == "1"
|
||||
ENABLE_XFO = os.environ.get("ENABLE_XFO", "0") == "1"
|
||||
ENABLE_XCTO = os.environ.get("ENABLE_XCTO", "0") == "1"
|
||||
ENABLE_CSP = os.environ.get("ENABLE_CSP", "0") == "1"
|
||||
ENABLE_PP = os.environ.get("ENABLE_PP", "0") == "1"
|
||||
REFERRER_POLICY = os.environ.get("REFERRER_POLICY") or None
|
||||
|
||||
AUTH_COOKIE_MAX_AGE = env_int("AUTH_COOKIE_MAX_AGE", 86400)
|
||||
SESSION_TIMEOUT_MINUTES = env_int("SESSION_TIMEOUT_MINUTES", 10080)
|
||||
DEBUG_MODE = os.environ.get("DEBUG_MODE", "1") == "1"
|
||||
DISABLE_ROBOTS = os.environ.get("DISABLE_ROBOTS", "0") == "1"
|
||||
|
||||
ENABLE_HSTS = env_bool("ENABLE_HSTS", False)
|
||||
ENABLE_XFO = env_bool("ENABLE_XFO", False)
|
||||
ENABLE_XCTO = env_bool("ENABLE_XCTO", False)
|
||||
ENABLE_CSP = env_bool("ENABLE_CSP", False)
|
||||
ENABLE_PP = env_bool("ENABLE_PP", False)
|
||||
|
||||
REFERRER_POLICY = env_str("REFERRER_POLICY") or None
|
||||
|
||||
DEBUG_MODE = env_bool("DEBUG_MODE", True)
|
||||
DISABLE_ROBOTS = env_bool("DISABLE_ROBOTS", False)
|
||||
|
||||
CURRENCY_CODE = env_str("CURRENCY_CODE", "PLN").strip().upper() or "PLN"
|
||||
|
||||
JS_CACHE_CONTROL = env_str("JS_CACHE_CONTROL", "no-cache")
|
||||
CSS_CACHE_CONTROL = env_str("CSS_CACHE_CONTROL", "no-cache")
|
||||
LIB_JS_CACHE_CONTROL = env_str("LIB_JS_CACHE_CONTROL", "max-age=604800")
|
||||
LIB_CSS_CACHE_CONTROL = env_str("LIB_CSS_CACHE_CONTROL", "max-age=604800")
|
||||
UPLOADS_CACHE_CONTROL = env_str(
|
||||
"UPLOADS_CACHE_CONTROL",
|
||||
"public, max-age=2592000, immutable",
|
||||
JS_CACHE_CONTROL = os.environ.get(
|
||||
"JS_CACHE_CONTROL", "no-cache"
|
||||
)
|
||||
CSS_CACHE_CONTROL = os.environ.get(
|
||||
"CSS_CACHE_CONTROL", "no-cache"
|
||||
)
|
||||
LIB_JS_CACHE_CONTROL = os.environ.get(
|
||||
"LIB_JS_CACHE_CONTROL", "max-age=604800"
|
||||
)
|
||||
LIB_CSS_CACHE_CONTROL = os.environ.get(
|
||||
"LIB_CSS_CACHE_CONTROL", "max-age=604800"
|
||||
)
|
||||
UPLOADS_CACHE_CONTROL = os.environ.get(
|
||||
"UPLOADS_CACHE_CONTROL", "public, max-age=2592000, immutable"
|
||||
)
|
||||
|
||||
DEFAULT_CATEGORIES = [
|
||||
c.strip()
|
||||
for c in env_str(
|
||||
c.strip() for c in os.environ.get(
|
||||
"DEFAULT_CATEGORIES",
|
||||
"Spożywcze,Budowlane,Zabawki,Chemia,Inne,Elektronika,Odzież i obuwie,Jedzenie poza domem,"
|
||||
"Artykuły biurowe,Kosmetyki i higiena,Motoryzacja,Ogród i rośliny,"
|
||||
"Zwierzęta,Sprzęt sportowy,Książki i prasa,Narzędzia i majsterkowanie,"
|
||||
"RTV / AGD,Apteka i suplementy,Artykuły dekoracyjne,Gry i hobby,Usługi,Pieczywo,Różne,Chiny,Dom,Leki,Odzież,Samochód,Dzieci",
|
||||
).split(",")
|
||||
if c.strip()
|
||||
]
|
||||
"RTV / AGD,Apteka i suplementy,Artykuły dekoracyjne,Gry i hobby,Usługi,Pieczywo,Różne,Chiny,Dom,Leki,Odzież,Samochód,Dzieci"
|
||||
).split(",") if c.strip()
|
||||
]
|
||||
@@ -3,57 +3,46 @@ vcl 4.1;
|
||||
import vsthrottle;
|
||||
import std;
|
||||
|
||||
# ===== Backend =====
|
||||
backend app {
|
||||
.host = "app";
|
||||
.port = "${APP_PORT}";
|
||||
}
|
||||
|
||||
# ===== ACL =====
|
||||
acl purge {
|
||||
"127.0.0.1";
|
||||
"::1";
|
||||
}
|
||||
|
||||
# ===== RECV =====
|
||||
sub vcl_recv {
|
||||
# Do not trust client-supplied internal state headers.
|
||||
unset req.http.X-RFC9211-State;
|
||||
unset req.http.X-RFC9211-Entry;
|
||||
unset req.http.X-RFC9211-TTL;
|
||||
|
||||
# RATE LIMIT: 200 żądań / 10s, blokada 60s
|
||||
if (vsthrottle.is_denied(client.identity, 200, 10s, 60s)) {
|
||||
return (synth(429, "Too Many Requests"));
|
||||
}
|
||||
|
||||
# PURGE tylko lokalnie
|
||||
if (req.method == "PURGE") {
|
||||
if (!client.ip ~ purge) {
|
||||
return (synth(405, "Not allowed"));
|
||||
}
|
||||
if (!client.ip ~ purge) { return (synth(405, "Not allowed")); }
|
||||
return (purge);
|
||||
}
|
||||
|
||||
if (!req.http.X-Forwarded-Proto) {
|
||||
set req.http.X-Forwarded-Proto = "https";
|
||||
}
|
||||
# omijamy cache dla healthchecków / wewnętrznych nagłówków
|
||||
if (req.url == "/healthcheck" || req.http.X-Internal-Check) { return (pass); }
|
||||
|
||||
if (req.url ~ "^/healthcheck(\?.*)?$" || req.http.X-Internal-Check) {
|
||||
return (pass);
|
||||
}
|
||||
|
||||
# Only WebSocket upgrades use pipe, never Socket.IO polling.
|
||||
if (req.http.Upgrade ~ "(?i)websocket") {
|
||||
# Specjalna obsługa WebSocket i socket.io
|
||||
if (req.http.Upgrade ~ "(?i)websocket" || req.url ~ "^/socket.io/") {
|
||||
return (pipe);
|
||||
}
|
||||
if (req.url ~ "^/socket\.io/") {
|
||||
return (pass);
|
||||
}
|
||||
|
||||
if (req.method != "GET" && req.method != "HEAD") {
|
||||
return (pass);
|
||||
}
|
||||
if (req.http.Authorization) {
|
||||
return (pass);
|
||||
}
|
||||
# metody inne niż GET/HEAD bez cache
|
||||
if (req.method != "GET" && req.method != "HEAD") { return (pass); }
|
||||
|
||||
# Preserve the original encoding normalization policy.
|
||||
# Żądania z Authorization nie są buforowane
|
||||
if (req.http.Authorization) { return (pass); }
|
||||
|
||||
# ---- Normalizacja Accept-Encoding (kolejność: zstd > br > gzip) ----
|
||||
if (req.http.Accept-Encoding) {
|
||||
if (req.http.Accept-Encoding ~ "zstd") {
|
||||
set req.http.Accept-Encoding = "zstd";
|
||||
@@ -66,85 +55,93 @@ sub vcl_recv {
|
||||
}
|
||||
}
|
||||
|
||||
# Cache public static files independently of session cookies.
|
||||
if (req.url ~ "^/(static|uploads)/" ||
|
||||
req.url ~ "(?i)\.(css|js|png|jpe?g|webp|svg|ico|woff2?)(\?.*)?$") {
|
||||
# ---- (Opcjonalnie) Normalizacja Accept dla obrazów generowanych wariantowo ----
|
||||
# if (req.url ~ "\.(png|jpe?g|gif|bmp)$") {
|
||||
# if (req.http.Accept ~ "image/webp") {
|
||||
# set req.http.X-Accept-Image = "modern"; # webp
|
||||
# } else {
|
||||
# set req.http.X-Accept-Image = "legacy"; # jpg/png
|
||||
# }
|
||||
# }
|
||||
|
||||
# ---- STATYCZNE – agresywny cache + ignorujemy sesję ----
|
||||
if (req.url ~ "^/static/" || req.url ~ "^/uploads/" || req.url ~ "\.(css|js|png|jpe?g|webp|svg|ico|woff2?)$") {
|
||||
unset req.http.Cookie;
|
||||
unset req.http.Authorization;
|
||||
return (hash);
|
||||
}
|
||||
|
||||
if (!req.http.X-Forwarded-Proto) {
|
||||
set req.http.X-Forwarded-Proto = "https";
|
||||
}
|
||||
|
||||
if (req.url == "/healthcheck" || req.http.X-Internal-Check) {
|
||||
set req.http.X-Pass-Reason = "internal";
|
||||
return (pass);
|
||||
}
|
||||
|
||||
if (req.method != "GET" && req.method != "HEAD") {
|
||||
set req.http.X-Pass-Reason = "method";
|
||||
return (pass);
|
||||
}
|
||||
|
||||
if (req.http.Authorization) {
|
||||
set req.http.X-Pass-Reason = "auth";
|
||||
return (pass);
|
||||
}
|
||||
|
||||
# jeśli chcesz PASS przy cookie:
|
||||
# if (req.http.Cookie) {
|
||||
# set req.http.X-Pass-Reason = "cookie";
|
||||
# return (pass);
|
||||
# }
|
||||
|
||||
return (hash);
|
||||
}
|
||||
|
||||
# ===== PIPE (WebSocket passthrough) =====
|
||||
sub vcl_pipe {
|
||||
if (req.http.Upgrade) {
|
||||
set bereq.http.Upgrade = req.http.Upgrade;
|
||||
set bereq.http.Connection = "Upgrade";
|
||||
set bereq.http.Connection = req.http.Connection;
|
||||
}
|
||||
}
|
||||
|
||||
# ===== HASH =====
|
||||
sub vcl_hash {
|
||||
hash_data(req.url);
|
||||
if (req.http.host) {
|
||||
hash_data(req.http.host);
|
||||
} else {
|
||||
hash_data(server.ip);
|
||||
}
|
||||
if (req.http.Cookie) {
|
||||
hash_data(req.http.Cookie);
|
||||
}
|
||||
if (req.http.Accept-Encoding) {
|
||||
hash_data(req.http.Accept-Encoding);
|
||||
}
|
||||
if (req.http.X-Accept-Image) {
|
||||
hash_data(req.http.X-Accept-Image);
|
||||
}
|
||||
}
|
||||
|
||||
# These hooks remember how the CURRENT request was handled.
|
||||
sub vcl_hit {
|
||||
set req.http.X-RFC9211-State = "hit";
|
||||
}
|
||||
|
||||
sub vcl_miss {
|
||||
set req.http.X-RFC9211-State = "miss";
|
||||
}
|
||||
|
||||
sub vcl_pass {
|
||||
if (req.method == "GET" || req.method == "HEAD") {
|
||||
set req.http.X-RFC9211-State = "bypass";
|
||||
} else {
|
||||
set req.http.X-RFC9211-State = "method";
|
||||
}
|
||||
}
|
||||
|
||||
sub vcl_backend_fetch {
|
||||
# Internal markers must never reach the origin application.
|
||||
unset bereq.http.X-RFC9211-State;
|
||||
unset bereq.http.X-RFC9211-Entry;
|
||||
unset bereq.http.X-RFC9211-TTL;
|
||||
if (req.http.host) { hash_data(req.http.host); } else { hash_data(server.ip); }
|
||||
|
||||
# Cookie: zostają dla dynamicznych (dla statyków wyczyszczone wcześniej)
|
||||
if (req.http.Cookie) { hash_data(req.http.Cookie); }
|
||||
|
||||
# Accept-Encoding: już znormalizowany do zstd/br/gzip/identity
|
||||
if (req.http.Accept-Encoding) { hash_data(req.http.Accept-Encoding); }
|
||||
|
||||
# (Opcjonalnie) sygnał obrazów z negocjacją po Accept
|
||||
if (req.http.X-Accept-Image) { hash_data(req.http.X-Accept-Image); }
|
||||
}
|
||||
|
||||
# ===== BACKEND_RESPONSE =====
|
||||
sub vcl_backend_response {
|
||||
# The synthetic marker belongs only to Varnish, not to the origin.
|
||||
unset beresp.http.X-RFC9211-Synthetic;
|
||||
|
||||
if (beresp.http.Cache-Control ~ "(?i)no-store|private|no-cache" ||
|
||||
beresp.http.Surrogate-Control ~ "(?i)no-store" ||
|
||||
beresp.http.Vary == "*") {
|
||||
# Zakaz cache – respektujemy
|
||||
if (beresp.http.Cache-Control ~ "(?i)no-store|private") {
|
||||
set beresp.uncacheable = true;
|
||||
set beresp.ttl = 0s;
|
||||
set beresp.http.X-Pass-Reason = "no-store";
|
||||
return (deliver);
|
||||
}
|
||||
|
||||
# NIE cache'uj redirectów do loginu (HTML) z backendu
|
||||
if (beresp.status >= 300 && beresp.status < 400) {
|
||||
set beresp.uncacheable = true;
|
||||
set beresp.ttl = 0s;
|
||||
set beresp.http.X-Pass-Reason = "redirect";
|
||||
return (deliver);
|
||||
}
|
||||
|
||||
if (bereq.url ~ "^/(static|uploads)/" ||
|
||||
bereq.url ~ "(?i)\.(css|js|png|jpe?g|webp|svg|ico|woff2?)(\?.*)?$") {
|
||||
# Nie cache'uj statyków, jeśli status ≠ 200
|
||||
if (bereq.url ~ "^/static/" || bereq.url ~ "^/uploads/" || bereq.url ~ "\.(css|js|png|jpe?g|webp|svg|ico|woff2?)($|\?)") {
|
||||
if (beresp.status != 200) {
|
||||
set beresp.uncacheable = true;
|
||||
set beresp.ttl = 0s;
|
||||
@@ -152,138 +149,115 @@ sub vcl_backend_response {
|
||||
}
|
||||
}
|
||||
|
||||
# An HTML login page returned as a JS/CSS asset must not be cached.
|
||||
if (bereq.url ~ "(?i)\.(js|css)(\?.*)?$" &&
|
||||
beresp.http.Content-Type ~ "(?i)text/html") {
|
||||
# Jeśli pod .js przychodzi text/html — też nie cache'uj (to zwykle redirect/login)
|
||||
if (bereq.url ~ "\.js(\?.*)?$" && beresp.http.Content-Type ~ "(?i)text/html") {
|
||||
set beresp.uncacheable = true;
|
||||
set beresp.ttl = 0s;
|
||||
return (deliver);
|
||||
}
|
||||
|
||||
if (bereq.url ~ "(?i)\.js(\?.*)?$" && !beresp.http.Content-Type) {
|
||||
set beresp.http.Content-Type = "application/javascript; charset=utf-8";
|
||||
# Wymuś poprawny Content-Type dla .js/.css, gdy backend zwróci HTML
|
||||
if (bereq.url ~ "\.js(\?.*)?$") {
|
||||
if (!beresp.http.Content-Type || beresp.http.Content-Type ~ "(?i)text/html") {
|
||||
set beresp.http.Content-Type = "application/javascript; charset=utf-8";
|
||||
}
|
||||
}
|
||||
if (bereq.url ~ "(?i)\.css(\?.*)?$" && !beresp.http.Content-Type) {
|
||||
set beresp.http.Content-Type = "text/css; charset=utf-8";
|
||||
if (bereq.url ~ "\.css(\?.*)?$") {
|
||||
if (!beresp.http.Content-Type || beresp.http.Content-Type ~ "(?i)text/html") {
|
||||
set beresp.http.Content-Type = "text/css; charset=utf-8";
|
||||
}
|
||||
}
|
||||
|
||||
if (bereq.url ~ "^/(static|uploads)/" ||
|
||||
bereq.url ~ "(?i)\.(css|js|png|jpe?g|webp|svg|ico|woff2?)(\?.*)?$") {
|
||||
# ---- STATYCZNE: zdejmij Set-Cookie i Vary: Cookie, zapewnij TTL ----
|
||||
if (bereq.url ~ "^/static/" || bereq.url ~ "^/uploads/" || bereq.url ~ "\.(css|js|png|jpe?g|webp|svg|ico|woff2?)$") {
|
||||
unset beresp.http.Set-Cookie;
|
||||
|
||||
# Jeśli backend dodał Vary: Cookie, usuńmy ten element (nie wpływa na statyki)
|
||||
if (beresp.http.Vary) {
|
||||
set beresp.http.Vary = regsuball(beresp.http.Vary, "(?i)(^|,)[[:space:]]*Cookie[[:space:]]*(,|$)", "\1");
|
||||
set beresp.http.Vary = regsuball(beresp.http.Vary, ",[[:space:]]*,", ",");
|
||||
set beresp.http.Vary = regsub(beresp.http.Vary, "^[[:space:]]*,[[:space:]]*", "");
|
||||
set beresp.http.Vary = regsub(beresp.http.Vary, "[[:space:]]*,[[:space:]]*$", "");
|
||||
if (beresp.http.Vary ~ "^[[:space:]]*$") {
|
||||
unset beresp.http.Vary;
|
||||
}
|
||||
if (beresp.http.Vary ~ "^[[:space:]]*$") { unset beresp.http.Vary; }
|
||||
}
|
||||
|
||||
# Jeśli brak kontroli czasu życia – ustawiamy twarde wartości
|
||||
if (!(beresp.http.Cache-Control ~ "(?i)(s-maxage|max-age)")) {
|
||||
set beresp.ttl = 24h;
|
||||
set beresp.http.Cache-Control = "public, max-age=86400, immutable";
|
||||
}
|
||||
|
||||
set beresp.grace = 1h;
|
||||
set beresp.keep = 24h;
|
||||
set beresp.keep = 24h;
|
||||
}
|
||||
|
||||
# ---- Ogólne TTL z nagłówków ----
|
||||
if (beresp.http.Cache-Control ~ "(?i)s-maxage=([0-9]+)") {
|
||||
set beresp.ttl = std.duration(regsub(beresp.http.Cache-Control, "(?i).*s-maxage=([0-9]+).*", "\1") + "s", 0s);
|
||||
} else if (beresp.http.Cache-Control ~ "(?i)max-age=([0-9]+)") {
|
||||
set beresp.ttl = std.duration(regsub(beresp.http.Cache-Control, "(?i).*max-age=([0-9]+).*", "\1") + "s", 0s);
|
||||
} else if (beresp.http.Expires) {
|
||||
set beresp.ttl = std.time(beresp.http.Expires, now) - now;
|
||||
if (beresp.ttl < 0s) {
|
||||
set beresp.ttl = 0s;
|
||||
}
|
||||
} else if (beresp.ttl <= 0s) {
|
||||
set beresp.ttl = 60s;
|
||||
if (beresp.ttl < 0s) { set beresp.ttl = 0s; }
|
||||
} else {
|
||||
if (beresp.ttl <= 0s) { set beresp.ttl = 60s; }
|
||||
}
|
||||
|
||||
# Immutable => dłuższe grace/keep
|
||||
if (beresp.http.Cache-Control ~ "(?i)immutable") {
|
||||
set beresp.grace = 1h;
|
||||
set beresp.keep = 24h;
|
||||
set beresp.keep = 24h;
|
||||
}
|
||||
|
||||
# Kompresja po stronie Varnisha wyłącznie dla klientów akceptujących gzip
|
||||
# i tylko jeśli backend nie dostarczył już Content-Encoding.
|
||||
if (!beresp.http.Content-Encoding && bereq.http.Accept-Encoding ~ "gzip") {
|
||||
# Kompresujemy tylko „tekstowe” typy; wykluczamy WASM
|
||||
if (beresp.http.Content-Type ~ "(?i)text/|application/(javascript|json|xml)") {
|
||||
set beresp.do_gzip = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (beresp.http.Content-Length &&
|
||||
std.integer(beresp.http.Content-Length, 0) > 1048576) {
|
||||
# Duże odpowiedzi streamujemy
|
||||
if (beresp.http.Content-Length && std.integer(beresp.http.Content-Length, 0) > 1048576) {
|
||||
set beresp.do_stream = true;
|
||||
}
|
||||
}
|
||||
|
||||
# (Opcjonalnie) Serwuj „stale” przy błędach backendu, jeśli jest obiekt w grace
|
||||
sub vcl_backend_error {
|
||||
# Do not claim a synthetic backend-fetch error was served by a cache.
|
||||
set beresp.uncacheable = true;
|
||||
set beresp.ttl = 0s;
|
||||
set beresp.http.X-RFC9211-Synthetic = "1";
|
||||
return (deliver);
|
||||
}
|
||||
|
||||
# ===== DELIVER =====
|
||||
sub vcl_deliver {
|
||||
if (resp.http.X-RFC9211-Synthetic) {
|
||||
unset resp.http.Cache-Status;
|
||||
if (obj.uncacheable) {
|
||||
if (req.http.X-Pass-Reason) {
|
||||
set resp.http.X-Cache = "PASS:" + req.http.X-Pass-Reason;
|
||||
} else if (resp.http.X-Pass-Reason) { # z backendu
|
||||
set resp.http.X-Cache = "PASS:" + resp.http.X-Pass-Reason;
|
||||
} else {
|
||||
set resp.http.X-Cache = "PASS";
|
||||
}
|
||||
unset resp.http.X-Pass-Reason;
|
||||
unset resp.http.Age;
|
||||
} else if (obj.hits > 0) {
|
||||
set resp.http.X-Cache = "HIT";
|
||||
} else {
|
||||
if (req.http.X-RFC9211-State == "hit") {
|
||||
# DURATION -> STRING works with VCL 4.1 / Varnish 6.0+.
|
||||
# Structured Fields require an integer, not a decimal string.
|
||||
set req.http.X-RFC9211-TTL = obj.ttl;
|
||||
if (obj.ttl < 0s && obj.ttl > -1s) {
|
||||
set req.http.X-RFC9211-TTL = "-1";
|
||||
} else {
|
||||
set req.http.X-RFC9211-TTL = regsub(req.http.X-RFC9211-TTL, "\.[0-9]+$", "");
|
||||
}
|
||||
set req.http.X-RFC9211-Entry = "varnish; hit; ttl=" + req.http.X-RFC9211-TTL;
|
||||
} else if (req.http.X-RFC9211-State == "miss") {
|
||||
set req.http.X-RFC9211-Entry = "varnish; fwd=miss";
|
||||
if (obj.uncacheable) {
|
||||
set req.http.X-RFC9211-Entry = req.http.X-RFC9211-Entry + "; stored=?0";
|
||||
} else {
|
||||
set req.http.X-RFC9211-Entry = req.http.X-RFC9211-Entry + "; stored";
|
||||
}
|
||||
} else if (req.http.X-RFC9211-State == "method") {
|
||||
set req.http.X-RFC9211-Entry = "varnish; fwd=method";
|
||||
} else {
|
||||
set req.http.X-RFC9211-Entry = "varnish; fwd=bypass";
|
||||
}
|
||||
|
||||
# RFC 9211: preserve the cache chain and append our own member LAST.
|
||||
if (resp.http.Cache-Status) {
|
||||
set resp.http.Cache-Status = resp.http.Cache-Status + ", " + req.http.X-RFC9211-Entry;
|
||||
} else {
|
||||
set resp.http.Cache-Status = req.http.X-RFC9211-Entry;
|
||||
}
|
||||
set resp.http.X-Cache = "MISS";
|
||||
unset resp.http.Age;
|
||||
}
|
||||
|
||||
unset resp.http.X-RFC9211-Synthetic;
|
||||
unset resp.http.X-Cache;
|
||||
unset resp.http.X-Pass-Reason;
|
||||
unset resp.http.Via;
|
||||
unset resp.http.X-Varnish;
|
||||
unset resp.http.Server;
|
||||
unset resp.http.Content-Disposition;
|
||||
# Keep Age: it is useful cache metadata and can reflect upstream age.
|
||||
}
|
||||
|
||||
sub vcl_synth {
|
||||
set resp.http.Cache-Control = "private, no-store, no-cache";
|
||||
unset resp.http.Cache-Status;
|
||||
unset resp.http.X-Cache;
|
||||
unset resp.http.X-Pass-Reason;
|
||||
unset resp.http.Via;
|
||||
unset resp.http.X-Varnish;
|
||||
unset resp.http.Server;
|
||||
unset resp.http.Content-Disposition;
|
||||
set resp.http.X-Cache = "SYNTH";
|
||||
}
|
||||
|
||||
# ===== PURGE HANDLER =====
|
||||
sub vcl_purge {
|
||||
return (synth(200, "Purged"));
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
COMPOSE_FILE="docker/compose.yml"
|
||||
set -e
|
||||
|
||||
if [[ -f .env ]]; then
|
||||
set -a
|
||||
@@ -10,63 +8,23 @@ if [[ -f .env ]]; then
|
||||
fi
|
||||
|
||||
APP_PORT="${APP_PORT:-8080}"
|
||||
DEFAULT_ENGINE="${DB_ENGINE:-sqlite}"
|
||||
PROFILE=$1
|
||||
COMPOSE_FILE="docker/compose.yml"
|
||||
|
||||
print_usage() {
|
||||
echo "Użycie:"
|
||||
echo " $0 [sqlite|pgsql|mysql] [deploy|restart]"
|
||||
echo
|
||||
echo "Przykłady:"
|
||||
echo " $0 pgsql deploy"
|
||||
echo " $0 mysql restart"
|
||||
echo " $0 sqlite"
|
||||
echo
|
||||
echo "Domyślnie:"
|
||||
echo " silnik: z DB_ENGINE z .env albo sqlite"
|
||||
echo " akcja: deploy"
|
||||
}
|
||||
|
||||
validate_engine() {
|
||||
local engine="$1"
|
||||
case "$engine" in
|
||||
sqlite|pgsql|mysql)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
echo "Błąd: nieobsługiwany silnik bazy: '$engine'"
|
||||
echo "Dozwolone wartości: sqlite, pgsql, mysql"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
validate_action() {
|
||||
local action="$1"
|
||||
case "$action" in
|
||||
deploy|restart)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
echo "Błąd: nieobsługiwana akcja: '$action'"
|
||||
echo "Dozwolone wartości: deploy, restart"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
PROFILE="${1:-$DEFAULT_ENGINE}"
|
||||
ACTION="${2:-deploy}"
|
||||
|
||||
validate_engine "$PROFILE"
|
||||
validate_action "$ACTION"
|
||||
|
||||
if [[ -n "${DB_ENGINE:-}" && "$DB_ENGINE" != "$PROFILE" ]]; then
|
||||
echo "Uwaga: DB_ENGINE w .env ma wartość '$DB_ENGINE', a uruchamiasz profil '$PROFILE'."
|
||||
echo "Kontynuuję z profilem z argumentu: '$PROFILE'"
|
||||
if [[ -z "$PROFILE" ]]; then
|
||||
echo "Użycie: $0 {pgsql|mysql|sqlite}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Wybrany silnik bazy: $PROFILE"
|
||||
echo "Wybrana akcja: $ACTION"
|
||||
echo "Zatrzymuję kontenery aplikacji i bazy..."
|
||||
if [[ "$PROFILE" == "sqlite" ]]; then
|
||||
docker compose -f "$COMPOSE_FILE" stop
|
||||
else
|
||||
docker compose -f "$COMPOSE_FILE" --profile "$PROFILE" stop
|
||||
fi
|
||||
|
||||
echo "Pobieram najnowszy kod z repozytorium..."
|
||||
git pull
|
||||
|
||||
echo "Generowanie default.vcl z APP_PORT=$APP_PORT"
|
||||
envsubst < deploy/varnish/default.vcl.template > deploy/varnish/default.vcl
|
||||
@@ -74,34 +32,11 @@ envsubst < deploy/varnish/default.vcl.template > deploy/varnish/default.vcl
|
||||
echo "Zapisuję hash commita do version.txt..."
|
||||
git rev-parse --short HEAD > version.txt
|
||||
|
||||
if [[ "$ACTION" == "restart" ]]; then
|
||||
echo "Odtwarzam kontenery bez przebudowy obrazu..."
|
||||
|
||||
if [[ "$PROFILE" == "sqlite" ]]; then
|
||||
docker compose -f "$COMPOSE_FILE" --env-file .env up -d --force-recreate
|
||||
else
|
||||
DB_ENGINE="$PROFILE" docker compose --env-file .env -f "$COMPOSE_FILE" --profile "$PROFILE" up -d --force-recreate
|
||||
fi
|
||||
|
||||
echo "Gotowe! Wersja aplikacji: $(cat version.txt)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Zatrzymuję kontenery aplikacji i bazy..."
|
||||
echo "Buduję i uruchamiam kontenery..."
|
||||
if [[ "$PROFILE" == "sqlite" ]]; then
|
||||
docker compose -f "$COMPOSE_FILE" stop
|
||||
docker compose -f "$COMPOSE_FILE" up -d --build
|
||||
else
|
||||
DB_ENGINE="$PROFILE" docker compose --env-file .env -f "$COMPOSE_FILE" --profile "$PROFILE" stop
|
||||
DB_ENGINE="$PROFILE" docker compose -f "$COMPOSE_FILE" --profile "$PROFILE" up -d --build
|
||||
fi
|
||||
|
||||
echo "Pobieram najnowszy kod z repozytorium..."
|
||||
git pull
|
||||
|
||||
echo "Uruchamiam kontenery z przebudową obrazu..."
|
||||
if [[ "$PROFILE" == "sqlite" ]]; then
|
||||
docker compose --env-file .env -f "$COMPOSE_FILE" up -d --build
|
||||
else
|
||||
DB_ENGINE="$PROFILE" docker compose --env-file .env -f "$COMPOSE_FILE" --profile "$PROFILE" up -d --build
|
||||
fi
|
||||
|
||||
echo "Gotowe! Wersja aplikacji: $(cat version.txt)"
|
||||
echo "Gotowe! Wersja aplikacji: $(cat version.txt)"
|
||||
@@ -4,111 +4,76 @@ services:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.debian-stable-slim
|
||||
container_name: lista-zakupow-app
|
||||
|
||||
env_file:
|
||||
- ../.env
|
||||
|
||||
expose:
|
||||
- "${APP_PORT:-8000}"
|
||||
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -c
|
||||
- >-
|
||||
import os, sys, urllib.request;
|
||||
port = os.environ["APP_PORT"];
|
||||
token = os.environ["HEALTHCHECK_TOKEN"];
|
||||
req = urllib.request.Request(
|
||||
"http://127.0.0.1:" + port + "/healthcheck",
|
||||
headers={"X-Internal-Check": token});
|
||||
response = urllib.request.urlopen(req, timeout=5);
|
||||
sys.exit(0 if response.status == 200 else 1)
|
||||
[
|
||||
"CMD",
|
||||
"python",
|
||||
"-c",
|
||||
"import urllib.request; import sys; req = urllib.request.Request('http://localhost:${APP_PORT:-8000}/healthcheck', headers={'X-Internal-Check': '${HEALTHCHECK_TOKEN}'}); sys.exit(0) if urllib.request.urlopen(req).getcode() == 200 else sys.exit(1)",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
|
||||
start_period: 10s
|
||||
env_file:
|
||||
- ../.env
|
||||
volumes:
|
||||
- ../:/app
|
||||
- ../uploads:/app/uploads
|
||||
- ../instance:/app/instance
|
||||
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
varnish:
|
||||
image: varnish:9.0
|
||||
image: varnish:latest
|
||||
container_name: lista-zakupow-varnish
|
||||
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
|
||||
ports:
|
||||
- "${APP_PORT:-8000}:80"
|
||||
|
||||
volumes:
|
||||
- ../deploy/varnish/default.vcl:/etc/varnish/default.vcl:ro
|
||||
|
||||
environment:
|
||||
VARNISH_SIZE: 256m
|
||||
|
||||
- VARNISH_SIZE=256m
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
mysql:
|
||||
image: mysql:8
|
||||
container_name: lista-zakupow-mysql-db
|
||||
|
||||
env_file:
|
||||
- ../.env
|
||||
|
||||
environment:
|
||||
MYSQL_DATABASE: "${DB_NAME}"
|
||||
MYSQL_USER: "${DB_USER}"
|
||||
MYSQL_PASSWORD: "${DB_PASSWORD}"
|
||||
#MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
|
||||
MYSQL_ROOT_PASSWORD: "5lWuo5sMFXOZmSvx8jbmHj19"
|
||||
|
||||
MYSQL_DATABASE: ${DB_NAME}
|
||||
MYSQL_USER: ${DB_USER}
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||
MYSQL_ROOT_PASSWORD: 89o38kUX5T4C
|
||||
volumes:
|
||||
- ../db/mysql:/var/lib/mysql
|
||||
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
|
||||
restart: unless-stopped
|
||||
profiles:
|
||||
- mysql
|
||||
profiles: ["mysql"]
|
||||
|
||||
pgsql:
|
||||
image: postgres:18
|
||||
container_name: lista-zakupow-pgsql
|
||||
|
||||
env_file:
|
||||
- ../.env
|
||||
|
||||
environment:
|
||||
POSTGRES_DB: "${DB_NAME}"
|
||||
POSTGRES_USER: "${DB_USER}"
|
||||
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
||||
PGDATA: /var/lib/postgresql/data
|
||||
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
POSTGRES_USER: ${DB_USER}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
PGDATA: /var/lib/postgresql
|
||||
volumes:
|
||||
- ../db/pgsql:/var/lib/postgresql/data
|
||||
|
||||
- ../db/pgsql:/var/lib/postgresql
|
||||
networks:
|
||||
- lista-zakupow_network
|
||||
|
||||
restart: unless-stopped
|
||||
profiles:
|
||||
- pgsql
|
||||
profiles: ["pgsql"]
|
||||
|
||||
networks:
|
||||
lista-zakupow_network:
|
||||
driver: bridge
|
||||
driver: bridge
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import zipfile
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def run_git_command(args, repo_path: Path) -> bytes:
|
||||
result = subprocess.run(
|
||||
["git", *args],
|
||||
cwd=repo_path,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
check=True,
|
||||
)
|
||||
return result.stdout
|
||||
|
||||
|
||||
def get_files_to_archive(repo_path: Path) -> list[str]:
|
||||
output = run_git_command(
|
||||
["ls-files", "--cached", "--others", "--exclude-standard", "-z"],
|
||||
repo_path,
|
||||
)
|
||||
files = output.decode("utf-8", errors="surrogateescape").split("\0")
|
||||
return [f for f in files if f]
|
||||
|
||||
|
||||
def make_zip(repo_path: Path, output_zip: Path) -> None:
|
||||
files = get_files_to_archive(repo_path)
|
||||
|
||||
output_zip = output_zip.resolve()
|
||||
if output_zip.exists():
|
||||
output_zip.unlink()
|
||||
|
||||
with zipfile.ZipFile(output_zip, "w", compression=zipfile.ZIP_DEFLATED) as zf:
|
||||
for rel_path in files:
|
||||
abs_path = repo_path / rel_path
|
||||
|
||||
if not abs_path.exists():
|
||||
continue
|
||||
|
||||
if abs_path.resolve() == output_zip:
|
||||
continue
|
||||
|
||||
zf.write(abs_path, arcname=rel_path)
|
||||
|
||||
print(f"Utworzono archiwum: {output_zip}")
|
||||
print(f"Added files: {len(files)}")
|
||||
|
||||
|
||||
def main():
|
||||
repo_path = Path.cwd()
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
output_zip = Path(sys.argv[1])
|
||||
else:
|
||||
output_zip = repo_path / f"{repo_path.name}.zip"
|
||||
|
||||
try:
|
||||
run_git_command(["rev-parse", "--show-toplevel"], repo_path)
|
||||
except subprocess.CalledProcessError:
|
||||
print("Error: this directory is not a Git repository.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
make_zip(repo_path, output_zip)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -2,25 +2,6 @@ from .deps import *
|
||||
from .app_setup import *
|
||||
from .models import *
|
||||
|
||||
|
||||
def get_currency_code() -> str:
|
||||
code = str(app.config.get("CURRENCY_CODE", "PLN") or "PLN").strip().upper()
|
||||
return code or "PLN"
|
||||
|
||||
|
||||
def format_currency(amount, include_code: bool = True) -> str:
|
||||
try:
|
||||
normalized = float(amount or 0)
|
||||
except (TypeError, ValueError):
|
||||
normalized = 0.0
|
||||
formatted = f"{normalized:.2f}"
|
||||
return f"{formatted} {get_currency_code()}" if include_code else formatted
|
||||
|
||||
|
||||
def currency_placeholder(prefix: str = "Kwota") -> str:
|
||||
return f"{prefix} ({get_currency_code()})"
|
||||
|
||||
|
||||
def get_setting(key: str, default: str | None = None) -> str | None:
|
||||
s = db.session.get(AppSetting, key)
|
||||
return s.value if s else default
|
||||
@@ -249,8 +230,6 @@ def duplicate_list_for_schedule(source_list: ShoppingList, scheduled_for: dateti
|
||||
list_id=new_list.id,
|
||||
name=item.name,
|
||||
quantity=item.quantity or 1,
|
||||
quantity_value=getattr(item, "quantity_value", None) or item.quantity or 1,
|
||||
quantity_unit=normalize_quantity_unit(getattr(item, "quantity_unit", None)),
|
||||
note=item.note,
|
||||
position=item.position or 0,
|
||||
added_at=scheduled_for,
|
||||
@@ -264,120 +243,6 @@ def duplicate_list_for_schedule(source_list: ShoppingList, scheduled_for: dateti
|
||||
db.session.commit()
|
||||
return new_list
|
||||
|
||||
|
||||
|
||||
def shift_datetime_preserving_timezone(value: datetime | None, delta: timedelta) -> datetime | None:
|
||||
if not value:
|
||||
return None
|
||||
if value.tzinfo is None:
|
||||
value = value.replace(tzinfo=timezone.utc)
|
||||
return value + delta
|
||||
|
||||
|
||||
def move_list_schedule(shopping_list: ShoppingList, new_when: datetime, keep_item_times: bool = False, keep_expiry: bool = False):
|
||||
if shopping_list is None:
|
||||
raise ValueError('Lista nie istnieje.')
|
||||
if new_when.tzinfo is None:
|
||||
new_when = new_when.replace(tzinfo=timezone.utc)
|
||||
|
||||
original_created = shopping_list.created_at or new_when
|
||||
if original_created.tzinfo is None:
|
||||
original_created = original_created.replace(tzinfo=timezone.utc)
|
||||
|
||||
delta = new_when - original_created
|
||||
shopping_list.created_at = new_when
|
||||
|
||||
if not keep_expiry and shopping_list.expires_at:
|
||||
shopping_list.expires_at = shift_datetime_preserving_timezone(shopping_list.expires_at, delta)
|
||||
|
||||
if not keep_item_times:
|
||||
for item in shopping_list.items:
|
||||
if item.added_at:
|
||||
item.added_at = shift_datetime_preserving_timezone(item.added_at, delta)
|
||||
if item.purchased_at:
|
||||
item.purchased_at = shift_datetime_preserving_timezone(item.purchased_at, delta)
|
||||
|
||||
return shopping_list, delta
|
||||
|
||||
|
||||
def rename_list(shopping_list: ShoppingList, new_title: str):
|
||||
normalized = (new_title or '').strip()
|
||||
if not normalized:
|
||||
raise ValueError('Podaj nowy tytul listy.')
|
||||
shopping_list.title = normalized
|
||||
return shopping_list
|
||||
|
||||
|
||||
def set_list_archived(shopping_list: ShoppingList, archived: bool = True):
|
||||
if shopping_list is None:
|
||||
raise ValueError('Lista nie istnieje.')
|
||||
shopping_list.is_archived = bool(archived)
|
||||
return shopping_list
|
||||
|
||||
|
||||
def assign_list_owner(shopping_list: ShoppingList, owner: User):
|
||||
if shopping_list is None:
|
||||
raise ValueError('Lista nie istnieje.')
|
||||
if owner is None:
|
||||
raise ValueError('Nie znaleziono docelowego wlasciciela.')
|
||||
shopping_list.owner_id = owner.id
|
||||
return shopping_list
|
||||
|
||||
|
||||
def delete_list_with_relations(shopping_list: ShoppingList):
|
||||
if shopping_list is None:
|
||||
raise ValueError('Lista nie istnieje.')
|
||||
shopping_list.categories.clear()
|
||||
ListPermission.query.filter_by(list_id=shopping_list.id).delete(synchronize_session=False)
|
||||
ListActivityLog.query.filter_by(list_id=shopping_list.id).delete(synchronize_session=False)
|
||||
Expense.query.filter_by(list_id=shopping_list.id).delete(synchronize_session=False)
|
||||
Receipt.query.filter_by(list_id=shopping_list.id).delete(synchronize_session=False)
|
||||
Item.query.filter_by(list_id=shopping_list.id).delete(synchronize_session=False)
|
||||
db.session.delete(shopping_list)
|
||||
|
||||
|
||||
def duplicate_list_many(source_list: ShoppingList, schedule_values: list[datetime], owner: User | None = None, title_prefix: str | None = None):
|
||||
created_lists = []
|
||||
base_prefix = (title_prefix or '').strip()
|
||||
for idx, scheduled_for in enumerate(schedule_values, start=1):
|
||||
title = None
|
||||
if base_prefix:
|
||||
title = f'{base_prefix} #{idx}'
|
||||
created_lists.append(duplicate_list_for_schedule(source_list, scheduled_for=scheduled_for, owner=owner, title=title))
|
||||
return created_lists
|
||||
|
||||
|
||||
def create_list_from_template_at_schedule(template: ListTemplate, owner: User, scheduled_for: datetime, title: str | None = None):
|
||||
if scheduled_for.tzinfo is None:
|
||||
scheduled_for = scheduled_for.replace(tzinfo=timezone.utc)
|
||||
|
||||
new_list = ShoppingList(
|
||||
title=(title or template.name).strip(),
|
||||
owner_id=owner.id,
|
||||
share_token=generate_share_token(8),
|
||||
is_temporary=False,
|
||||
expires_at=None,
|
||||
created_at=scheduled_for,
|
||||
)
|
||||
db.session.add(new_list)
|
||||
db.session.flush()
|
||||
|
||||
for idx, item in enumerate(template.items, start=1):
|
||||
db.session.add(Item(
|
||||
list_id=new_list.id,
|
||||
name=item.name,
|
||||
quantity=item.quantity or 1,
|
||||
quantity_value=getattr(item, "quantity_value", None) or item.quantity or 1,
|
||||
quantity_unit=normalize_quantity_unit(getattr(item, "quantity_unit", None)),
|
||||
note=item.note,
|
||||
position=item.position or idx,
|
||||
added_by=owner.id,
|
||||
added_at=scheduled_for,
|
||||
))
|
||||
|
||||
db.session.commit()
|
||||
return new_list
|
||||
|
||||
def hash_api_token(token: str) -> str:
|
||||
return hashlib.sha256((token or '').encode('utf-8')).hexdigest()
|
||||
|
||||
@@ -522,11 +387,6 @@ def action_label(action: str) -> str:
|
||||
'item_unmarked_not_purchased': 'przywrócił produkt',
|
||||
'expense_added': 'dodał wydatek',
|
||||
'list_duplicated': 'zduplikował listę',
|
||||
'list_moved': 'przeniósł listę',
|
||||
'list_archived': 'zarchiwizował listę',
|
||||
'list_unarchived': 'przywrócił listę z archiwum',
|
||||
'list_owner_changed': 'zmienił właściciela listy',
|
||||
'list_renamed': 'zmienił nazwę listy',
|
||||
'template_created': 'utworzył szablon',
|
||||
}.get(action, action)
|
||||
|
||||
@@ -578,8 +438,6 @@ def create_template_from_list(source_list: ShoppingList, created_by: int | None
|
||||
template_id=template.id,
|
||||
name=item.name,
|
||||
quantity=item.quantity or 1,
|
||||
quantity_value=getattr(item, "quantity_value", None) or item.quantity or 1,
|
||||
quantity_unit=normalize_quantity_unit(getattr(item, "quantity_unit", None)),
|
||||
note=item.note,
|
||||
position=idx + 1,
|
||||
))
|
||||
@@ -612,8 +470,6 @@ def create_list_from_template(template: ListTemplate, owner: User, title: str |
|
||||
list_id=new_list.id,
|
||||
name=item.name,
|
||||
quantity=item.quantity or 1,
|
||||
quantity_value=getattr(item, "quantity_value", None) or item.quantity or 1,
|
||||
quantity_unit=normalize_quantity_unit(getattr(item, "quantity_unit", None)),
|
||||
note=item.note,
|
||||
position=idx + 1,
|
||||
added_by=owner.id,
|
||||
@@ -649,87 +505,6 @@ def parse_api_date_range(start_date_str: str | None, end_date_str: str | None):
|
||||
return start_date, end_date
|
||||
|
||||
|
||||
|
||||
|
||||
def normalize_quantity_unit(unit):
|
||||
unit = (unit or "szt").strip().lower()
|
||||
aliases = {
|
||||
"szt.": "szt", "sztuki": "szt", "sztuka": "szt", "pcs": "szt",
|
||||
"kilogram": "kg", "kilogramy": "kg",
|
||||
"gram": "g", "gramy": "g",
|
||||
"litr": "l", "litry": "l",
|
||||
"mililitr": "ml", "mililitry": "ml",
|
||||
"opak": "opak.", "op": "opak.", "opakowanie": "opak.", "opakowania": "opak.",
|
||||
}
|
||||
unit = aliases.get(unit, unit)
|
||||
allowed = {"szt", "kg", "g", "l", "ml", "opak."}
|
||||
return unit if unit in allowed else "szt"
|
||||
|
||||
|
||||
def parse_quantity_value(value, fallback=1):
|
||||
try:
|
||||
raw = str(value if value is not None else fallback).strip().replace(",", ".")
|
||||
parsed = float(raw)
|
||||
if parsed <= 0:
|
||||
parsed = float(fallback or 1)
|
||||
except Exception:
|
||||
parsed = float(fallback or 1)
|
||||
return max(parsed, 0.001)
|
||||
|
||||
|
||||
def legacy_quantity_int(value):
|
||||
try:
|
||||
parsed = int(round(float(value)))
|
||||
except Exception:
|
||||
parsed = 1
|
||||
return max(parsed, 1)
|
||||
|
||||
|
||||
def quantity_display_value(item):
|
||||
value = getattr(item, "quantity_value", None)
|
||||
if value is None:
|
||||
value = getattr(item, "quantity", 1) or 1
|
||||
try:
|
||||
value = float(value)
|
||||
except Exception:
|
||||
value = 1.0
|
||||
if value.is_integer():
|
||||
return str(int(value))
|
||||
return (f"{value:.3f}".rstrip("0").rstrip(".")).replace(".", ",")
|
||||
|
||||
|
||||
def quantity_label(item):
|
||||
unit = normalize_quantity_unit(getattr(item, "quantity_unit", None))
|
||||
value = quantity_display_value(item)
|
||||
if unit == "szt":
|
||||
return f"x{value}"
|
||||
return f"{value} {unit}"
|
||||
|
||||
|
||||
def ensure_lightweight_schema_migrations():
|
||||
inspector = inspect(db.engine)
|
||||
table_names = set(inspector.get_table_names())
|
||||
targets = []
|
||||
for table_name in ("item", "list_template_item"):
|
||||
if table_name not in table_names:
|
||||
continue
|
||||
existing = {c["name"] for c in inspector.get_columns(table_name)}
|
||||
if "quantity_value" not in existing:
|
||||
targets.append((table_name, f"ALTER TABLE {table_name} ADD COLUMN quantity_value FLOAT"))
|
||||
if "quantity_unit" not in existing:
|
||||
targets.append((table_name, f"ALTER TABLE {table_name} ADD COLUMN quantity_unit VARCHAR(20) DEFAULT 'szt'"))
|
||||
if not targets:
|
||||
return
|
||||
with db.engine.begin() as conn:
|
||||
touched_tables = set()
|
||||
for table_name, stmt in targets:
|
||||
conn.execute(text(stmt))
|
||||
touched_tables.add(table_name)
|
||||
for table_name in touched_tables:
|
||||
conn.execute(text(f"UPDATE {table_name} SET quantity_value = quantity WHERE quantity_value IS NULL"))
|
||||
conn.execute(text(f"UPDATE {table_name} SET quantity_unit = 'szt' WHERE quantity_unit IS NULL OR quantity_unit = ''"))
|
||||
print("[INFO] Zastosowano lekką migrację schematu dla ilości/jednostek produktów")
|
||||
|
||||
def set_authorized_cookie(response):
|
||||
secure_flag = app.config["SESSION_COOKIE_SECURE"]
|
||||
max_age = app.config.get("AUTH_COOKIE_MAX_AGE", 86400)
|
||||
@@ -753,7 +528,6 @@ if app.config["SQLALCHEMY_DATABASE_URI"].startswith("sqlite:///"):
|
||||
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
ensure_lightweight_schema_migrations()
|
||||
|
||||
# --- Tworzenie admina ---
|
||||
admin_username = DEFAULT_ADMIN_USERNAME
|
||||
|
||||
@@ -73,8 +73,6 @@ class Item(db.Model):
|
||||
purchased = db.Column(db.Boolean, default=False)
|
||||
purchased_at = db.Column(db.DateTime, nullable=True)
|
||||
quantity = db.Column(db.Integer, default=1)
|
||||
quantity_value = db.Column(db.Float, nullable=True)
|
||||
quantity_unit = db.Column(db.String(20), default="szt", nullable=True)
|
||||
note = db.Column(db.Text, nullable=True)
|
||||
not_purchased = db.Column(db.Boolean, default=False)
|
||||
not_purchased_reason = db.Column(db.Text, nullable=True)
|
||||
@@ -188,8 +186,6 @@ class ListTemplateItem(db.Model):
|
||||
template_id = db.Column(db.Integer, db.ForeignKey("list_template.id", ondelete="CASCADE"), nullable=False)
|
||||
name = db.Column(db.String(150), nullable=False)
|
||||
quantity = db.Column(db.Integer, default=1)
|
||||
quantity_value = db.Column(db.Float, nullable=True)
|
||||
quantity_unit = db.Column(db.String(20), default="szt", nullable=True)
|
||||
note = db.Column(db.Text, nullable=True)
|
||||
position = db.Column(db.Integer, default=0)
|
||||
|
||||
|
||||
@@ -207,9 +207,11 @@ def main_page():
|
||||
|
||||
@app.route("/system-auth", methods=["GET", "POST"])
|
||||
def system_auth():
|
||||
|
||||
if request.cookies.get("authorized") == AUTHORIZED_COOKIE_VALUE:
|
||||
flash("Jesteś już autoryzowany.", "info")
|
||||
if (
|
||||
current_user.is_authenticated
|
||||
or request.cookies.get("authorized") == AUTHORIZED_COOKIE_VALUE
|
||||
):
|
||||
flash("Jesteś już zalogowany lub autoryzowany.", "info")
|
||||
return redirect(url_for("main_page"))
|
||||
|
||||
ip = request.access_route[0]
|
||||
@@ -546,21 +548,8 @@ def logout():
|
||||
def create_list():
|
||||
title = request.form.get("title")
|
||||
is_temporary = request.form.get("temporary") == "1"
|
||||
list_date_raw = (request.form.get("list_date") or "").strip()
|
||||
token = generate_share_token(8)
|
||||
|
||||
created_at_override = None
|
||||
if list_date_raw:
|
||||
try:
|
||||
# created_at jest w tym modelu DateTime bez strefy. Środek dnia
|
||||
# zapobiega przypadkowemu przesunięciu daty przy konwersjach DB/UI.
|
||||
created_at_override = datetime.strptime(list_date_raw, "%Y-%m-%d").replace(
|
||||
hour=12, minute=0, second=0, microsecond=0
|
||||
)
|
||||
except ValueError:
|
||||
flash("Nieprawidłowa data listy.", "danger")
|
||||
return redirect(url_for("main_page"))
|
||||
|
||||
expires_at = (
|
||||
datetime.now(timezone.utc) + timedelta(days=7) if is_temporary else None
|
||||
)
|
||||
@@ -572,8 +561,6 @@ def create_list():
|
||||
share_token=token,
|
||||
expires_at=expires_at,
|
||||
)
|
||||
if created_at_override is not None:
|
||||
new_list.created_at = created_at_override
|
||||
db.session.add(new_list)
|
||||
db.session.commit()
|
||||
log_list_activity(new_list.id, 'list_created', actor=current_user, actor_name=current_user.username, details='Utworzono listę ręcznie')
|
||||
|
||||
@@ -191,27 +191,25 @@ def handle_edit_item(data):
|
||||
item = db.session.get(Item, data["item_id"])
|
||||
|
||||
new_name = data["new_name"]
|
||||
new_quantity_value = parse_quantity_value(data.get("quantity_value", data.get("new_quantity", item.quantity)))
|
||||
new_quantity_unit = normalize_quantity_unit(data.get("quantity_unit", getattr(item, "quantity_unit", None)))
|
||||
new_quantity = data.get("new_quantity", item.quantity)
|
||||
|
||||
if item and new_name.strip():
|
||||
item.name = new_name.strip()
|
||||
item.quantity_value = new_quantity_value
|
||||
item.quantity_unit = new_quantity_unit
|
||||
item.quantity = legacy_quantity_int(new_quantity_value)
|
||||
|
||||
try:
|
||||
new_quantity = int(new_quantity)
|
||||
if new_quantity < 1:
|
||||
new_quantity = 1
|
||||
except:
|
||||
new_quantity = 1
|
||||
|
||||
item.quantity = new_quantity
|
||||
|
||||
db.session.commit()
|
||||
|
||||
emit(
|
||||
"item_edited",
|
||||
{
|
||||
"item_id": item.id,
|
||||
"new_name": item.name,
|
||||
"new_quantity": item.quantity,
|
||||
"quantity_value": item.quantity_value,
|
||||
"quantity_unit": item.quantity_unit,
|
||||
"quantity_label": quantity_label(item),
|
||||
},
|
||||
{"item_id": item.id, "new_name": item.name, "new_quantity": item.quantity},
|
||||
to=str(item.list_id),
|
||||
)
|
||||
|
||||
@@ -221,82 +219,49 @@ def handle_join(data):
|
||||
global active_users
|
||||
room = str(data["room"])
|
||||
username = data.get("username", "Gość")
|
||||
silent = bool(data.get("silent", False))
|
||||
sid = request.sid
|
||||
|
||||
# Trzymamy obecność per SID, a nie tylko per nazwa użytkownika. Dzięki temu
|
||||
# ponowiony join z tego samego połączenia jest idempotentny, a dwie karty
|
||||
# tego samego użytkownika nie psują statusu obecności przy disconnect.
|
||||
room_users = active_users.setdefault(room, {})
|
||||
already_joined = sid in room_users
|
||||
room_users[sid] = username
|
||||
join_room(room)
|
||||
|
||||
if room not in active_users:
|
||||
active_users[room] = set()
|
||||
active_users[room].add(username)
|
||||
|
||||
shopping_list = db.session.get(ShoppingList, int(data["room"]))
|
||||
|
||||
list_title = shopping_list.title if shopping_list else "Twoja lista"
|
||||
|
||||
if not already_joined:
|
||||
# Nie pokazujemy użytkownikowi komunikatu, że sam właśnie dołączył.
|
||||
emit("user_joined", {"username": username}, to=room, include_self=False)
|
||||
emit(
|
||||
"user_list",
|
||||
{"users": sorted(set(room_users.values()))},
|
||||
to=room,
|
||||
)
|
||||
|
||||
emit(
|
||||
"joined_confirmation",
|
||||
{
|
||||
"room": room,
|
||||
"list_title": list_title,
|
||||
"users": sorted(set(room_users.values())),
|
||||
"silent": silent,
|
||||
},
|
||||
to=sid,
|
||||
)
|
||||
return {
|
||||
"ok": True,
|
||||
"room": room,
|
||||
"already_joined": already_joined,
|
||||
"silent": silent,
|
||||
}
|
||||
emit("user_joined", {"username": username}, to=room)
|
||||
emit("user_list", {"users": list(active_users[room])}, to=room)
|
||||
emit("joined_confirmation", {"room": room, "list_title": list_title})
|
||||
|
||||
|
||||
@socketio.on("disconnect")
|
||||
def handle_disconnect(_reason=None):
|
||||
def handle_disconnect(sid):
|
||||
global active_users
|
||||
sid = request.sid
|
||||
|
||||
for room, room_users in list(active_users.items()):
|
||||
if not isinstance(room_users, dict) or sid not in room_users:
|
||||
continue
|
||||
|
||||
username = room_users.pop(sid)
|
||||
remaining_users = sorted(set(room_users.values()))
|
||||
|
||||
# Jeśli ten sam użytkownik ma drugą kartę/urządzenie w pokoju,
|
||||
# nie ogłaszamy jego wyjścia dopóki ostatnie połączenie nie zniknie.
|
||||
if username not in room_users.values():
|
||||
username = current_user.username if current_user.is_authenticated else "Gość"
|
||||
for room, users in active_users.items():
|
||||
if username in users:
|
||||
users.remove(username)
|
||||
emit("user_left", {"username": username}, to=room)
|
||||
|
||||
emit("user_list", {"users": remaining_users}, to=room)
|
||||
|
||||
if not room_users:
|
||||
active_users.pop(room, None)
|
||||
emit("user_list", {"users": list(users)}, to=room)
|
||||
|
||||
|
||||
@socketio.on("add_item")
|
||||
def handle_add_item(data):
|
||||
list_id = data["list_id"]
|
||||
name = data["name"].strip()
|
||||
quantity_value = parse_quantity_value(data.get("quantity_value", data.get("quantity", 1)))
|
||||
quantity_unit = normalize_quantity_unit(data.get("quantity_unit", "szt"))
|
||||
quantity = legacy_quantity_int(quantity_value)
|
||||
quantity = data.get("quantity", 1)
|
||||
|
||||
list_obj = db.session.get(ShoppingList, list_id)
|
||||
if not list_obj:
|
||||
return
|
||||
|
||||
try:
|
||||
quantity = int(quantity)
|
||||
if quantity < 1:
|
||||
quantity = 1
|
||||
except:
|
||||
quantity = 1
|
||||
|
||||
existing_item = Item.query.filter(
|
||||
Item.list_id == list_id,
|
||||
func.lower(Item.name) == name.lower(),
|
||||
@@ -304,14 +269,7 @@ def handle_add_item(data):
|
||||
).first()
|
||||
|
||||
if existing_item:
|
||||
current_value = parse_quantity_value(getattr(existing_item, "quantity_value", None), existing_item.quantity or 1)
|
||||
current_unit = normalize_quantity_unit(getattr(existing_item, "quantity_unit", None))
|
||||
if current_unit == quantity_unit:
|
||||
existing_item.quantity_value = current_value + quantity_value
|
||||
else:
|
||||
existing_item.quantity_value = quantity_value
|
||||
existing_item.quantity_unit = quantity_unit
|
||||
existing_item.quantity = legacy_quantity_int(existing_item.quantity_value)
|
||||
existing_item.quantity += quantity
|
||||
db.session.commit()
|
||||
|
||||
emit(
|
||||
@@ -320,9 +278,6 @@ def handle_add_item(data):
|
||||
"item_id": existing_item.id,
|
||||
"new_name": existing_item.name,
|
||||
"new_quantity": existing_item.quantity,
|
||||
"quantity_value": existing_item.quantity_value,
|
||||
"quantity_unit": existing_item.quantity_unit,
|
||||
"quantity_label": quantity_label(existing_item),
|
||||
},
|
||||
to=str(list_id),
|
||||
)
|
||||
@@ -342,8 +297,6 @@ def handle_add_item(data):
|
||||
list_id=list_id,
|
||||
name=name,
|
||||
quantity=quantity,
|
||||
quantity_value=quantity_value,
|
||||
quantity_unit=quantity_unit,
|
||||
position=max_position + 1,
|
||||
added_by=user_id,
|
||||
)
|
||||
@@ -355,7 +308,7 @@ def handle_add_item(data):
|
||||
new_suggestion = SuggestedProduct(name=name)
|
||||
db.session.add(new_suggestion)
|
||||
|
||||
log_list_activity(list_id, 'item_added', item_name=new_item.name, actor=current_user if current_user.is_authenticated else None, actor_name=user_name, details=f'ilość: {quantity_label(new_item)}')
|
||||
log_list_activity(list_id, 'item_added', item_name=new_item.name, actor=current_user if current_user.is_authenticated else None, actor_name=user_name, details=f'ilość: {new_item.quantity}')
|
||||
db.session.commit()
|
||||
|
||||
emit(
|
||||
@@ -364,9 +317,6 @@ def handle_add_item(data):
|
||||
"id": new_item.id,
|
||||
"name": new_item.name,
|
||||
"quantity": new_item.quantity,
|
||||
"quantity_value": new_item.quantity_value,
|
||||
"quantity_unit": new_item.quantity_unit,
|
||||
"quantity_label": quantity_label(new_item),
|
||||
"added_by": user_name,
|
||||
"added_by_id": user_id,
|
||||
"owner_id": list_obj.owner_id,
|
||||
@@ -392,56 +342,50 @@ def handle_add_item(data):
|
||||
def handle_check_item(data):
|
||||
item = db.session.get(Item, data["item_id"])
|
||||
|
||||
if not item:
|
||||
return {"ok": False, "error": "item_not_found"}
|
||||
if item:
|
||||
item.purchased = True
|
||||
item.purchased_at = datetime.now(UTC)
|
||||
item.not_purchased = False
|
||||
item.not_purchased_reason = None
|
||||
log_list_activity(item.list_id, 'item_checked', item_name=item.name, actor=current_user if current_user.is_authenticated else None, actor_name=current_user.username if current_user.is_authenticated else 'Gość')
|
||||
db.session.commit()
|
||||
|
||||
item.purchased = True
|
||||
item.purchased_at = datetime.now(UTC)
|
||||
item.not_purchased = False
|
||||
item.not_purchased_reason = None
|
||||
log_list_activity(item.list_id, 'item_checked', item_name=item.name, actor=current_user if current_user.is_authenticated else None, actor_name=current_user.username if current_user.is_authenticated else 'Gość')
|
||||
db.session.commit()
|
||||
purchased_count, total_count, percent = get_progress(item.list_id)
|
||||
|
||||
purchased_count, total_count, percent = get_progress(item.list_id)
|
||||
|
||||
emit("item_checked", {"item_id": item.id}, to=str(item.list_id))
|
||||
emit(
|
||||
"progress_updated",
|
||||
{
|
||||
"purchased_count": purchased_count,
|
||||
"total_count": total_count,
|
||||
"percent": percent,
|
||||
},
|
||||
to=str(item.list_id),
|
||||
)
|
||||
return {"ok": True, "item_id": item.id, "purchased": True}
|
||||
emit("item_checked", {"item_id": item.id}, to=str(item.list_id))
|
||||
emit(
|
||||
"progress_updated",
|
||||
{
|
||||
"purchased_count": purchased_count,
|
||||
"total_count": total_count,
|
||||
"percent": percent,
|
||||
},
|
||||
to=str(item.list_id),
|
||||
)
|
||||
|
||||
|
||||
@socketio.on("uncheck_item")
|
||||
def handle_uncheck_item(data):
|
||||
item = db.session.get(Item, data["item_id"])
|
||||
|
||||
if not item:
|
||||
return {"ok": False, "error": "item_not_found"}
|
||||
if item:
|
||||
item.purchased = False
|
||||
item.purchased_at = None
|
||||
log_list_activity(item.list_id, 'item_unchecked', item_name=item.name, actor=current_user if current_user.is_authenticated else None, actor_name=current_user.username if current_user.is_authenticated else 'Gość')
|
||||
db.session.commit()
|
||||
|
||||
item.purchased = False
|
||||
item.purchased_at = None
|
||||
log_list_activity(item.list_id, 'item_unchecked', item_name=item.name, actor=current_user if current_user.is_authenticated else None, actor_name=current_user.username if current_user.is_authenticated else 'Gość')
|
||||
db.session.commit()
|
||||
purchased_count, total_count, percent = get_progress(item.list_id)
|
||||
|
||||
purchased_count, total_count, percent = get_progress(item.list_id)
|
||||
|
||||
emit("item_unchecked", {"item_id": item.id}, to=str(item.list_id))
|
||||
emit(
|
||||
"progress_updated",
|
||||
{
|
||||
"purchased_count": purchased_count,
|
||||
"total_count": total_count,
|
||||
"percent": percent,
|
||||
},
|
||||
to=str(item.list_id),
|
||||
)
|
||||
return {"ok": True, "item_id": item.id, "purchased": False}
|
||||
emit("item_unchecked", {"item_id": item.id}, to=str(item.list_id))
|
||||
emit(
|
||||
"progress_updated",
|
||||
{
|
||||
"purchased_count": purchased_count,
|
||||
"total_count": total_count,
|
||||
"percent": percent,
|
||||
},
|
||||
to=str(item.list_id),
|
||||
)
|
||||
|
||||
|
||||
@socketio.on("request_full_list")
|
||||
@@ -450,7 +394,7 @@ def handle_request_full_list(data):
|
||||
|
||||
shopping_list = db.session.get(ShoppingList, list_id)
|
||||
if not shopping_list:
|
||||
return {"ok": False, "error": "list_not_found"}
|
||||
return
|
||||
|
||||
owner_id = shopping_list.owner_id
|
||||
|
||||
@@ -468,9 +412,6 @@ def handle_request_full_list(data):
|
||||
"id": item.id,
|
||||
"name": item.name,
|
||||
"quantity": item.quantity,
|
||||
"quantity_value": getattr(item, "quantity_value", None) or item.quantity or 1,
|
||||
"quantity_unit": normalize_quantity_unit(getattr(item, "quantity_unit", None)),
|
||||
"quantity_label": quantity_label(item),
|
||||
"purchased": item.purchased if not item.not_purchased else False,
|
||||
"not_purchased": item.not_purchased,
|
||||
"not_purchased_reason": item.not_purchased_reason,
|
||||
@@ -482,7 +423,6 @@ def handle_request_full_list(data):
|
||||
)
|
||||
|
||||
emit("full_list", {"items": items_data}, to=request.sid)
|
||||
return {"ok": True, "list_id": list_id}
|
||||
|
||||
|
||||
@socketio.on("update_note")
|
||||
@@ -513,7 +453,7 @@ def handle_add_expense(data):
|
||||
)
|
||||
|
||||
db.session.add(new_expense)
|
||||
log_list_activity(list_id, 'expense_added', item_name=None, actor=current_user if current_user.is_authenticated else None, actor_name=current_user.username if current_user.is_authenticated else 'Gość', details=f'kwota: {format_currency(amount)}')
|
||||
log_list_activity(list_id, 'expense_added', item_name=None, actor=current_user if current_user.is_authenticated else None, actor_name=current_user.username if current_user.is_authenticated else 'Gość', details=f'kwota: {float(amount):.2f} PLN')
|
||||
db.session.commit()
|
||||
|
||||
total = (
|
||||
@@ -654,22 +594,6 @@ def lists_cli():
|
||||
"""Operacje CLI na listach zakupowych."""
|
||||
|
||||
|
||||
def _load_list_for_cli(list_id: int):
|
||||
return ShoppingList.query.options(joinedload(ShoppingList.items), joinedload(ShoppingList.categories), joinedload(ShoppingList.owner)).get(list_id)
|
||||
|
||||
|
||||
def _parse_many_when_values(raw_values: str):
|
||||
values = []
|
||||
for part in (raw_values or '').split(','):
|
||||
normalized = part.strip()
|
||||
if not normalized:
|
||||
continue
|
||||
values.append(parse_cli_datetime(normalized))
|
||||
if not values:
|
||||
raise ValueError('Podaj co najmniej jedna date w --when-list.')
|
||||
return values
|
||||
|
||||
|
||||
@lists_cli.command("copy-schedule")
|
||||
@click.option("--source-list-id", required=True, type=int, help="ID listy zrodlowej.")
|
||||
@click.option("--when", "when_value", required=True, help="Nowa data utworzenia listy: YYYY-MM-DD lub YYYY-MM-DD HH:MM")
|
||||
@@ -677,7 +601,7 @@ def _parse_many_when_values(raw_values: str):
|
||||
@click.option("--title", default=None, help="Nowy tytul listy. Domyslnie taki sam jak w oryginale.")
|
||||
def lists_copy_schedule_command(source_list_id, when_value, owner_value, title):
|
||||
with app.app_context():
|
||||
source_list = _load_list_for_cli(source_list_id)
|
||||
source_list = ShoppingList.query.options(joinedload(ShoppingList.items), joinedload(ShoppingList.categories)).get(source_list_id)
|
||||
if not source_list:
|
||||
raise click.ClickException('Nie znaleziono listy zrodlowej.')
|
||||
|
||||
@@ -693,153 +617,6 @@ def lists_copy_schedule_command(source_list_id, when_value, owner_value, title):
|
||||
raise click.ClickException('Nie znaleziono docelowego wlasciciela.')
|
||||
|
||||
new_list = duplicate_list_for_schedule(source_list, scheduled_for=scheduled_for, owner=owner, title=title)
|
||||
log_list_activity(new_list.id, 'list_duplicated', actor_name='CLI', details=f'copy-schedule ze zrodla #{source_list.id}')
|
||||
db.session.commit()
|
||||
click.echo(
|
||||
f"Utworzono kopie listy: nowa_id={new_list.id}, tytul={new_list.title}, created_at={new_list.created_at.isoformat()}"
|
||||
)
|
||||
|
||||
|
||||
@lists_cli.command("move")
|
||||
@click.option("--list-id", required=True, type=int, help="ID listy.")
|
||||
@click.option("--when", "when_value", required=True, help="Nowy termin listy: YYYY-MM-DD lub YYYY-MM-DD HH:MM")
|
||||
@click.option("--keep-item-times", is_flag=True, help="Nie przesuwaj added_at/purchased_at pozycji.")
|
||||
@click.option("--keep-expiry", is_flag=True, help="Nie przesuwaj expires_at.")
|
||||
def lists_move_command(list_id, when_value, keep_item_times, keep_expiry):
|
||||
with app.app_context():
|
||||
shopping_list = _load_list_for_cli(list_id)
|
||||
if not shopping_list:
|
||||
raise click.ClickException('Nie znaleziono listy.')
|
||||
try:
|
||||
new_when = parse_cli_datetime(when_value)
|
||||
except ValueError as exc:
|
||||
raise click.ClickException(str(exc))
|
||||
old_created = shopping_list.created_at
|
||||
move_list_schedule(shopping_list, new_when, keep_item_times=keep_item_times, keep_expiry=keep_expiry)
|
||||
log_list_activity(shopping_list.id, 'list_moved', actor_name='CLI', details=f'Z {old_created} na {shopping_list.created_at}')
|
||||
db.session.commit()
|
||||
click.echo(f'Przeniesiono liste #{shopping_list.id} na {shopping_list.created_at.isoformat()}')
|
||||
|
||||
|
||||
@lists_cli.command("archive")
|
||||
@click.option("--list-id", required=True, type=int, help="ID listy.")
|
||||
def lists_archive_command(list_id):
|
||||
with app.app_context():
|
||||
shopping_list = _load_list_for_cli(list_id)
|
||||
if not shopping_list:
|
||||
raise click.ClickException('Nie znaleziono listy.')
|
||||
set_list_archived(shopping_list, archived=True)
|
||||
log_list_activity(shopping_list.id, 'list_archived', actor_name='CLI')
|
||||
db.session.commit()
|
||||
click.echo(f'Zarchiwizowano liste #{shopping_list.id}.')
|
||||
|
||||
|
||||
@lists_cli.command("unarchive")
|
||||
@click.option("--list-id", required=True, type=int, help="ID listy.")
|
||||
def lists_unarchive_command(list_id):
|
||||
with app.app_context():
|
||||
shopping_list = _load_list_for_cli(list_id)
|
||||
if not shopping_list:
|
||||
raise click.ClickException('Nie znaleziono listy.')
|
||||
set_list_archived(shopping_list, archived=False)
|
||||
log_list_activity(shopping_list.id, 'list_unarchived', actor_name='CLI')
|
||||
db.session.commit()
|
||||
click.echo(f'Przywrocono liste #{shopping_list.id} z archiwum.')
|
||||
|
||||
|
||||
@lists_cli.command("assign-owner")
|
||||
@click.option("--list-id", required=True, type=int, help="ID listy.")
|
||||
@click.option("--owner", "owner_value", required=True, help="Nowy wlasciciel: username albo ID.")
|
||||
def lists_assign_owner_command(list_id, owner_value):
|
||||
with app.app_context():
|
||||
shopping_list = _load_list_for_cli(list_id)
|
||||
if not shopping_list:
|
||||
raise click.ClickException('Nie znaleziono listy.')
|
||||
owner = resolve_user_identifier(owner_value)
|
||||
if not owner:
|
||||
raise click.ClickException('Nie znaleziono docelowego wlasciciela.')
|
||||
previous_owner = shopping_list.owner.username if shopping_list.owner else shopping_list.owner_id
|
||||
assign_list_owner(shopping_list, owner)
|
||||
log_list_activity(shopping_list.id, 'list_owner_changed', actor_name='CLI', details=f'{previous_owner} -> {owner.username}')
|
||||
db.session.commit()
|
||||
click.echo(f'Zmieniono wlasciciela listy #{shopping_list.id} na {owner.username}.')
|
||||
|
||||
|
||||
@lists_cli.command("create-from-template")
|
||||
@click.option("--template-id", required=True, type=int, help="ID szablonu.")
|
||||
@click.option("--owner", "owner_value", required=True, help="Wlasciciel nowej listy: username albo ID.")
|
||||
@click.option("--when", "when_value", default=None, help="Termin utworzenia: YYYY-MM-DD lub YYYY-MM-DD HH:MM")
|
||||
@click.option("--title", default=None, help="Tytul nowej listy.")
|
||||
def lists_create_from_template_command(template_id, owner_value, when_value, title):
|
||||
with app.app_context():
|
||||
template = ListTemplate.query.options(joinedload(ListTemplate.items)).get(template_id)
|
||||
if not template:
|
||||
raise click.ClickException('Nie znaleziono szablonu.')
|
||||
owner = resolve_user_identifier(owner_value)
|
||||
if not owner:
|
||||
raise click.ClickException('Nie znaleziono docelowego wlasciciela.')
|
||||
try:
|
||||
scheduled_for = parse_cli_datetime(when_value) if when_value else datetime.now(timezone.utc)
|
||||
except ValueError as exc:
|
||||
raise click.ClickException(str(exc))
|
||||
new_list = create_list_from_template_at_schedule(template, owner=owner, scheduled_for=scheduled_for, title=title)
|
||||
log_list_activity(new_list.id, 'template_created', actor_name='CLI', details=f'create-from-template z szablonu #{template.id}')
|
||||
db.session.commit()
|
||||
click.echo(f'Utworzono liste z szablonu: nowa_id={new_list.id}, tytul={new_list.title}, created_at={new_list.created_at.isoformat()}')
|
||||
|
||||
|
||||
@lists_cli.command("delete")
|
||||
@click.option("--list-id", required=True, type=int, help="ID listy.")
|
||||
def lists_delete_command(list_id):
|
||||
with app.app_context():
|
||||
shopping_list = _load_list_for_cli(list_id)
|
||||
if not shopping_list:
|
||||
raise click.ClickException('Nie znaleziono listy.')
|
||||
title = shopping_list.title
|
||||
delete_list_with_relations(shopping_list)
|
||||
db.session.commit()
|
||||
click.echo(f'Usunieto liste #{list_id}: {title}')
|
||||
|
||||
|
||||
@lists_cli.command("rename")
|
||||
@click.option("--list-id", required=True, type=int, help="ID listy.")
|
||||
@click.option("--title", "new_title", required=True, help="Nowy tytul listy.")
|
||||
def lists_rename_command(list_id, new_title):
|
||||
with app.app_context():
|
||||
shopping_list = _load_list_for_cli(list_id)
|
||||
if not shopping_list:
|
||||
raise click.ClickException('Nie znaleziono listy.')
|
||||
old_title = shopping_list.title
|
||||
try:
|
||||
rename_list(shopping_list, new_title)
|
||||
except ValueError as exc:
|
||||
raise click.ClickException(str(exc))
|
||||
log_list_activity(shopping_list.id, 'list_renamed', actor_name='CLI', details=f'{old_title} -> {shopping_list.title}')
|
||||
db.session.commit()
|
||||
click.echo(f'Zmieniono tytul listy #{shopping_list.id} na: {shopping_list.title}')
|
||||
|
||||
|
||||
@lists_cli.command("duplicate-many")
|
||||
@click.option("--source-list-id", required=True, type=int, help="ID listy zrodlowej.")
|
||||
@click.option("--when-list", required=True, help="Lista terminow rozdzielona przecinkami.")
|
||||
@click.option("--owner", "owner_value", default=None, help="Nowy wlasciciel: username albo ID.")
|
||||
@click.option("--title-prefix", default=None, help="Prefiks tytulu dla nowych list.")
|
||||
def lists_duplicate_many_command(source_list_id, when_list, owner_value, title_prefix):
|
||||
with app.app_context():
|
||||
source_list = _load_list_for_cli(source_list_id)
|
||||
if not source_list:
|
||||
raise click.ClickException('Nie znaleziono listy zrodlowej.')
|
||||
owner = None
|
||||
if owner_value:
|
||||
owner = resolve_user_identifier(owner_value)
|
||||
if not owner:
|
||||
raise click.ClickException('Nie znaleziono docelowego wlasciciela.')
|
||||
try:
|
||||
schedule_values = _parse_many_when_values(when_list)
|
||||
except ValueError as exc:
|
||||
raise click.ClickException(str(exc))
|
||||
created_lists = duplicate_list_many(source_list, schedule_values=schedule_values, owner=owner, title_prefix=title_prefix)
|
||||
for new_list in created_lists:
|
||||
log_list_activity(new_list.id, 'list_duplicated', actor_name='CLI', details=f'duplicate-many ze zrodla #{source_list.id}')
|
||||
db.session.commit()
|
||||
click.echo('Utworzono listy: ' + ', '.join([f'#{row.id}@{row.created_at.isoformat()}' for row in created_lists]))
|
||||
@@ -1,186 +0,0 @@
|
||||
.btn {
|
||||
min-height: 40px;
|
||||
padding: 0.52rem 0.8rem;
|
||||
border-radius: 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.01em;
|
||||
box-shadow: none;
|
||||
transition: background-color .18s ease, border-color .18s ease;
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
min-height: 34px;
|
||||
padding: 0.4rem 0.64rem;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
.btn:focus,
|
||||
.btn:focus-visible {
|
||||
border-color: rgba(25, 135, 84, 0.6) !important;
|
||||
box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.16) !important;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--primary) !important;
|
||||
border-color: var(--primary-border) !important;
|
||||
}
|
||||
|
||||
.btn-primary:hover,
|
||||
.btn-primary:focus,
|
||||
.btn-primary:active {
|
||||
background-color: #13315f !important;
|
||||
border-color: #10284f !important;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background: #1d975b !important;
|
||||
border-color: rgba(41, 209, 125, 0.9) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.btn-success:hover,
|
||||
.btn-success:focus,
|
||||
.btn-success:active {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.btn-warning {
|
||||
background-color: var(--warning) !important;
|
||||
border-color: var(--warning-border) !important;
|
||||
color: var(--warning-text) !important;
|
||||
}
|
||||
|
||||
.btn-warning:hover,
|
||||
.btn-warning:focus,
|
||||
.btn-warning:active {
|
||||
background-color: #5c4c17 !important;
|
||||
border-color: #3e3610 !important;
|
||||
color: var(--warning-text) !important;
|
||||
}
|
||||
|
||||
.btn-outline-light,
|
||||
.btn-outline-secondary,
|
||||
.btn-outline-warning,
|
||||
.btn-outline-danger,
|
||||
.btn-outline-primary,
|
||||
.btn-outline-success,
|
||||
.btn-outline-info {
|
||||
background: rgba(255,255,255,0.03);
|
||||
}
|
||||
|
||||
.btn-outline-light {
|
||||
color: #f8f9fa !important;
|
||||
border-color: #f8f9fa !important;
|
||||
}
|
||||
|
||||
.btn-outline-light:hover,
|
||||
.btn-outline-light:focus,
|
||||
.btn-outline-light:focus-visible {
|
||||
background-color: rgba(255,255,255,0.1) !important;
|
||||
color: #fff !important;
|
||||
border-color: #6c757d !important;
|
||||
}
|
||||
|
||||
.btn-outline-light:active,
|
||||
.btn-outline-light.active,
|
||||
.show > .btn-outline-light.dropdown-toggle {
|
||||
background-color: #5a6268 !important;
|
||||
color: #fff !important;
|
||||
border-color: #545b62 !important;
|
||||
}
|
||||
|
||||
.btn-outline-secondary:hover,
|
||||
.btn-outline-secondary:focus,
|
||||
.btn-outline-secondary:focus-visible {
|
||||
background: rgba(108, 117, 125, 0.18) !important;
|
||||
}
|
||||
|
||||
.btn-outline-success {
|
||||
color: var(--success) !important;
|
||||
border-color: var(--success) !important;
|
||||
}
|
||||
|
||||
.btn-outline-success:hover,
|
||||
.btn-outline-success:focus,
|
||||
.btn-outline-success:active,
|
||||
.btn-outline-success:focus-visible {
|
||||
background: var(--ui-success-soft) !important;
|
||||
border-color: var(--success-border) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.btn-outline-warning {
|
||||
color: #d9c97a !important;
|
||||
border-color: var(--warning) !important;
|
||||
}
|
||||
|
||||
.btn-outline-warning:hover,
|
||||
.btn-outline-warning:focus,
|
||||
.btn-outline-warning:active,
|
||||
.btn-outline-warning:focus-visible {
|
||||
background: var(--ui-warning-soft) !important;
|
||||
border-color: var(--warning-border) !important;
|
||||
color: var(--warning-text) !important;
|
||||
}
|
||||
|
||||
.btn-outline-danger:hover,
|
||||
.btn-outline-danger:focus,
|
||||
.btn-outline-danger:focus-visible {
|
||||
background: rgba(220, 53, 69, 0.16) !important;
|
||||
}
|
||||
|
||||
.btn-outline-info {
|
||||
color: var(--info) !important;
|
||||
border-color: var(--info) !important;
|
||||
}
|
||||
|
||||
.btn-outline-info:hover,
|
||||
.btn-outline-info:focus,
|
||||
.btn-outline-info:focus-visible {
|
||||
background-color: #1d4d8c !important;
|
||||
border-color: #1d4d8c !important;
|
||||
color: var(--info-text) !important;
|
||||
}
|
||||
|
||||
.btn-outline-info:active,
|
||||
.btn-outline-info.active,
|
||||
.show > .btn-outline-info.dropdown-toggle {
|
||||
background-color: var(--info) !important;
|
||||
border-color: var(--info-border) !important;
|
||||
color: var(--info-text) !important;
|
||||
}
|
||||
|
||||
#items .btn-group {
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
#items .btn-group .btn {
|
||||
border-radius: 12px !important;
|
||||
}
|
||||
|
||||
.btn-group-compact,
|
||||
.admin-shortcuts .d-flex,
|
||||
.stack-form,
|
||||
.page-actions {
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.btn-group-compact .btn {
|
||||
padding: 0.3rem 0.55rem;
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
.btn-group-compact .btn-text {
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
input[type="file"]::file-selector-button {
|
||||
background-color: #1b4a29;
|
||||
color: #f0f0f0;
|
||||
border: none;
|
||||
padding: .5em 1em;
|
||||
border-radius: 4px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: background .2s;
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
.form-select,
|
||||
.form-control,
|
||||
textarea.form-control {
|
||||
background-color: var(--dark-700) !important;
|
||||
color: var(--text-strong) !important;
|
||||
border: 1px solid var(--dark-300) !important;
|
||||
}
|
||||
|
||||
.form-select:focus,
|
||||
.form-control:focus,
|
||||
textarea.form-control:focus {
|
||||
background-color: var(--dark-800) !important;
|
||||
border-color: var(--primary) !important;
|
||||
color: #fff !important;
|
||||
box-shadow: 0 0 0 .25rem rgba(24, 64, 118, .35) !important;
|
||||
}
|
||||
|
||||
.form-control:disabled,
|
||||
textarea.form-control:disabled {
|
||||
background-color: var(--dark-550) !important;
|
||||
color: var(--muted) !important;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.form-switch .form-check-input {
|
||||
background-color: var(--dark-400) !important;
|
||||
border-color: var(--dark-300) !important;
|
||||
}
|
||||
|
||||
.form-switch .form-check-input:checked {
|
||||
background-color: var(--primary) !important;
|
||||
border-color: var(--primary-border) !important;
|
||||
}
|
||||
|
||||
.form-control::placeholder,
|
||||
.bg-dark .form-control::placeholder {
|
||||
color: #aaa !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.tom-dark .ts-control {
|
||||
background-color: var(--dark-700) !important;
|
||||
color: #fff !important;
|
||||
border: 1px solid var(--dark-300) !important;
|
||||
border-radius: .375rem;
|
||||
min-height: 38px;
|
||||
padding: .25rem .5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tom-dark .ts-control .item {
|
||||
background-color: var(--dark-400) !important;
|
||||
color: #fff !important;
|
||||
border-radius: .25rem;
|
||||
padding: 2px 8px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.ts-dropdown {
|
||||
background-color: var(--dark-700) !important;
|
||||
color: #fff !important;
|
||||
border: 1px solid var(--dark-300);
|
||||
border-radius: .375rem;
|
||||
z-index: 9999 !important;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.ts-dropdown .active {
|
||||
background-color: var(--dark-300) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
td select.tom-dark {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.large-checkbox,
|
||||
input[type="checkbox"].large-checkbox {
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
}
|
||||
|
||||
.large-checkbox {
|
||||
accent-color: #29d17d;
|
||||
transform: none;
|
||||
transform-origin: center;
|
||||
}
|
||||
|
||||
input[type="checkbox"].large-checkbox {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
input[type="checkbox"].large-checkbox::before {
|
||||
content: '✗';
|
||||
color: #dc3545;
|
||||
font-size: 1.6em;
|
||||
font-weight: 700;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
transition: color .2s;
|
||||
}
|
||||
|
||||
input[type="checkbox"].large-checkbox:checked::before {
|
||||
content: '✓';
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
input[type="checkbox"].large-checkbox:disabled::before {
|
||||
opacity: .5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input[type="checkbox"].large-checkbox:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
#createListTempToggle,
|
||||
.create-list-temp-toggle,
|
||||
#tempToggle {
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
}
|
||||
@@ -1,803 +0,0 @@
|
||||
.preview-product-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.preview-product-summary {
|
||||
padding: 0 0 0.85rem;
|
||||
margin-bottom: 0.1rem;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.08);
|
||||
}
|
||||
|
||||
.preview-product-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.preview-product-section-title {
|
||||
margin: 0;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.preview-modal-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
#productPreviewModal .preview-modal-list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: 0.9rem 1rem;
|
||||
margin: 0 !important;
|
||||
border-radius: 16px !important;
|
||||
border: 1px solid rgba(255,255,255,0.08) !important;
|
||||
background: rgba(11, 22, 40, 0.92) !important;
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
|
||||
}
|
||||
|
||||
#productPreviewModal .preview-modal-list-item:first-child,
|
||||
#productPreviewModal .preview-modal-list-item:last-child,
|
||||
#productPreviewModal .list-group-flush > .list-group-item:first-child,
|
||||
#productPreviewModal .list-group-flush > .list-group-item:last-child {
|
||||
border-radius: 16px !important;
|
||||
}
|
||||
|
||||
#productPreviewModal .preview-modal-list-item__name {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
#productPreviewModal .preview-modal-list-item .badge {
|
||||
flex-shrink: 0;
|
||||
min-width: 2.5rem;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.receipt-disclosure {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 20px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
|
||||
transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.receipt-disclosure:hover,
|
||||
.receipt-disclosure:focus-visible {
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.receipt-disclosure.is-open {
|
||||
border-color: rgba(24, 64, 118, 0.9);
|
||||
background: rgba(24, 64, 118, 0.20);
|
||||
}
|
||||
|
||||
.receipt-disclosure__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
.receipt-disclosure__icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
font-size: 1.25rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.receipt-disclosure__text {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.receipt-disclosure__eyebrow {
|
||||
font-size: 0.72rem;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.52);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.receipt-disclosure__title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-strong);
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.receipt-disclosure__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
margin-left: auto;
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.receipt-disclosure__count {
|
||||
min-width: 34px;
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-strong);
|
||||
font-size: 0.875rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.receipt-disclosure__chevron {
|
||||
font-size: 1.15rem;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.receipt-disclosure.is-open .receipt-disclosure__chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.receipt-disclosure__content {
|
||||
padding: 14px;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.receipt-disclosure__icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.receipt-disclosure__meta {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.receipt-disclosure__title {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
}
|
||||
|
||||
.endpoint-edit_my_list .stack-form > .mb-3 > .ui-consistent-input,
|
||||
.endpoint-edit_my_list .stack-form > .mb-4 > .ui-consistent-input,
|
||||
.endpoint-edit_my_list .stack-form .row .ui-consistent-input,
|
||||
.endpoint-edit_list form > .mb-3 > .ui-consistent-input,
|
||||
.endpoint-edit_list form > .mb-4 > .ui-consistent-input,
|
||||
.endpoint-edit_list form .row .ui-consistent-input,
|
||||
.endpoint-user_management .row > [class*="col-"] > .ui-consistent-input,
|
||||
.endpoint-user_management .modal .ui-consistent-input {
|
||||
border-radius: var(--ui-control-radius) !important;
|
||||
}
|
||||
|
||||
.endpoint-edit_my_list .ts-wrapper.single .ts-control,
|
||||
.endpoint-edit_list .ts-wrapper.single .ts-control,
|
||||
.endpoint-edit_my_list .ts-wrapper.multi .ts-control,
|
||||
.endpoint-edit_list .ts-wrapper.multi .ts-control {
|
||||
min-height: var(--ui-control-height) !important;
|
||||
border-radius: var(--ui-control-radius) !important;
|
||||
}
|
||||
|
||||
.share-hub {
|
||||
border: 1px solid rgba(79, 142, 255, 0.18);
|
||||
background: rgba(11, 24, 43, 0.98) !important;
|
||||
}
|
||||
|
||||
.share-hub .card-body {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.share-hub__top {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 0.9rem;
|
||||
margin-bottom: 0.85rem;
|
||||
}
|
||||
|
||||
.share-hub__eyebrow,
|
||||
.share-sheet__eyebrow {
|
||||
font-size: 0.72rem;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(186, 210, 240, 0.62);
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.share-hub__title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.share-hub__status,
|
||||
.share-sheet__section-head {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.45rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.share-state-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
min-height: 32px;
|
||||
padding: 0.45rem 0.72rem;
|
||||
font-size: 0.76rem;
|
||||
font-weight: 600;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.share-state-badge--public {
|
||||
background: rgba(41, 209, 125, 0.16);
|
||||
color: #dfffea;
|
||||
}
|
||||
|
||||
.share-state-badge--private {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: #edf5ff;
|
||||
}
|
||||
|
||||
.share-state-badge--link {
|
||||
background: rgba(79, 142, 255, 0.14);
|
||||
color: #d7e7ff;
|
||||
}
|
||||
|
||||
.share-state-badge--people {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: #edf5ff;
|
||||
}
|
||||
|
||||
.share-hub__note {
|
||||
color: rgba(210, 224, 244, 0.74);
|
||||
font-size: 0.92rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.share-hub__linkbox {
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
border-radius: 16px;
|
||||
padding: 0.85rem 0.95rem;
|
||||
}
|
||||
|
||||
.share-hub__linklabel {
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.07em;
|
||||
color: rgba(186, 210, 240, 0.58);
|
||||
margin-bottom: 0.3rem;
|
||||
}
|
||||
|
||||
.share-hub__linkvalue {
|
||||
color: #f4f8ff;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.45;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.share-hub__actions {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.share-hub__primary,
|
||||
.share-hub__secondary,
|
||||
.share-hub__manage,
|
||||
.share-sheet__toggle,
|
||||
.share-sheet__sticky-actions .btn,
|
||||
.share-sheet__linkstack .btn,
|
||||
|
||||
.share-hub__manage {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.share-sheet {
|
||||
height: auto !important;
|
||||
max-height: min(90vh, 760px);
|
||||
border-top-left-radius: 24px;
|
||||
border-top-right-radius: 24px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
background: rgba(8, 18, 33, 0.995) !important;
|
||||
box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.42);
|
||||
}
|
||||
|
||||
.share-sheet__header {
|
||||
align-items: flex-start;
|
||||
padding: 0.85rem 1rem 0.6rem;
|
||||
}
|
||||
|
||||
.share-sheet__body {
|
||||
padding: 0 1rem calc(1rem + env(safe-area-inset-bottom));
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.share-sheet__grabber {
|
||||
width: 52px;
|
||||
height: 5px;
|
||||
border-radius: 999px;
|
||||
margin: 0 auto 0.8rem;
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
|
||||
.share-sheet__section {
|
||||
border: 1px solid rgba(255, 255, 255, 0.07);
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
border-radius: 18px;
|
||||
padding: 0.95rem;
|
||||
margin-bottom: 0.9rem;
|
||||
}
|
||||
|
||||
.share-sheet__section-head {
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.7rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.share-sheet__linkstack,
|
||||
.share-access-panel__input {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.65rem;
|
||||
}
|
||||
|
||||
.share-access-panel .tokens {
|
||||
min-height: 2rem;
|
||||
}
|
||||
|
||||
.share-access-panel .token {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.share-sheet__sticky-actions {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
padding-top: 0.3rem;
|
||||
background: rgba(6, 13, 24, 0.96);
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.share-hub .card-body,
|
||||
.share-sheet__header,
|
||||
.share-sheet__body {
|
||||
padding-left: 1.2rem;
|
||||
padding-right: 1.2rem;
|
||||
}
|
||||
|
||||
.share-sheet__linkstack,
|
||||
.share-access-panel__input {
|
||||
grid-template-columns: 1fr auto;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.share-hub .card-body {
|
||||
padding: 1.15rem 1.2rem;
|
||||
}
|
||||
|
||||
.share-hub__actions {
|
||||
grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.share-sheet {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group {
|
||||
display: flex;
|
||||
flex-wrap: nowrap !important;
|
||||
align-items: stretch;
|
||||
overflow: hidden;
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
background: rgba(7, 17, 31, 0.9);
|
||||
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-title-input,
|
||||
.endpoint-main_page .create-list-input-group > .form-control {
|
||||
border: 0 !important;
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
border-radius: 0 !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-title-input:focus,
|
||||
.endpoint-main_page .create-list-input-group > .form-control:focus {
|
||||
background: rgba(255, 255, 255, 0.02) !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle {
|
||||
min-width: 9.5rem;
|
||||
border: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
background: rgba(255, 255, 255, 0.04) !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle.is-active,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle.is-active {
|
||||
background: rgba(41, 209, 125, 0.18) !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-temp-toggle__label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group:focus-within {
|
||||
border-color: rgba(41, 209, 125, 0.55);
|
||||
box-shadow: 0 0 0 0.18rem rgba(41, 209, 125, 0.12), 0 10px 28px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.receipt-disclosure {
|
||||
display: block;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.receipt-disclosure,
|
||||
.receipt-disclosure:hover,
|
||||
.receipt-disclosure:focus,
|
||||
.receipt-disclosure:active {
|
||||
width: 100%;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.receipt-disclosure:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.receipt-section--restoring {
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.endpoint-main_page .create-list-input-group {
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle {
|
||||
min-width: 8.25rem;
|
||||
padding-left: .8rem;
|
||||
padding-right: .8rem;
|
||||
font-size: .9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.endpoint-main_page .create-list-input-group > .create-list-title-input,
|
||||
.endpoint-main_page .create-list-input-group > .form-control {
|
||||
padding-left: .85rem;
|
||||
padding-right: .7rem;
|
||||
font-size: .95rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle {
|
||||
min-width: 7.6rem;
|
||||
font-size: .84rem;
|
||||
}
|
||||
|
||||
.receipt-disclosure {
|
||||
border-radius: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-check-spaced {
|
||||
gap: .35rem;
|
||||
}
|
||||
|
||||
.form-check-spaced .form-check-input,
|
||||
input[type="checkbox"].form-check-input,
|
||||
.table-select-checkbox {
|
||||
width: .95rem !important;
|
||||
height: .95rem !important;
|
||||
min-width: .95rem !important;
|
||||
min-height: .95rem !important;
|
||||
margin-top: .18rem;
|
||||
}
|
||||
|
||||
.form-switch-compact .form-check-input {
|
||||
width: 1.8rem !important;
|
||||
height: .95rem !important;
|
||||
}
|
||||
|
||||
.switch-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: .8rem;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .75rem;
|
||||
min-height: 2.75rem;
|
||||
margin: 0;
|
||||
padding: .58rem .82rem;
|
||||
background: rgba(255,255,255,.04);
|
||||
border: 1px solid var(--ui-border);
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch .form-check-input {
|
||||
float: none;
|
||||
flex: 0 0 auto;
|
||||
width: 2.45em !important;
|
||||
height: 1.3em !important;
|
||||
margin: 0 !important;
|
||||
cursor: pointer;
|
||||
background-color: var(--dark-400) !important;
|
||||
border-color: var(--dark-300) !important;
|
||||
background-position: left center !important;
|
||||
transition: background-position .18s ease-in-out, background-color .18s ease-in-out, border-color .18s ease-in-out, box-shadow .18s ease-in-out !important;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch .form-check-input:checked {
|
||||
background-color: var(--primary) !important;
|
||||
border-color: var(--primary-border) !important;
|
||||
background-position: right center !important;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch .form-check-input:focus {
|
||||
box-shadow: 0 0 0 .18rem rgba(24, 64, 118, .22) !important;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch .form-check-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 1.3rem;
|
||||
margin: 0 !important;
|
||||
line-height: 1.35;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch.form-switch-compact {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.form-check.form-switch.app-switch.form-switch-compact .form-check-input {
|
||||
width: 2.45em !important;
|
||||
height: 1.3em !important;
|
||||
}
|
||||
|
||||
.hide-purchased-switch.form-check,
|
||||
.hide-purchased-switch.form-check.app-switch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .7rem;
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
padding: .5rem .82rem;
|
||||
border-radius: 14px;
|
||||
background: rgba(255,255,255,.04);
|
||||
border: 1px solid var(--ui-border);
|
||||
}
|
||||
|
||||
.hide-purchased-switch .form-check-input {
|
||||
flex: 0 0 auto;
|
||||
float: none;
|
||||
width: 2.45em !important;
|
||||
height: 1.3em !important;
|
||||
margin: 0 !important;
|
||||
cursor: pointer;
|
||||
background-position: left center !important;
|
||||
transition: background-position .18s ease-in-out, background-color .18s ease-in-out, border-color .18s ease-in-out, box-shadow .18s ease-in-out !important;
|
||||
}
|
||||
|
||||
.hide-purchased-switch .form-check-input:checked {
|
||||
background-position: right center !important;
|
||||
}
|
||||
|
||||
.hide-purchased-switch .form-check-label {
|
||||
margin: 0 !important;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.create-list-input-group {
|
||||
display: flex;
|
||||
flex-wrap: nowrap !important;
|
||||
align-items: stretch;
|
||||
gap: 0 !important;
|
||||
}
|
||||
|
||||
.create-list-input-group > .form-control {
|
||||
flex: 1 1 auto !important;
|
||||
width: 1% !important;
|
||||
min-width: 0 !important;
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
.create-list-input-group > .create-list-temp-toggle,
|
||||
.create-list-input-group > #tempToggle {
|
||||
flex: 0 0 auto !important;
|
||||
width: auto !important;
|
||||
min-width: 10rem;
|
||||
margin-left: -1px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-top-right-radius: 14px !important;
|
||||
border-bottom-right-radius: 14px !important;
|
||||
background: rgba(255,255,255,0.03) !important;
|
||||
border-color: var(--app-border) !important;
|
||||
color: var(--app-text) !important;
|
||||
transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
|
||||
}
|
||||
|
||||
.create-list-input-group > .create-list-temp-toggle.is-active,
|
||||
.create-list-input-group > #tempToggle.is-active {
|
||||
background: rgba(41, 209, 125, 0.16) !important;
|
||||
border-color: rgba(41, 209, 125, 0.72) !important;
|
||||
color: #9bf0c1 !important;
|
||||
box-shadow: inset 0 0 0 1px rgba(41, 209, 125, 0.15);
|
||||
}
|
||||
|
||||
.create-list-input-group > .create-list-temp-toggle:hover,
|
||||
.create-list-input-group > #tempToggle:hover,
|
||||
.create-list-input-group > .create-list-temp-toggle:focus,
|
||||
.create-list-input-group > #tempToggle:focus {
|
||||
background: rgba(255,255,255,0.06) !important;
|
||||
color: var(--app-text) !important;
|
||||
}
|
||||
|
||||
.create-list-input-group > .create-list-temp-toggle.is-active:hover,
|
||||
.create-list-input-group > #tempToggle.is-active:hover,
|
||||
.create-list-input-group > .create-list-temp-toggle.is-active:focus,
|
||||
.create-list-input-group > #tempToggle.is-active:focus {
|
||||
background: rgba(41, 209, 125, 0.2) !important;
|
||||
color: #b7f7d2 !important;
|
||||
}
|
||||
|
||||
.endpoint-edit_my_list .switch-grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
||||
}
|
||||
|
||||
.endpoint-edit_my_list .switch-grid .app-switch,
|
||||
.endpoint-admin_edit_list .switch-grid .app-switch {
|
||||
width: 100%;
|
||||
min-height: 3.35rem;
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.hide-purchased-switch {
|
||||
padding-left: 2.95rem;
|
||||
}
|
||||
|
||||
.hide-purchased-switch.form-check.app-switch {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.switch-grid,
|
||||
.endpoint-edit_my_list .switch-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.create-list-input-group {
|
||||
gap: 0 !important;
|
||||
}
|
||||
|
||||
.create-list-input-group > .form-control {
|
||||
padding-left: .9rem;
|
||||
padding-right: .75rem;
|
||||
}
|
||||
|
||||
.create-list-input-group > .create-list-temp-toggle,
|
||||
.create-list-input-group > #tempToggle {
|
||||
min-width: 8.75rem;
|
||||
padding-left: .85rem;
|
||||
padding-right: .85rem;
|
||||
font-size: .92rem;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Tworzenie listy: osobny, kompaktowy wybór daty obok "Tymczasowa". */
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle {
|
||||
min-width: 8.75rem;
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-date-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #listDateToggle {
|
||||
flex: 0 0 auto !important;
|
||||
width: auto !important;
|
||||
min-width: 5.75rem;
|
||||
margin-left: -1px;
|
||||
padding-left: .8rem;
|
||||
padding-right: .8rem;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
border: 0 !important;
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
border-radius: 0 14px 14px 0 !important;
|
||||
background: rgba(255, 255, 255, 0.04) !important;
|
||||
color: var(--app-text) !important;
|
||||
box-shadow: none !important;
|
||||
transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-date-toggle:hover,
|
||||
.endpoint-main_page .create-list-input-group > .create-list-date-toggle:focus,
|
||||
.endpoint-main_page .create-list-input-group > #listDateToggle:hover,
|
||||
.endpoint-main_page .create-list-input-group > #listDateToggle:focus {
|
||||
background: rgba(255, 255, 255, 0.07) !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-date-toggle.is-active,
|
||||
.endpoint-main_page .create-list-input-group > #listDateToggle.is-active {
|
||||
background: rgba(13, 110, 253, 0.2) !important;
|
||||
color: #b9d4ff !important;
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle {
|
||||
min-width: 7.25rem;
|
||||
padding-left: .65rem;
|
||||
padding-right: .65rem;
|
||||
font-size: .86rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-date-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #listDateToggle {
|
||||
min-width: 5rem;
|
||||
padding-left: .55rem;
|
||||
padding-right: .55rem;
|
||||
font-size: .86rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.endpoint-main_page .create-list-input-group > .create-list-temp-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #tempToggle {
|
||||
min-width: 6.7rem;
|
||||
font-size: .8rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .create-list-input-group > .create-list-date-toggle,
|
||||
.endpoint-main_page .create-list-input-group > #listDateToggle {
|
||||
min-width: 4.7rem;
|
||||
padding-left: .45rem;
|
||||
padding-right: .45rem;
|
||||
font-size: .8rem;
|
||||
}
|
||||
}
|
||||
@@ -1,953 +0,0 @@
|
||||
.app-navbar__meta--mobile {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-user-chip--mobile {
|
||||
max-width: min(46vw, 15rem);
|
||||
min-width: 0;
|
||||
padding-left: .6rem;
|
||||
padding-right: .4rem;
|
||||
}
|
||||
|
||||
.app-user-chip--mobile .badge {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.app-header {
|
||||
padding-top: .55rem;
|
||||
}
|
||||
|
||||
.app-navbar .container-xxl {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
align-items: center;
|
||||
gap: .6rem;
|
||||
border-radius: 26px;
|
||||
padding-top: .8rem;
|
||||
padding-bottom: .8rem;
|
||||
}
|
||||
|
||||
.app-navbar__meta {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-brand {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-brand > span:last-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.app-brand__title,
|
||||
.app-brand__accent {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.app-navbar__meta--mobile {
|
||||
display: flex !important;
|
||||
width: auto;
|
||||
justify-content: flex-end;
|
||||
justify-self: end;
|
||||
grid-column: 2;
|
||||
min-width: 0;
|
||||
max-width: min(42vw, 12rem);
|
||||
}
|
||||
|
||||
.app-user-chip--mobile {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.app-ws-status--mobile {
|
||||
width: 2.15rem;
|
||||
min-width: 2.15rem;
|
||||
height: 2.15rem;
|
||||
min-height: 2.15rem;
|
||||
padding: 0;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.app-ws-status--mobile .app-ws-status__label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-ws-status--mobile .app-ws-status__dot {
|
||||
width: .68rem;
|
||||
height: .68rem;
|
||||
flex-basis: .68rem;
|
||||
}
|
||||
|
||||
.app-mobile-menu {
|
||||
grid-column: 3;
|
||||
justify-self: end;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.app-brand__icon {
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
}
|
||||
|
||||
.app-user-chip--mobile {
|
||||
gap: .35rem;
|
||||
padding: .34rem .38rem .34rem .5rem;
|
||||
}
|
||||
|
||||
.app-user-chip--mobile .app-user-chip__label {
|
||||
font-size: .62rem;
|
||||
letter-spacing: .05em;
|
||||
}
|
||||
|
||||
.app-user-chip--mobile .badge {
|
||||
font-size: .72rem;
|
||||
max-width: 5.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 430px) {
|
||||
.app-navbar .container-xxl {
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
gap: .45rem;
|
||||
}
|
||||
|
||||
.app-user-chip--mobile {
|
||||
max-width: min(38vw, 8.5rem);
|
||||
}
|
||||
|
||||
.app-user-chip--mobile .app-user-chip__label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-group-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress-wrap {
|
||||
display: block;
|
||||
width: 100%;
|
||||
flex: 0 0 100%;
|
||||
margin-top: 0.8rem !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-group-item > .main-list-row + .main-list-progress-wrap {
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress {
|
||||
width: 100%;
|
||||
height: 16px;
|
||||
margin-top: 0 !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: var(--dark-700) !important;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.05),
|
||||
0 4px 10px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress .progress-bar.bg-success {
|
||||
background: rgba(40, 199, 111, 0.98) !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress .progress-bar.bg-warning {
|
||||
background: rgba(245, 189, 65, 0.98) !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress .progress-bar.bg-transparent {
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress__label {
|
||||
max-width: calc(100% - 0.85rem);
|
||||
padding: 0 0.45rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.endpoint-main_page .main-list-progress {
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-list-progress__label {
|
||||
font-size: 0.64rem;
|
||||
}
|
||||
}
|
||||
|
||||
.endpoint-main_page #mainStatsCollapse.collapsing,
|
||||
.endpoint-main_page #mainStatsCollapse.show {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-card {
|
||||
height: 100%;
|
||||
padding: 1rem 1rem 1.05rem;
|
||||
border-radius: 1rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(9, 16, 28, 0.88);
|
||||
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-card__eyebrow {
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.08em;
|
||||
color: rgba(255, 255, 255, 0.65);
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-card__title {
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0.7rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-stat {
|
||||
padding: 0.65rem 0.75rem;
|
||||
border-radius: 0.85rem;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-stat__label {
|
||||
display: block;
|
||||
font-size: 0.73rem;
|
||||
color: rgba(255, 255, 255, 0.66);
|
||||
margin-bottom: 0.15rem;
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.endpoint-main_page .main-summary-card {
|
||||
padding: 0.9rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .main-summary-stats {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.endpoint-list_share .shopping-item-head,
|
||||
.endpoint-shared_list .shopping-item-head {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: start;
|
||||
column-gap: .45rem;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-actions,
|
||||
.endpoint-shared_list .shopping-item-actions {
|
||||
align-self: start;
|
||||
margin-left: 0;
|
||||
justify-self: end;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.endpoint-list_share .shopping-item-main,
|
||||
.endpoint-shared_list .shopping-item-main {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-text,
|
||||
.endpoint-shared_list .shopping-item-text,
|
||||
.endpoint-list_share .shopping-item-main > .large-checkbox,
|
||||
.endpoint-shared_list .shopping-item-main > .large-checkbox,
|
||||
.endpoint-list_share .shopping-item-actions,
|
||||
.endpoint-shared_list .shopping-item-actions {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-actions,
|
||||
.endpoint-shared_list .shopping-item-actions {
|
||||
margin-left: auto;
|
||||
justify-self: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.endpoint-list #items,
|
||||
.endpoint-view_list #items,
|
||||
.endpoint-list_share #items,
|
||||
.endpoint-shared_list #items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.endpoint-list #items > .list-group-item,
|
||||
.endpoint-view_list #items > .list-group-item,
|
||||
.endpoint-list_share #items > .list-group-item,
|
||||
.endpoint-shared_list #items > .list-group-item {
|
||||
margin: 0 !important;
|
||||
border-width: 1px !important;
|
||||
box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
.endpoint-list #items > .list-group-item + .list-group-item,
|
||||
.endpoint-view_list #items > .list-group-item + .list-group-item,
|
||||
.endpoint-list_share #items > .list-group-item + .list-group-item,
|
||||
.endpoint-shared_list #items > .list-group-item + .list-group-item {
|
||||
margin-top: 0 !important;
|
||||
border-top-width: 1px !important;
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px){
|
||||
.endpoint-list_share #items .list-group-item,
|
||||
.endpoint-shared_list #items .list-group-item {
|
||||
align-items: flex-start;
|
||||
}
|
||||
.endpoint-list_share .list-item-actions,
|
||||
.endpoint-shared_list .list-item-actions {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px){
|
||||
.share-page-toolbar {
|
||||
justify-content: stretch;
|
||||
}
|
||||
|
||||
.share-page-toolbar__spacer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.switch-grid,
|
||||
.endpoint-edit_my_list .switch-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px){
|
||||
.endpoint-admin_templates .table-responsive > table.table {
|
||||
width: max-content !important;
|
||||
min-width: 900px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px){
|
||||
.mobile-list-heading {
|
||||
display: inline-flex;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.mobile-list-heading__title {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.endpoint-main_page .list-group-item > .main-list-row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-main-actions {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.endpoint-main_page .list-group-item > .main-list-row {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-main-actions {
|
||||
width: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-main-actions .btn {
|
||||
padding: .38rem .52rem;
|
||||
min-width: 2.35rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-main-title {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: .15rem;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-main-meta {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.endpoint-main_page .list-main-title__link {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.shopping-item-row {
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.shopping-item-actions {
|
||||
width: auto;
|
||||
margin-top: 0;
|
||||
margin-left: auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.shopping-item-actions .btn {
|
||||
min-width: 2.35rem;
|
||||
padding: .38rem .52rem;
|
||||
}
|
||||
|
||||
.shopping-compact-input-group {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.shopping-compact-input-group > .form-control {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.shopping-qty-input {
|
||||
flex-basis: 4rem;
|
||||
max-width: 4rem;
|
||||
}
|
||||
|
||||
.shopping-compact-submit {
|
||||
min-width: auto;
|
||||
padding-left: .8rem;
|
||||
padding-right: .8rem;
|
||||
}
|
||||
|
||||
.ui-password-group > .ui-password-toggle {
|
||||
min-width: 2.75rem;
|
||||
padding-left: .7rem;
|
||||
padding-right: .7rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.shopping-item-main {
|
||||
gap: .55rem;
|
||||
}
|
||||
|
||||
.shopping-item-head {
|
||||
gap: .45rem;
|
||||
}
|
||||
|
||||
.shopping-item-actions {
|
||||
margin-left: auto;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.shopping-item-actions .btn {
|
||||
min-width: 2.2rem;
|
||||
padding: .34rem .48rem;
|
||||
}
|
||||
|
||||
.shopping-product-input-group > .shopping-product-name-input,
|
||||
.shopping-expense-input-group > .shopping-expense-amount-input {
|
||||
flex: 0 0 46%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.shopping-product-input-group > .shopping-qty-input {
|
||||
flex: 0 0 16%;
|
||||
max-width: 16%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.shopping-product-input-group > .shopping-qty-unit {
|
||||
flex: 0 0 18%;
|
||||
max-width: 18% !important;
|
||||
min-width: 0;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.shopping-product-input-group > .shopping-compact-submit {
|
||||
flex: 0 0 20%;
|
||||
width: 20%;
|
||||
min-width: 0;
|
||||
padding-left: .55rem;
|
||||
padding-right: .55rem;
|
||||
font-size: .95rem;
|
||||
}
|
||||
|
||||
.shopping-expense-input-group > .shopping-compact-submit {
|
||||
padding-left: .7rem;
|
||||
padding-right: .7rem;
|
||||
}
|
||||
|
||||
.list-toolbar {
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.list-toolbar__sort {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px){
|
||||
.endpoint-list .shopping-product-input-group,
|
||||
.endpoint-list_share .shopping-product-input-group,
|
||||
.endpoint-shared_list .shopping-product-input-group,
|
||||
.endpoint-list .shopping-expense-input-group,
|
||||
.endpoint-list_share .shopping-expense-input-group,
|
||||
.endpoint-shared_list .shopping-expense-input-group {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-product-input-group > .shopping-product-name-input,
|
||||
.endpoint-list_share .shopping-product-input-group > .shopping-product-name-input,
|
||||
.endpoint-shared_list .shopping-product-input-group > .shopping-product-name-input {
|
||||
flex: 0 0 46% !important;
|
||||
max-width: 46% !important;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-product-input-group > .shopping-qty-input,
|
||||
.endpoint-list_share .shopping-product-input-group > .shopping-qty-input,
|
||||
.endpoint-shared_list .shopping-product-input-group > .shopping-qty-input {
|
||||
flex: 0 0 16% !important;
|
||||
max-width: 16% !important;
|
||||
min-width: 0;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-product-input-group > .shopping-qty-unit,
|
||||
.endpoint-list_share .shopping-product-input-group > .shopping-qty-unit,
|
||||
.endpoint-shared_list .shopping-product-input-group > .shopping-qty-unit {
|
||||
flex: 0 0 18% !important;
|
||||
max-width: 18% !important;
|
||||
min-width: 0;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-product-input-group > .shopping-compact-submit,
|
||||
.endpoint-list_share .shopping-product-input-group > .shopping-compact-submit,
|
||||
.endpoint-shared_list .shopping-product-input-group > .shopping-compact-submit {
|
||||
flex: 0 0 20% !important;
|
||||
width: 20% !important;
|
||||
min-width: 0 !important;
|
||||
padding-left: .4rem;
|
||||
padding-right: .4rem;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-expense-input-group > .shopping-expense-amount-input,
|
||||
.endpoint-list_share .shopping-expense-input-group > .shopping-expense-amount-input,
|
||||
.endpoint-shared_list .shopping-expense-input-group > .shopping-expense-amount-input {
|
||||
flex: 1 1 auto !important;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-expense-input-group > .shopping-compact-submit,
|
||||
.endpoint-list_share .shopping-expense-input-group > .shopping-compact-submit,
|
||||
.endpoint-shared_list .shopping-expense-input-group > .shopping-compact-submit {
|
||||
flex: 0 0 5rem !important;
|
||||
width: 5rem !important;
|
||||
min-width: 5rem !important;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-product-input-group > .shopping-compact-submit .shopping-btn-label,
|
||||
.endpoint-list_share .shopping-product-input-group > .shopping-compact-submit .shopping-btn-label,
|
||||
.endpoint-shared_list .shopping-product-input-group > .shopping-compact-submit .shopping-btn-label,
|
||||
.endpoint-list .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-label,
|
||||
.endpoint-list_share .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-label,
|
||||
.endpoint-shared_list .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-product-input-group > .shopping-compact-submit .shopping-btn-icon,
|
||||
.endpoint-list_share .shopping-product-input-group > .shopping-compact-submit .shopping-btn-icon,
|
||||
.endpoint-shared_list .shopping-product-input-group > .shopping-compact-submit .shopping-btn-icon,
|
||||
.endpoint-list .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-icon,
|
||||
.endpoint-list_share .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-icon,
|
||||
.endpoint-shared_list .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-icon {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px){
|
||||
.endpoint-view_list .shopping-product-input-group > .shopping-product-name-input {
|
||||
flex: 0 0 46% !important;
|
||||
max-width: 46% !important;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-product-input-group > .shopping-qty-input {
|
||||
flex: 0 0 16% !important;
|
||||
max-width: 16% !important;
|
||||
min-width: 0;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-product-input-group > .shopping-qty-unit {
|
||||
flex: 0 0 18% !important;
|
||||
max-width: 18% !important;
|
||||
min-width: 0;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-product-input-group > .shopping-compact-submit {
|
||||
flex: 0 0 20% !important;
|
||||
width: 20% !important;
|
||||
min-width: 0 !important;
|
||||
padding-left: .4rem;
|
||||
padding-right: .4rem;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-expense-input-group > .shopping-expense-amount-input {
|
||||
flex: 1 1 auto !important;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-expense-input-group > .shopping-compact-submit {
|
||||
flex: 0 0 5rem !important;
|
||||
width: 5rem !important;
|
||||
min-width: 5rem !important;
|
||||
padding-left: .35rem;
|
||||
padding-right: .35rem;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-product-input-group > .shopping-compact-submit .shopping-btn-label,
|
||||
.endpoint-view_list .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.endpoint-view_list .shopping-product-input-group > .shopping-compact-submit .shopping-btn-icon,
|
||||
.endpoint-view_list .shopping-expense-input-group > .shopping-compact-submit .shopping-btn-icon {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.shopping-item-head {
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.shopping-item-text {
|
||||
flex: 1 1 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.shopping-item-actions {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.shopping-item-main {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shopping-item-head {
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
gap: .4rem;
|
||||
}
|
||||
|
||||
.shopping-item-text {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
gap: .25rem;
|
||||
}
|
||||
|
||||
.shopping-item-actions {
|
||||
width: auto;
|
||||
margin-left: auto;
|
||||
gap: .25rem;
|
||||
}
|
||||
|
||||
.shopping-item-actions .btn {
|
||||
min-width: 2rem;
|
||||
padding: .3rem .42rem;
|
||||
}
|
||||
|
||||
.hide-purchased-switch--right {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.list-action-row {
|
||||
gap: .5rem;
|
||||
}
|
||||
|
||||
.list-action-row > .list-action-row__btn,
|
||||
.list-action-row__form {
|
||||
flex: 1 1 50%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.list-action-row__btn {
|
||||
padding-left: .55rem;
|
||||
padding-right: .55rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.endpoint-view_list .list-toolbar {
|
||||
display: grid !important;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center !important;
|
||||
gap: .4rem !important;
|
||||
flex-wrap: nowrap !important;
|
||||
}
|
||||
|
||||
.endpoint-view_list .list-toolbar__sort.btn {
|
||||
min-width: 0;
|
||||
padding: .35rem .55rem;
|
||||
font-size: .82rem;
|
||||
}
|
||||
|
||||
.endpoint-view_list .hide-purchased-switch--right {
|
||||
min-width: 0;
|
||||
gap: .25rem;
|
||||
font-size: .82rem;
|
||||
}
|
||||
|
||||
.endpoint-view_list .hide-purchased-switch--right .form-check-label {
|
||||
margin-left: .25rem !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.endpoint-view_list .hide-purchased-switch--right .form-check-input {
|
||||
transform: scale(.92);
|
||||
transform-origin: center;
|
||||
}
|
||||
|
||||
.list-header-toolbar {
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.list-header-toolbar .list-toolbar {
|
||||
width: 100%;
|
||||
justify-content: flex-end !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.endpoint-list_share .shopping-item-main,
|
||||
.endpoint-shared_list .shopping-item-main,
|
||||
.endpoint-view_list .shopping-item-main,
|
||||
.endpoint-list .shopping-item-main {
|
||||
gap: .55rem;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-head,
|
||||
.endpoint-shared_list .shopping-item-head,
|
||||
.endpoint-view_list .shopping-item-head,
|
||||
.endpoint-list .shopping-item-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: .45rem;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-text,
|
||||
.endpoint-shared_list .shopping-item-text,
|
||||
.endpoint-view_list .shopping-item-text,
|
||||
.endpoint-list .shopping-item-text {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
gap: .25rem;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-actions,
|
||||
.endpoint-shared_list .shopping-item-actions,
|
||||
.endpoint-view_list .shopping-item-actions,
|
||||
.endpoint-list .shopping-item-actions {
|
||||
align-self: start;
|
||||
width: auto;
|
||||
margin-left: auto;
|
||||
gap: .25rem;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-item-actions .btn,
|
||||
.endpoint-shared_list .shopping-item-actions .btn {
|
||||
min-width: 2rem;
|
||||
padding: .3rem .42rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.endpoint-list_share .shopping-action-btn,
|
||||
.endpoint-shared_list .shopping-action-btn,
|
||||
.endpoint-view_list .shopping-action-btn,
|
||||
.endpoint-list .shopping-action-btn {
|
||||
width: 2.15rem !important;
|
||||
height: 2.15rem !important;
|
||||
min-width: 2.15rem !important;
|
||||
min-height: 2.15rem !important;
|
||||
border-radius: .65rem !important;
|
||||
}
|
||||
|
||||
.endpoint-list_share .shopping-action-btn--wide,
|
||||
.endpoint-shared_list .shopping-action-btn--wide,
|
||||
.endpoint-view_list .shopping-action-btn--wide,
|
||||
.endpoint-list .shopping-action-btn--wide {
|
||||
min-width: 5.4rem !important;
|
||||
padding: 0 .72rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px){
|
||||
.endpoint-list_share .shopping-action-btn--countdown,
|
||||
.endpoint-shared_list .shopping-action-btn--countdown,
|
||||
.endpoint-view_list .shopping-action-btn--countdown,
|
||||
.endpoint-list .shopping-action-btn--countdown {
|
||||
min-width: 3rem !important;
|
||||
padding: 0 .55rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.ui-password-group > .ui-password-toggle {
|
||||
flex-basis: 44px !important;
|
||||
width: 44px !important;
|
||||
min-width: 44px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.endpoint-list .shopping-entry-card,
|
||||
.endpoint-list_share .shopping-entry-card,
|
||||
.endpoint-shared_list .shopping-entry-card,
|
||||
.endpoint-view_list .shopping-entry-card {
|
||||
padding: .8rem;
|
||||
border-radius: .95rem;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-entry-card__label,
|
||||
.endpoint-list_share .shopping-entry-card__label,
|
||||
.endpoint-shared_list .shopping-entry-card__label,
|
||||
.endpoint-view_list .shopping-entry-card__label {
|
||||
font-size: .92rem;
|
||||
}
|
||||
|
||||
.endpoint-list .shopping-entry-card__hint,
|
||||
.endpoint-list_share .shopping-entry-card__hint,
|
||||
.endpoint-shared_list .shopping-entry-card__hint,
|
||||
.endpoint-view_list .shopping-entry-card__hint {
|
||||
font-size: .78rem;
|
||||
margin-bottom: .65rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.endpoint-expenses .expenses-range-toolbar {
|
||||
justify-content: stretch !important;
|
||||
overflow: visible;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.endpoint-expenses .expenses-range-group {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0.55rem;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.endpoint-expenses .expenses-table-toolbar .expenses-range-group {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.endpoint-expenses .expenses-range-group > .btn {
|
||||
flex: initial !important;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding-inline: 0.55rem;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.endpoint-expenses .expenses-date-range {
|
||||
display: grid !important;
|
||||
grid-template-columns: 52px minmax(0, 1fr);
|
||||
gap: 0.55rem;
|
||||
width: 100%;
|
||||
max-width: 100% !important;
|
||||
flex-wrap: wrap !important;
|
||||
}
|
||||
|
||||
.endpoint-expenses .expenses-date-range > .input-group-text,
|
||||
.endpoint-expenses .expenses-date-range > .form-control,
|
||||
.endpoint-expenses .expenses-date-range > .btn {
|
||||
width: 100% !important;
|
||||
min-width: 0 !important;
|
||||
flex: initial !important;
|
||||
border-radius: 0.85rem !important;
|
||||
}
|
||||
|
||||
.endpoint-expenses .expenses-date-range > .btn {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.list-quick-actions {
|
||||
padding: .9rem;
|
||||
gap: .75rem;
|
||||
}
|
||||
|
||||
.list-quick-actions__header {
|
||||
flex-direction: column;
|
||||
gap: .35rem;
|
||||
}
|
||||
|
||||
.list-quick-actions__hint {
|
||||
max-width: none;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.list-quick-actions__grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.list-quick-actions__action.btn {
|
||||
min-height: 72px;
|
||||
padding: .85rem .9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.endpoint-view_list .app-navbar__meta--mobile,
|
||||
.endpoint-shared_list .app-navbar__meta--mobile {
|
||||
max-width: min(50vw, 14rem);
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 430px) {
|
||||
.endpoint-view_list .app-navbar__meta--mobile,
|
||||
.endpoint-shared_list .app-navbar__meta--mobile {
|
||||
max-width: min(46vw, 10rem);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
:root {
|
||||
--primary: #184076;
|
||||
--primary-border: #153866;
|
||||
--primary-text: #e6f0ff;
|
||||
|
||||
--info: var(--primary);
|
||||
--info-border: var(--primary-border);
|
||||
--info-text: var(--primary-text);
|
||||
|
||||
--success: #1c6930;
|
||||
--success-border: #165024;
|
||||
--success-text: #eaffea;
|
||||
|
||||
--warning: #665c1e;
|
||||
--warning-border: #4d4415;
|
||||
--warning-text: #fffbe5;
|
||||
|
||||
--danger: #6e1a1e;
|
||||
--danger-border: #531417;
|
||||
--danger-text: #ffeaea;
|
||||
|
||||
--dark-900: #181a1b;
|
||||
--dark-800: #1c1f22;
|
||||
--dark-750: #1f2225;
|
||||
--dark-700: #212529;
|
||||
--dark-650: #23272a;
|
||||
--dark-600: #2a2d31;
|
||||
--dark-550: #2b2f33;
|
||||
--dark-500: #2c2f33;
|
||||
--dark-480: #2c3034;
|
||||
--dark-470: #2a2d31;
|
||||
--dark-450: #3a3f44;
|
||||
--dark-400: #343a40;
|
||||
--dark-350: #3d4248;
|
||||
--dark-300: #495057;
|
||||
|
||||
--text-strong: #f8f9fa;
|
||||
--text: #e2e3e5;
|
||||
--text-dim: #e1e1e1;
|
||||
--muted: #6c757d;
|
||||
|
||||
--progress-default: #3d7bd6;
|
||||
}
|
||||
|
||||
.clickable-item {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.progress-thin {
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.item-not-checked {
|
||||
background-color: var(--dark-500) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
#empty-placeholder {
|
||||
font-style: italic;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.fade-out {
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease;
|
||||
}
|
||||
|
||||
@media (pointer: fine){
|
||||
.only-mobile {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-success {
|
||||
background-color: var(--success) !important;
|
||||
}
|
||||
|
||||
.bg-warning {
|
||||
background-color: var(--warning) !important;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/* Monochromatyczne ikony z lokalnego sprite SVG w <body>. */
|
||||
.ui-icon-sprite {
|
||||
position: absolute !important;
|
||||
left: 0; top: 0;
|
||||
width: 0 !important; height: 0 !important;
|
||||
overflow: hidden; pointer-events: none;
|
||||
}
|
||||
.ui-icon {
|
||||
display: inline-block;
|
||||
vertical-align: -0.13em;
|
||||
width: 1em; height: 1em;
|
||||
flex: none;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
pointer-events: none;
|
||||
}
|
||||
.app-brand__icon .ui-icon { width: 1.15rem; height: 1.15rem; }
|
||||
|
||||
/* Wyciszenie oznaczeń wizualnych bez usuwania informacji i akcji. */
|
||||
.share-state-badge--link,
|
||||
.share-state-badge--people { background-color: rgba(255, 255, 255, 0.04); }
|
||||
.list-quick-actions__icon { color: inherit; }
|
||||
.receipt-disclosure { box-shadow: none; }
|
||||
|
||||
/* zoom zachowuje układ blokowy, w przeciwieństwie do transform: scale().
|
||||
Wartości 100 nie nadpisujemy, aby domyślny UI pozostał bez zmian.
|
||||
Pomniejszanie dotyczy także tekstu i obszarów dotykowych - patrz testy. */
|
||||
html[data-ui-scale="90"] body.app-body { zoom: 0.9; }
|
||||
html[data-ui-scale="80"] body.app-body { zoom: 0.8; }
|
||||
html[data-ui-scale="70"] body.app-body { zoom: 0.7; }
|
||||
|
||||
/* Bootstrap dodaje backdrop do body i nadaje mu 100vw/100vh.
|
||||
Przy body { zoom } jednostki vw/vh wymagaja kompensacji, inaczej
|
||||
przy 70-90% pozostaje nieprzyciemniona czesc ekranu. */
|
||||
html[data-ui-scale="90"] :is(.modal-backdrop, .offcanvas-backdrop) {
|
||||
width: calc(100vw / 0.9);
|
||||
height: calc(100vh / 0.9);
|
||||
}
|
||||
html[data-ui-scale="80"] :is(.modal-backdrop, .offcanvas-backdrop) {
|
||||
width: calc(100vw / 0.8);
|
||||
height: calc(100vh / 0.8);
|
||||
}
|
||||
html[data-ui-scale="70"] :is(.modal-backdrop, .offcanvas-backdrop) {
|
||||
width: calc(100vw / 0.7);
|
||||
height: calc(100vh / 0.7);
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-alert-triangle" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M11 3a2 2 0 0 1 2 0l9 16H2zM12 9v4M12 17v.1"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 353 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-archive" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v12h14V8M10 12h4"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 371 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-down" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 4v16M5 13l7 7l7-7"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 327 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-up" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 20V4M5 11l7-7l7 7"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 325 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrows-sort" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M7 3v18M4 6l3-3l3 3M17 21V3M14 18l3 3l3-3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 348 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-ban" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9"/><path d="M5.6 5.6l12.8 12.8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 348 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-book" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 4h8a3 3 0 0 1 3 3v14H7a3 3 0 0 0-3 0zM15 7a3 3 0 0 1 3-3h2v17h-2a3 3 0 0 0-3 0"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 381 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-box" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 7l9-4l9 4v10l-9 4l-9-4zM3 7l9 4l9-4M12 11v10"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 346 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-bulb" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M9 18h6M10 21h4M8 14a7 7 0 1 1 8 0l-1 4H9z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 342 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-calendar" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="3" y="5" width="18" height="16" rx="2"/><path d="M7 3v4M17 3v4M3 10h18"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 374 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-camera" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 7h4l2-3h4l2 3h4a1 1 0 0 1 1 1v11H3V8a1 1 0 0 1 1-1z"/><circle cx="12" cy="13" r="4"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 387 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-chart-bar" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 3v18h18M7 17v-6h3v6M13 17V6h3v11M19 17v-8h2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 351 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-chart-line" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 3v18h18M6 16l5-6l4 3l5-7"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 333 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-check" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M5 12l5 5L20 7"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 315 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-clipboard" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="5" y="5" width="14" height="17" rx="2"/><path d="M9 5a3 3 0 0 1 6 0M8 11h8M8 15h8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 386 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-clock" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 343 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-coins" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9"/><path d="M15 8c-1-.9-5-1.1-6.2 0C7.2 10 9 12 12 12s4.8 1.8 3.2 4c-1.2 1.1-5.2.9-6.2 0M12 6v12"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 416 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="8" y="8" width="13" height="13" rx="2"/><path d="M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 404 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-device-floppy" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M5 3h13l3 3v15H3V3zM7 3v7h10V3M7 21v-8h10v8M14 5v3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 359 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-download" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 3v13M7 11l5 5l5-5M4 20h16"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 333 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eraser" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 14l10-10a3 3 0 0 1 4 0l3 3a3 3 0 0 1 0 4l-9 9H6zM10 11l7 7M11 20h10"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 372 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eye-off" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 3l18 18M10 5.2A12 12 0 0 1 12 5c6 0 10 7 10 7a16 16 0 0 1-3 3.6M6 6.4C3.5 8.2 2 12 2 12s4 7 10 7a10 10 0 0 0 4-1"/><path d="M10 10a3 3 0 0 0 4 4"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 450 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eye" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M2 12s4-7 10-7s10 7 10 7s-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 375 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-file-text" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 3h9l5 5v13H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zM15 3v6h5M8 13h8M8 17h8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 374 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-flame" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 22a8 8 0 0 0 8-8c0-4-3-6-5-9c-1 4-3 4-4 5c-2-3-2-5-3-7C6 8 4 10 4 14a8 8 0 0 0 8 8z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 388 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-folder" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v10H3z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 348 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-history" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 12a9 9 0 1 0 3-7M3 4v5h5M12 7v5l4 2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 341 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-hourglass" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M6 3h12M6 21h12M7 3c0 5 2 6 5 9c-3 3-5 4-5 9M17 3c0 5-2 6-5 9c3 3 5 4 5 9"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 378 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-info-circle" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 7v.1"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 354 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M10 13a5 5 0 0 0 7 .2l2-2a5 5 0 0 0-7-7l-1.1 1.1M14 11a5 5 0 0 0-7-.2l-2 2a5 5 0 0 0 7 7l1.1-1.1"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 396 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-lock-open" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 7-3M12 15v2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 384 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-lock" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 1 1 8 0v3M12 15v2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 381 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-login" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h5M14 7l5 5l-5 5M19 12H8"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 363 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-logout" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h5M15 7l5 5l-5 5M20 12H9"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 364 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-maximize" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 342 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-menu-2" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 7h16M4 12h16M4 17h16"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 325 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-notes" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M5 4h14v16H5zM8 8h8M8 12h7M8 16h5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 334 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-number" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M9 3L6 21M18 3l-3 18M4 9h17M3 16h17"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 337 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-palette" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 3a9 9 0 0 0 0 18h2a2 2 0 0 0 1-4c-1.5-1-.8-3 1-3h3a3 3 0 0 0 3-3a9 9 0 0 0-10-8z"/><circle cx="7" cy="10" r="1"/><circle cx="11" cy="6" r="1"/><circle cx="16" cy="8" r="1"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 477 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-pencil" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 20l4.5-1l11-11a2 2 0 0 0-3-3l-11 11zM14 7l3 3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 350 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-photo" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="8" cy="9" r="2"/><path d="M3 17l5-5l4 4l3-3l6 5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 400 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-player-pause" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M8 5v14M16 5v14"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 323 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-player-play" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M7 4l13 8l-13 8z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 323 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-plus" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 5v14M5 12h14"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 316 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-receipt" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M5 3h14v18l-3-2l-4 2l-4-2l-3 2zM8 8h8M8 12h8M8 16h5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 354 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-refresh" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M20 8a8 8 0 0 0-14-3L3 8M3 4v4h5M4 16a8 8 0 0 0 14 3l3-3M21 20v-4h-5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 371 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-rotate-clockwise" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M20 9V4h-5M20 4a9 9 0 1 0 2 10"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 342 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-scissors" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="6" cy="7" r="3"/><circle cx="6" cy="17" r="3"/><path d="M9 9l12 12M9 15L21 3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 383 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-search" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="10.5" cy="10.5" r="7.5"/><path d="M16 16l5 5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 349 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-settings" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="3"/><path d="M10 2h4l.6 3l2.3 1l2.5-1.6l2.2 3.3l-2.1 2l.1 2.5l2.4 1.8l-2.1 3.5l-2.9-.8l-2.1 1.5L14 22h-4l-.6-3l-2.3-1l-2.5 1.6L2.4 16.3l2.1-2l-.1-2.5L2 10l2.1-3.5l2.9.8l2.1-1.5z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 499 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-share" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="18" cy="5" r="2"/><circle cx="6" cy="12" r="2"/><circle cx="18" cy="19" r="2"/><path d="M8 11l8-5M8 13l8 5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 410 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-shield-lock" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 2l9 4v5c0 6-4 9-9 11c-5-2-9-5-9-11V6z"/><rect x="9" y="11" width="6" height="6" rx="1"/><path d="M10 11V9a2 2 0 0 1 4 0v2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 432 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-shopping-bag" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<rect x="4" y="7" width="16" height="14" rx="2"/><path d="M8 9V6a4 4 0 0 1 8 0v3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 379 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-shopping-cart" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="9" cy="20" r="1"/><circle cx="19" cy="20" r="1"/><path d="M2 3h2l3 13h13l2-9H5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 390 B |
@@ -1,67 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="ui-icon-sprite" width="0" height="0" aria-hidden="true" focusable="false">
|
||||
<defs>
|
||||
<symbol id="ti-alert-triangle" viewBox="0 0 24 24"><path d="M11 3a2 2 0 0 1 2 0l9 16H2zM12 9v4M12 17v.1"/></symbol>
|
||||
<symbol id="ti-archive" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v12h14V8M10 12h4"/></symbol>
|
||||
<symbol id="ti-arrow-down" viewBox="0 0 24 24"><path d="M12 4v16M5 13l7 7l7-7"/></symbol>
|
||||
<symbol id="ti-arrow-up" viewBox="0 0 24 24"><path d="M12 20V4M5 11l7-7l7 7"/></symbol>
|
||||
<symbol id="ti-arrows-sort" viewBox="0 0 24 24"><path d="M7 3v18M4 6l3-3l3 3M17 21V3M14 18l3 3l3-3"/></symbol>
|
||||
<symbol id="ti-ban" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M5.6 5.6l12.8 12.8"/></symbol>
|
||||
<symbol id="ti-book" viewBox="0 0 24 24"><path d="M4 4h8a3 3 0 0 1 3 3v14H7a3 3 0 0 0-3 0zM15 7a3 3 0 0 1 3-3h2v17h-2a3 3 0 0 0-3 0"/></symbol>
|
||||
<symbol id="ti-box" viewBox="0 0 24 24"><path d="M3 7l9-4l9 4v10l-9 4l-9-4zM3 7l9 4l9-4M12 11v10"/></symbol>
|
||||
<symbol id="ti-bulb" viewBox="0 0 24 24"><path d="M9 18h6M10 21h4M8 14a7 7 0 1 1 8 0l-1 4H9z"/></symbol>
|
||||
<symbol id="ti-calendar" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M7 3v4M17 3v4M3 10h18"/></symbol>
|
||||
<symbol id="ti-camera" viewBox="0 0 24 24"><path d="M4 7h4l2-3h4l2 3h4a1 1 0 0 1 1 1v11H3V8a1 1 0 0 1 1-1z"/><circle cx="12" cy="13" r="4"/></symbol>
|
||||
<symbol id="ti-chart-bar" viewBox="0 0 24 24"><path d="M3 3v18h18M7 17v-6h3v6M13 17V6h3v11M19 17v-8h2"/></symbol>
|
||||
<symbol id="ti-chart-line" viewBox="0 0 24 24"><path d="M3 3v18h18M6 16l5-6l4 3l5-7"/></symbol>
|
||||
<symbol id="ti-check" viewBox="0 0 24 24"><path d="M5 12l5 5L20 7"/></symbol>
|
||||
<symbol id="ti-clipboard" viewBox="0 0 24 24"><rect x="5" y="5" width="14" height="17" rx="2"/><path d="M9 5a3 3 0 0 1 6 0M8 11h8M8 15h8"/></symbol>
|
||||
<symbol id="ti-clock" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></symbol>
|
||||
<symbol id="ti-coins" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M15 8c-1-.9-5-1.1-6.2 0C7.2 10 9 12 12 12s4.8 1.8 3.2 4c-1.2 1.1-5.2.9-6.2 0M12 6v12"/></symbol>
|
||||
<symbol id="ti-copy" viewBox="0 0 24 24"><rect x="8" y="8" width="13" height="13" rx="2"/><path d="M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3"/></symbol>
|
||||
<symbol id="ti-device-floppy" viewBox="0 0 24 24"><path d="M5 3h13l3 3v15H3V3zM7 3v7h10V3M7 21v-8h10v8M14 5v3"/></symbol>
|
||||
<symbol id="ti-download" viewBox="0 0 24 24"><path d="M12 3v13M7 11l5 5l5-5M4 20h16"/></symbol>
|
||||
<symbol id="ti-eraser" viewBox="0 0 24 24"><path d="M3 14l10-10a3 3 0 0 1 4 0l3 3a3 3 0 0 1 0 4l-9 9H6zM10 11l7 7M11 20h10"/></symbol>
|
||||
<symbol id="ti-eye" viewBox="0 0 24 24"><path d="M2 12s4-7 10-7s10 7 10 7s-4 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></symbol>
|
||||
<symbol id="ti-eye-off" viewBox="0 0 24 24"><path d="M3 3l18 18M10 5.2A12 12 0 0 1 12 5c6 0 10 7 10 7a16 16 0 0 1-3 3.6M6 6.4C3.5 8.2 2 12 2 12s4 7 10 7a10 10 0 0 0 4-1"/><path d="M10 10a3 3 0 0 0 4 4"/></symbol>
|
||||
<symbol id="ti-file-text" viewBox="0 0 24 24"><path d="M6 3h9l5 5v13H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zM15 3v6h5M8 13h8M8 17h8"/></symbol>
|
||||
<symbol id="ti-flame" viewBox="0 0 24 24"><path d="M12 22a8 8 0 0 0 8-8c0-4-3-6-5-9c-1 4-3 4-4 5c-2-3-2-5-3-7C6 8 4 10 4 14a8 8 0 0 0 8 8z"/></symbol>
|
||||
<symbol id="ti-folder" viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v10H3z"/></symbol>
|
||||
<symbol id="ti-history" viewBox="0 0 24 24"><path d="M3 12a9 9 0 1 0 3-7M3 4v5h5M12 7v5l4 2"/></symbol>
|
||||
<symbol id="ti-hourglass" viewBox="0 0 24 24"><path d="M6 3h12M6 21h12M7 3c0 5 2 6 5 9c-3 3-5 4-5 9M17 3c0 5-2 6-5 9c3 3 5 4 5 9"/></symbol>
|
||||
<symbol id="ti-info-circle" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 7v.1"/></symbol>
|
||||
<symbol id="ti-link" viewBox="0 0 24 24"><path d="M10 13a5 5 0 0 0 7 .2l2-2a5 5 0 0 0-7-7l-1.1 1.1M14 11a5 5 0 0 0-7-.2l-2 2a5 5 0 0 0 7 7l1.1-1.1"/></symbol>
|
||||
<symbol id="ti-lock" viewBox="0 0 24 24"><rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 1 1 8 0v3M12 15v2"/></symbol>
|
||||
<symbol id="ti-lock-open" viewBox="0 0 24 24"><rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 7-3M12 15v2"/></symbol>
|
||||
<symbol id="ti-login" viewBox="0 0 24 24"><path d="M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h5M14 7l5 5l-5 5M19 12H8"/></symbol>
|
||||
<symbol id="ti-logout" viewBox="0 0 24 24"><path d="M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h5M15 7l5 5l-5 5M20 12H9"/></symbol>
|
||||
<symbol id="ti-maximize" viewBox="0 0 24 24"><path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/></symbol>
|
||||
<symbol id="ti-menu-2" viewBox="0 0 24 24"><path d="M4 7h16M4 12h16M4 17h16"/></symbol>
|
||||
<symbol id="ti-notes" viewBox="0 0 24 24"><path d="M5 4h14v16H5zM8 8h8M8 12h7M8 16h5"/></symbol>
|
||||
<symbol id="ti-number" viewBox="0 0 24 24"><path d="M9 3L6 21M18 3l-3 18M4 9h17M3 16h17"/></symbol>
|
||||
<symbol id="ti-palette" viewBox="0 0 24 24"><path d="M12 3a9 9 0 0 0 0 18h2a2 2 0 0 0 1-4c-1.5-1-.8-3 1-3h3a3 3 0 0 0 3-3a9 9 0 0 0-10-8z"/><circle cx="7" cy="10" r="1"/><circle cx="11" cy="6" r="1"/><circle cx="16" cy="8" r="1"/></symbol>
|
||||
<symbol id="ti-pencil" viewBox="0 0 24 24"><path d="M4 20l4.5-1l11-11a2 2 0 0 0-3-3l-11 11zM14 7l3 3"/></symbol>
|
||||
<symbol id="ti-photo" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="8" cy="9" r="2"/><path d="M3 17l5-5l4 4l3-3l6 5"/></symbol>
|
||||
<symbol id="ti-player-pause" viewBox="0 0 24 24"><path d="M8 5v14M16 5v14"/></symbol>
|
||||
<symbol id="ti-player-play" viewBox="0 0 24 24"><path d="M7 4l13 8l-13 8z"/></symbol>
|
||||
<symbol id="ti-plus" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></symbol>
|
||||
<symbol id="ti-receipt" viewBox="0 0 24 24"><path d="M5 3h14v18l-3-2l-4 2l-4-2l-3 2zM8 8h8M8 12h8M8 16h5"/></symbol>
|
||||
<symbol id="ti-refresh" viewBox="0 0 24 24"><path d="M20 8a8 8 0 0 0-14-3L3 8M3 4v4h5M4 16a8 8 0 0 0 14 3l3-3M21 20v-4h-5"/></symbol>
|
||||
<symbol id="ti-rotate-clockwise" viewBox="0 0 24 24"><path d="M20 9V4h-5M20 4a9 9 0 1 0 2 10"/></symbol>
|
||||
<symbol id="ti-scissors" viewBox="0 0 24 24"><circle cx="6" cy="7" r="3"/><circle cx="6" cy="17" r="3"/><path d="M9 9l12 12M9 15L21 3"/></symbol>
|
||||
<symbol id="ti-search" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="7.5"/><path d="M16 16l5 5"/></symbol>
|
||||
<symbol id="ti-settings" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M10 2h4l.6 3l2.3 1l2.5-1.6l2.2 3.3l-2.1 2l.1 2.5l2.4 1.8l-2.1 3.5l-2.9-.8l-2.1 1.5L14 22h-4l-.6-3l-2.3-1l-2.5 1.6L2.4 16.3l2.1-2l-.1-2.5L2 10l2.1-3.5l2.9.8l2.1-1.5z"/></symbol>
|
||||
<symbol id="ti-share" viewBox="0 0 24 24"><circle cx="18" cy="5" r="2"/><circle cx="6" cy="12" r="2"/><circle cx="18" cy="19" r="2"/><path d="M8 11l8-5M8 13l8 5"/></symbol>
|
||||
<symbol id="ti-shield-lock" viewBox="0 0 24 24"><path d="M12 2l9 4v5c0 6-4 9-9 11c-5-2-9-5-9-11V6z"/><rect x="9" y="11" width="6" height="6" rx="1"/><path d="M10 11V9a2 2 0 0 1 4 0v2"/></symbol>
|
||||
<symbol id="ti-shopping-bag" viewBox="0 0 24 24"><rect x="4" y="7" width="16" height="14" rx="2"/><path d="M8 9V6a4 4 0 0 1 8 0v3"/></symbol>
|
||||
<symbol id="ti-shopping-cart" viewBox="0 0 24 24"><circle cx="9" cy="20" r="1"/><circle cx="19" cy="20" r="1"/><path d="M2 3h2l3 13h13l2-9H5"/></symbol>
|
||||
<symbol id="ti-tag" viewBox="0 0 24 24"><path d="M3 12V5a2 2 0 0 1 2-2h7l9 9l-9 9z"/><circle cx="8" cy="8" r="1"/></symbol>
|
||||
<symbol id="ti-target" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="5"/><circle cx="12" cy="12" r="1"/></symbol>
|
||||
<symbol id="ti-template" viewBox="0 0 24 24"><path d="M4 3h16v18H4zM4 9h16M9 9v12M13 13h4M13 17h4"/></symbol>
|
||||
<symbol id="ti-tool" viewBox="0 0 24 24"><path d="M14 6a6 6 0 0 0-8 8L3 17l4 4l3-3a6 6 0 0 0 8-8l-4 4l-4-4z"/></symbol>
|
||||
<symbol id="ti-trash" viewBox="0 0 24 24"><path d="M4 7h16M10 4h4M6 7l1 14h10l1-14M10 11v6M14 11v6"/></symbol>
|
||||
<symbol id="ti-user" viewBox="0 0 24 24"><circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/></symbol>
|
||||
<symbol id="ti-users" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3"/><path d="M3 20v-2a6 6 0 0 1 12 0v2H3M16 5a3 3 0 0 1 0 6M18 14a5 5 0 0 1 3 5v1h-4"/></symbol>
|
||||
<symbol id="ti-world" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c-6 5-6 13 0 18M12 3c6 5 6 13 0 18"/></symbol>
|
||||
<symbol id="ti-x" viewBox="0 0 24 24"><path d="M5 5l14 14M19 5L5 19"/></symbol>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.2 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-tag" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M3 12V5a2 2 0 0 1 2-2h7l9 9l-9 9z"/><circle cx="8" cy="8" r="1"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 361 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-target" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="5"/><circle cx="12" cy="12" r="1"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 383 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-template" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 3h16v18H4zM4 9h16M9 9v12M13 13h4M13 17h4"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 347 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-tool" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M14 6a6 6 0 0 0-8 8L3 17l4 4l3-3a6 6 0 0 0 8-8l-4 4l-4-4z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 357 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-trash" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M4 7h16M10 4h4M6 7l1 14h10l1-14M10 11v6M14 11v6"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 348 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-user" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 355 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-users" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="9" cy="8" r="3"/><path d="M3 20v-2a6 6 0 0 1 12 0v2H3M16 5a3 3 0 0 1 0 6M18 14a5 5 0 0 1 3 5v1h-4"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 401 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-world" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c-6 5-6 13 0 18M12 3c6 5 6 13 0 18"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 379 B |
@@ -1,4 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-x" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M5 5l14 14M19 5L5 19"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 317 B |
@@ -19,28 +19,6 @@
|
||||
tokensBox.appendChild(btn);
|
||||
}
|
||||
|
||||
function pluralizePeople(count) {
|
||||
if (count === 1) return 'osoba';
|
||||
const mod10 = count % 10;
|
||||
const mod100 = count % 100;
|
||||
if (mod10 >= 2 && mod10 <= 4 && !(mod100 >= 12 && mod100 <= 14)) return 'osoby';
|
||||
return 'osób';
|
||||
}
|
||||
|
||||
function syncAccessCount(box) {
|
||||
if (!box) return;
|
||||
const count = $$('.token', box).length;
|
||||
const sheetBadge = document.getElementById('shareSheetPeopleBadge');
|
||||
const cardBadge = document.getElementById('sharePeopleBadge');
|
||||
|
||||
if (sheetBadge) sheetBadge.textContent = String(count);
|
||||
|
||||
if (cardBadge) {
|
||||
setUiIconLabel(cardBadge, 'users', `${count} ${pluralizePeople(count)}`);
|
||||
cardBadge.classList.toggle('d-none', count === 0);
|
||||
}
|
||||
}
|
||||
|
||||
function wantsJSON() {
|
||||
return {
|
||||
'Accept': 'application/json',
|
||||
@@ -149,7 +127,6 @@
|
||||
empty.textContent = 'Brak dodanych uprawnień.';
|
||||
tokensBox.appendChild(empty);
|
||||
}
|
||||
syncAccessCount(box);
|
||||
toast(`Odebrano dostęp: @${username}`, 'success');
|
||||
} else {
|
||||
btn.disabled = false; btn.classList.remove('disabled');
|
||||
@@ -174,7 +151,6 @@
|
||||
if (res.data?.user) {
|
||||
appendToken(box, res.data.user);
|
||||
appended++;
|
||||
syncAccessCount(box);
|
||||
}
|
||||
} else {
|
||||
failCount++;
|
||||
@@ -195,7 +171,6 @@
|
||||
|
||||
addBtn?.addEventListener('click', addUsers);
|
||||
input?.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); addUsers(); } });
|
||||
syncAccessCount(box);
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
@@ -19,11 +19,11 @@ function initPasswordField(input) {
|
||||
btn.setAttribute('aria-label', 'Pokaż lub ukryj hasło');
|
||||
btn.setAttribute('aria-pressed', 'false');
|
||||
btn.title = 'Pokaż hasło';
|
||||
btn.innerHTML = uiIcon('eye');
|
||||
btn.innerHTML = '<span aria-hidden="true">👁</span>';
|
||||
|
||||
const syncState = function () {
|
||||
const visible = input.type === 'text';
|
||||
btn.innerHTML = uiIcon(visible ? 'eye-off' : 'eye');
|
||||
btn.innerHTML = visible ? '<span aria-hidden="true">🙈</span>' : '<span aria-hidden="true">👁</span>';
|
||||
btn.classList.toggle('is-active', visible);
|
||||
btn.setAttribute('aria-pressed', visible ? 'true' : 'false');
|
||||
btn.title = visible ? 'Ukryj hasło' : 'Pokaż hasło';
|
||||
@@ -99,7 +99,7 @@ function enhanceSearchableTables() {
|
||||
toolbar.className = 'table-toolbar';
|
||||
toolbar.innerHTML = [
|
||||
'<div class="input-group input-group-sm table-toolbar__search">',
|
||||
' <span class="input-group-text">' + uiIcon('search') + '</span>',
|
||||
' <span class="input-group-text">🔎</span>',
|
||||
' <input type="search" class="form-control" placeholder="Filtruj tabelę…" aria-label="Filtruj tabelę">',
|
||||
' <button type="button" class="btn btn-outline-light">Wyczyść</button>',
|
||||
'</div>',
|
||||
@@ -149,10 +149,10 @@ function wireCopyButtons() {
|
||||
const text = target.value || target.textContent || '';
|
||||
try {
|
||||
await navigator.clipboard.writeText(text.trim());
|
||||
const original = button.innerHTML;
|
||||
setUiIconLabel(button, 'check', 'Skopiowano');
|
||||
const original = button.textContent;
|
||||
button.textContent = '✅ Skopiowano';
|
||||
setTimeout(function () {
|
||||
button.innerHTML = original;
|
||||
button.textContent = original;
|
||||
}, 1800);
|
||||
} catch (err) {
|
||||
console.warn('Copy failed', err);
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
(function () {
|
||||
const DESKTOP_QUERY = '(min-width: 992px) and (pointer: fine)';
|
||||
|
||||
function isDesktopOwnerList() {
|
||||
return window.matchMedia(DESKTOP_QUERY).matches
|
||||
&& !window.IS_SHARE
|
||||
&& (
|
||||
document.body.classList.contains('endpoint-view_list')
|
||||
|| document.body.classList.contains('endpoint-list')
|
||||
);
|
||||
}
|
||||
|
||||
function getMenu() {
|
||||
return document.getElementById('desktopItemMenu');
|
||||
}
|
||||
|
||||
function hideDesktopItemMenu() {
|
||||
const menu = getMenu();
|
||||
if (!menu) return;
|
||||
menu.hidden = true;
|
||||
delete menu.dataset.itemId;
|
||||
delete menu.dataset.itemName;
|
||||
delete menu.dataset.itemQuantity;
|
||||
}
|
||||
|
||||
function positionMenu(menu, clickX, clickY) {
|
||||
const gap = 14;
|
||||
menu.style.left = '0px';
|
||||
menu.style.top = '0px';
|
||||
menu.hidden = false;
|
||||
|
||||
const rect = menu.getBoundingClientRect();
|
||||
const viewportWidth = window.innerWidth;
|
||||
const viewportHeight = window.innerHeight;
|
||||
|
||||
let left = clickX - (rect.width / 2);
|
||||
let top = clickY - rect.height - gap;
|
||||
|
||||
if (top < 12) {
|
||||
top = Math.min(viewportHeight - rect.height - 12, clickY + gap);
|
||||
}
|
||||
|
||||
left = Math.max(12, Math.min(left, viewportWidth - rect.width - 12));
|
||||
top = Math.max(12, Math.min(top, viewportHeight - rect.height - 12));
|
||||
|
||||
menu.style.left = `${left}px`;
|
||||
menu.style.top = `${top}px`;
|
||||
}
|
||||
|
||||
function showDesktopItemMenu(trigger, event) {
|
||||
const menu = getMenu();
|
||||
if (!menu) return;
|
||||
|
||||
menu.dataset.itemId = trigger.dataset.itemId || '';
|
||||
menu.dataset.itemName = trigger.dataset.itemName || '';
|
||||
menu.dataset.itemQuantity = trigger.dataset.itemQuantity || '1';
|
||||
|
||||
let clickX = event.clientX || 0;
|
||||
let clickY = event.clientY || 0;
|
||||
|
||||
if (!clickX && !clickY) {
|
||||
const rect = trigger.getBoundingClientRect();
|
||||
clickX = rect.left + (rect.width / 2);
|
||||
clickY = rect.top;
|
||||
}
|
||||
|
||||
positionMenu(menu, clickX, clickY);
|
||||
}
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
const menu = getMenu();
|
||||
const trigger = event.target.closest('[data-item-menu-trigger="true"]');
|
||||
|
||||
if (trigger && isDesktopOwnerList() && !trigger.disabled) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
showDesktopItemMenu(trigger, event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (menu && !menu.hidden && !event.target.closest('#desktopItemMenu')) {
|
||||
hideDesktopItemMenu();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key === 'Escape') {
|
||||
hideDesktopItemMenu();
|
||||
}
|
||||
});
|
||||
|
||||
['scroll', 'resize'].forEach(function (eventName) {
|
||||
window.addEventListener(eventName, hideDesktopItemMenu, true);
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const menu = getMenu();
|
||||
if (!menu) return;
|
||||
|
||||
menu.addEventListener('click', function (event) {
|
||||
const actionButton = event.target.closest('[data-menu-action]');
|
||||
if (!actionButton) return;
|
||||
|
||||
const itemId = parseInt(menu.dataset.itemId || '', 10);
|
||||
const itemName = menu.dataset.itemName || '';
|
||||
const itemQuantity = parseInt(menu.dataset.itemQuantity || '1', 10) || 1;
|
||||
|
||||
if (!itemId) {
|
||||
hideDesktopItemMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
if (actionButton.dataset.menuAction === 'edit') {
|
||||
openEditItemModal(event, itemId, itemName, itemQuantity);
|
||||
}
|
||||
|
||||
if (actionButton.dataset.menuAction === 'delete') {
|
||||
deleteItem(itemId);
|
||||
}
|
||||
|
||||
hideDesktopItemMenu();
|
||||
});
|
||||
});
|
||||
|
||||
window.hideDesktopItemMenu = hideDesktopItemMenu;
|
||||
})();
|
||||
@@ -123,7 +123,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
data: {
|
||||
labels: data.labels || [],
|
||||
datasets: [{
|
||||
label: `Suma wydatków [${getCurrencyCode()}]`,
|
||||
label: "Suma wydatków [PLN]",
|
||||
data: data.expenses || [],
|
||||
}],
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
total += parseFloat(cb.dataset.amount);
|
||||
}
|
||||
});
|
||||
totalEl.textContent = formatCurrencyAmount(total);
|
||||
totalEl.textContent = total.toFixed(2) + ' PLN';
|
||||
}
|
||||
|
||||
function getISOWeek(date) {
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
function getCurrencyCode() {
|
||||
return window.CURRENCY_CODE || 'PLN';
|
||||
}
|
||||
|
||||
function formatCurrencyAmount(amount, options = {}) {
|
||||
const includeCode = options.includeCode !== false;
|
||||
const numeric = Number(amount || 0);
|
||||
const safe = Number.isFinite(numeric) ? numeric : 0;
|
||||
const formatted = safe.toFixed(2);
|
||||
return includeCode ? `${formatted} ${getCurrencyCode()}` : formatted;
|
||||
}
|
||||
|
||||
function currencyLabel(prefix = 'Kwota') {
|
||||
return `${prefix} (${getCurrencyCode()})`;
|
||||
}
|
||||
|
||||
function updateItemState(itemId, isChecked) {
|
||||
const checkbox = document.querySelector(`#item-${itemId} input[type='checkbox']`);
|
||||
if (checkbox) {
|
||||
@@ -74,82 +58,24 @@ function updateProgressBar() {
|
||||
if (percentValueEl) percentValueEl.textContent = percent;
|
||||
}
|
||||
|
||||
function parseQuantityInput(value, fallback = 1) {
|
||||
const parsed = parseFloat(String(value ?? fallback).replace(',', '.'));
|
||||
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
||||
}
|
||||
|
||||
function formatQuantityValue(value) {
|
||||
const parsed = parseQuantityInput(value, 1);
|
||||
return Number.isInteger(parsed) ? String(parsed) : parsed.toFixed(3).replace(/0+$/, '').replace(/\.$/, '');
|
||||
}
|
||||
|
||||
function quantityLabel(value, unit) {
|
||||
const safeUnit = unit || 'szt';
|
||||
const safeValue = formatQuantityValue(value);
|
||||
return safeUnit === 'szt' ? `x${safeValue}` : `${safeValue} ${safeUnit}`;
|
||||
}
|
||||
|
||||
function quantityStepBase(value) {
|
||||
const parsed = parseQuantityInput(value, 1);
|
||||
const fraction = parsed - Math.floor(parsed);
|
||||
|
||||
if (Math.abs(fraction) < 0.0000001) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Math.max(0.001, Math.round(fraction * 1000) / 1000);
|
||||
}
|
||||
|
||||
function syncQuantityStepBase(input) {
|
||||
if (!input) return;
|
||||
|
||||
input.step = '1';
|
||||
input.min = formatQuantityValue(quantityStepBase(input.value));
|
||||
}
|
||||
|
||||
function setupQuantityStepper(input) {
|
||||
if (!input || input.dataset.quantityStepperReady === 'true') return;
|
||||
|
||||
input.dataset.quantityStepperReady = 'true';
|
||||
syncQuantityStepBase(input);
|
||||
input.addEventListener('input', () => syncQuantityStepBase(input));
|
||||
input.addEventListener('focus', () => syncQuantityStepBase(input));
|
||||
}
|
||||
|
||||
function setupQuantitySteppers(root = document) {
|
||||
root.querySelectorAll('#newQuantity, #editItemQuantity').forEach(setupQuantityStepper);
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', () => setupQuantitySteppers());
|
||||
} else {
|
||||
setupQuantitySteppers();
|
||||
}
|
||||
|
||||
function addItem(listId) {
|
||||
const name = document.getElementById('newItem').value;
|
||||
const quantityInput = document.getElementById('newQuantity');
|
||||
const unitInput = document.getElementById('newUnit');
|
||||
const quantityValue = parseQuantityInput(quantityInput?.value, 1);
|
||||
const quantityUnit = unitInput?.value || 'szt';
|
||||
let quantity = 1;
|
||||
|
||||
if (quantityInput) {
|
||||
quantity = parseInt(quantityInput.value);
|
||||
if (isNaN(quantity) || quantity < 1) {
|
||||
quantity = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (name.trim() === '') return;
|
||||
|
||||
socket.emit('add_item', {
|
||||
list_id: listId,
|
||||
name: name,
|
||||
quantity: Math.max(1, Math.round(quantityValue)),
|
||||
quantity_value: quantityValue,
|
||||
quantity_unit: quantityUnit
|
||||
});
|
||||
socket.emit('add_item', { list_id: listId, name: name, quantity: quantity });
|
||||
|
||||
document.getElementById('newItem').value = '';
|
||||
if (quantityInput) {
|
||||
quantityInput.value = 1;
|
||||
syncQuantityStepBase(quantityInput);
|
||||
}
|
||||
if (unitInput) unitInput.value = 'szt';
|
||||
if (quantityInput) quantityInput.value = 1;
|
||||
document.getElementById('newItem').focus();
|
||||
}
|
||||
|
||||
@@ -159,26 +85,23 @@ function deleteItem(id) {
|
||||
}
|
||||
}
|
||||
|
||||
function editItem(id, oldName, oldQuantity, oldUnit = 'szt') {
|
||||
function editItem(id, oldName, oldQuantity) {
|
||||
const finalName = String(oldName ?? '').trim();
|
||||
const newQuantity = parseQuantityInput(oldQuantity, 1);
|
||||
const newUnit = oldUnit || 'szt';
|
||||
let newQuantity = parseInt(oldQuantity, 10);
|
||||
|
||||
if (!finalName) {
|
||||
showToast('Nazwa produktu nie może być pusta.', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit('edit_item', {
|
||||
item_id: id,
|
||||
new_name: finalName,
|
||||
new_quantity: Math.max(1, Math.round(newQuantity)),
|
||||
quantity_value: newQuantity,
|
||||
quantity_unit: newUnit
|
||||
});
|
||||
if (isNaN(newQuantity) || newQuantity < 1) {
|
||||
newQuantity = 1;
|
||||
}
|
||||
|
||||
socket.emit('edit_item', { item_id: id, new_name: finalName, new_quantity: newQuantity });
|
||||
}
|
||||
|
||||
function openEditItemModal(event, id, oldName, oldQuantity, oldUnit = 'szt') {
|
||||
function openEditItemModal(event, id, oldName, oldQuantity) {
|
||||
if (event && typeof event.stopPropagation === 'function') {
|
||||
event.stopPropagation();
|
||||
}
|
||||
@@ -187,19 +110,17 @@ function openEditItemModal(event, id, oldName, oldQuantity, oldUnit = 'szt') {
|
||||
const idInput = document.getElementById('editItemId');
|
||||
const nameInput = document.getElementById('editItemName');
|
||||
const quantityInput = document.getElementById('editItemQuantity');
|
||||
const unitInput = document.getElementById('editItemUnit');
|
||||
|
||||
if (!modalEl || !idInput || !nameInput || !quantityInput || !unitInput || typeof bootstrap === 'undefined') {
|
||||
editItem(id, oldName, oldQuantity, oldUnit);
|
||||
if (!modalEl || !idInput || !nameInput || !quantityInput || typeof bootstrap === 'undefined') {
|
||||
editItem(id, oldName, oldQuantity);
|
||||
return;
|
||||
}
|
||||
|
||||
idInput.value = id;
|
||||
nameInput.value = String(oldName ?? '').trim();
|
||||
|
||||
quantityInput.value = formatQuantityValue(oldQuantity);
|
||||
syncQuantityStepBase(quantityInput);
|
||||
unitInput.value = oldUnit || 'szt';
|
||||
const parsedQuantity = parseInt(oldQuantity, 10);
|
||||
quantityInput.value = !isNaN(parsedQuantity) && parsedQuantity > 0 ? parsedQuantity : 1;
|
||||
|
||||
const modal = bootstrap.Modal.getOrCreateInstance(modalEl);
|
||||
modal.show();
|
||||
@@ -322,65 +243,27 @@ function applyHidePurchased(isInit = false) {
|
||||
});
|
||||
}
|
||||
|
||||
function formatShareUrlPreview(url) {
|
||||
return String(url || '').replace(/^https?:\/\//, '');
|
||||
}
|
||||
|
||||
function setVisibilityBadgeState(el, isPublic, publicLabel = 'Publiczna', privateLabel = 'Prywatna') {
|
||||
if (!el) return;
|
||||
el.classList.remove('share-state-badge--public', 'share-state-badge--private');
|
||||
el.classList.add(isPublic ? 'share-state-badge--public' : 'share-state-badge--private');
|
||||
setUiIconLabel(el, isPublic ? 'world' : 'lock', isPublic ? publicLabel : privateLabel);
|
||||
}
|
||||
|
||||
function updateShareVisibilityUI(data) {
|
||||
const shareUrl = data?.share_url || '';
|
||||
const isPublic = !!data?.is_public;
|
||||
|
||||
const shareUrlInput = document.getElementById('shareUrlInput');
|
||||
const shareUrlPreview = document.getElementById('shareUrlPreview');
|
||||
const copyBtn = document.getElementById('copyBtn');
|
||||
const toggleBtn = document.getElementById('toggleVisibilityBtn');
|
||||
const mainNote = document.getElementById('shareVisibilityNote');
|
||||
const sheetNote = document.getElementById('shareSheetVisibilityNote');
|
||||
const mainOpenBtn = document.getElementById('openShareModeBtn');
|
||||
const sheetOpenBtn = document.getElementById('openShareModeBtnSheet');
|
||||
|
||||
if (shareUrlInput) shareUrlInput.value = shareUrl;
|
||||
if (shareUrlPreview) shareUrlPreview.textContent = formatShareUrlPreview(shareUrl);
|
||||
if (copyBtn) copyBtn.disabled = false;
|
||||
if (mainOpenBtn) mainOpenBtn.href = shareUrl;
|
||||
if (sheetOpenBtn) sheetOpenBtn.href = shareUrl;
|
||||
|
||||
setVisibilityBadgeState(document.getElementById('shareVisibilityBadge'), isPublic);
|
||||
setVisibilityBadgeState(document.getElementById('shareSheetVisibilityBadge'), isPublic, 'Publiczna', 'Prywatna');
|
||||
|
||||
if (mainNote) {
|
||||
mainNote.textContent = isPublic
|
||||
? 'Lista działa publicznie i przez link udostępniania.'
|
||||
: 'Lista działa przez link udostępniania i dla zaproszonych osób.';
|
||||
}
|
||||
|
||||
if (sheetNote) {
|
||||
sheetNote.textContent = isPublic
|
||||
? 'Lista jest widoczna publicznie i nadal działa przez link.'
|
||||
: 'Lista nie jest publiczna, ale nadal działa przez link i dla zaproszonych osób.';
|
||||
}
|
||||
|
||||
if (toggleBtn) {
|
||||
setUiIconLabel(toggleBtn, isPublic ? 'eye-off' : 'world', isPublic ? 'Ustaw jako prywatną' : 'Uczyń publiczną');
|
||||
}
|
||||
}
|
||||
|
||||
function toggleVisibility(listId) {
|
||||
fetch('/toggle_visibility/' + listId, { method: 'POST' })
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
updateShareVisibilityUI(data);
|
||||
showToast(data.is_public ? 'Lista jest teraz publiczna.' : 'Lista jest teraz prywatna.', 'success');
|
||||
})
|
||||
.catch(() => {
|
||||
showToast('Nie udało się zmienić widoczności listy.', 'danger');
|
||||
const shareHeader = document.getElementById('share-header');
|
||||
const shareUrlSpan = document.getElementById('share-url');
|
||||
const copyBtn = document.getElementById('copyBtn');
|
||||
const toggleBtn = document.getElementById('toggleVisibilityBtn');
|
||||
|
||||
// URL zawsze widoczny i aktywny
|
||||
shareUrlSpan.style.display = 'inline';
|
||||
shareUrlSpan.textContent = data.share_url;
|
||||
copyBtn.disabled = false;
|
||||
|
||||
if (data.is_public) {
|
||||
shareHeader.textContent = '🔗 Udostępnij link (lista publiczna)';
|
||||
toggleBtn.innerHTML = '🙈 Ukryj listę';
|
||||
} else {
|
||||
shareHeader.textContent = '🔗 Udostępnij link (widoczna tylko przez link / uprawnienia)';
|
||||
toggleBtn.innerHTML = '🐵 Uczyń publiczną';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -448,15 +331,11 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
|
||||
|
||||
const isOwner = window.IS_OWNER === true || window.IS_OWNER === 'true';
|
||||
const isArchived = window.IS_ARCHIVED === true || window.IS_ARCHIVED === 'true';
|
||||
const rawName = String(item.name || '');
|
||||
const safeName = escapeHtml(rawName);
|
||||
const nameForEdit = JSON.stringify(rawName);
|
||||
const safeName = escapeHtml(item.name || '');
|
||||
const nameForEdit = JSON.stringify(String(item.name || ''));
|
||||
const quantity = Number.isInteger(item.quantity) ? item.quantity : parseInt(item.quantity, 10) || 1;
|
||||
const quantityValue = parseQuantityInput(item.quantity_value ?? item.quantity, quantity);
|
||||
const quantityUnit = item.quantity_unit || 'szt';
|
||||
const quantityText = item.quantity_label || quantityLabel(quantityValue, quantityUnit);
|
||||
const quantityBadge = (quantityUnit !== 'szt' || quantityValue !== 1)
|
||||
? `<span class="badge rounded-pill bg-secondary">${escapeHtml(quantityText)}</span>`
|
||||
const quantityBadge = quantity > 1
|
||||
? `<span class="badge rounded-pill bg-secondary">x${quantity}</span>`
|
||||
: '';
|
||||
|
||||
const canEditListItem = !isShare;
|
||||
@@ -484,25 +363,17 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
|
||||
|
||||
const iconBtn = 'btn btn-outline-light btn-sm shopping-action-btn';
|
||||
const wideBtn = 'btn btn-outline-light btn-sm shopping-action-btn shopping-action-btn--wide';
|
||||
const dragHandleButton = canEditListItem
|
||||
? `<button type="button" class="drag-handle" title="Przeciągnij produkt" aria-label="Przeciągnij produkt" ${isArchived ? 'disabled' : ''}>${uiIcon('arrows-sort')}</button>`
|
||||
: '';
|
||||
const itemNameHtml = canEditListItem
|
||||
? `<button type="button"
|
||||
id="name-${item.id}"
|
||||
class="shopping-item-name text-white"
|
||||
data-item-id="${item.id}"
|
||||
data-item-name=${JSON.stringify(rawName)}
|
||||
data-item-quantity="${quantityValue}"
|
||||
data-item-unit="${quantityUnit}"
|
||||
${isArchived ? 'disabled aria-disabled="true"' : 'data-item-menu-trigger="true"'}>${safeName}</button>`
|
||||
: `<span id="name-${item.id}" class="shopping-item-name text-white">${safeName}</span>`;
|
||||
let actionButtons = '';
|
||||
|
||||
if (canEditListItem) {
|
||||
const dragHandleButton = window.isSorting
|
||||
? `<button type="button" class="${iconBtn} drag-handle" title="Przesuń produkt" aria-label="Przesuń produkt" ${isArchived ? 'disabled' : ''}>☰</button>`
|
||||
: '';
|
||||
|
||||
actionButtons += `
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick='openEditItemModal(event, ${item.id}, ${JSON.stringify(String(item.name || ''))}, ${quantityValue}, ${JSON.stringify(quantityUnit)})'`} aria-label="Edytuj produkt" title="Edytuj produkt">${uiIcon('pencil')}</button>
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="deleteItem(${item.id})"`} aria-label="Usuń produkt" title="Usuń produkt">${uiIcon('trash')}</button>`;
|
||||
${dragHandleButton}
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick='openEditItemModal(event, ${item.id}, ${JSON.stringify(String(item.name || ''))}, ${quantity})'`}>✏️</button>
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="deleteItem(${item.id})"`}>🗑️</button>`;
|
||||
}
|
||||
|
||||
if (item.not_purchased) {
|
||||
@@ -510,27 +381,26 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
|
||||
<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'} aria-label="Oznacz jako niekupiony" title="Oznacz jako niekupiony">${uiIcon('alert-triangle')}</button>`;
|
||||
<button type="button" class="${iconBtn}" ${canMarkNotPurchased ? `onclick="markNotPurchasedModal(event, ${item.id})"` : 'disabled'}>⚠️</button>`;
|
||||
}
|
||||
|
||||
if (temporaryShareUndo) {
|
||||
actionButtons += `
|
||||
<button type="button" class="${iconBtn} shopping-action-btn--countdown" disabled data-countdown-for="${item.id}">${countdownSeconds}s</button>
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick='openEditItemModal(event, ${item.id}, ${nameForEdit}, ${quantityValue}, ${JSON.stringify(quantityUnit)})'`} aria-label="Edytuj produkt" title="Edytuj produkt">${uiIcon('pencil')}</button>
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="deleteItem(${item.id})"`} aria-label="Usuń produkt" title="Usuń produkt">${uiIcon('trash')}</button>`;
|
||||
} else if (canShowShareActions || (!isShare && isOwner)) {
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick='openEditItemModal(event, ${item.id}, ${nameForEdit}, ${quantity})'`}>✏️</button>
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="deleteItem(${item.id})"`}>🗑️</button>`;
|
||||
} else if (canShowShareActions) {
|
||||
actionButtons += `
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="openNoteModal(event, ${item.id})"`} aria-label="Notatka produktu" title="Notatka produktu">${uiIcon('notes')}</button>`;
|
||||
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="openNoteModal(event, ${item.id})"`}>📝</button>`;
|
||||
}
|
||||
|
||||
li.innerHTML = `
|
||||
<div class="shopping-item-main">
|
||||
${dragHandleButton}
|
||||
${checkboxHtml}
|
||||
<div class="shopping-item-content">
|
||||
<div class="shopping-item-head">
|
||||
<div class="shopping-item-text">
|
||||
${itemNameHtml}
|
||||
<span id="name-${item.id}" class="shopping-item-name text-white">${safeName}</span>
|
||||
${quantityBadge}
|
||||
${infoHtml}
|
||||
</div>
|
||||
@@ -568,6 +438,26 @@ function updateListSmoothly(newItems) {
|
||||
applyHidePurchased();
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const receiptSection = document.getElementById("receiptSection");
|
||||
const toggleBtn = document.querySelector('[data-bs-target="#receiptSection"]');
|
||||
|
||||
if (!receiptSection || !toggleBtn) return;
|
||||
|
||||
if (localStorage.getItem("receiptSectionOpen") === "true") {
|
||||
new bootstrap.Collapse(receiptSection, { toggle: true });
|
||||
}
|
||||
|
||||
receiptSection.addEventListener('shown.bs.collapse', function () {
|
||||
localStorage.setItem("receiptSectionOpen", "true");
|
||||
});
|
||||
|
||||
receiptSection.addEventListener('hidden.bs.collapse', function () {
|
||||
localStorage.setItem("receiptSectionOpen", "false");
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const toggle = document.getElementById('hidePurchasedToggle');
|
||||
if (!toggle) return;
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const editItemForm = document.getElementById('editItemForm');
|
||||
if (!editItemForm) return;
|
||||
|
||||
editItemForm.addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
const itemId = parseInt(document.getElementById('editItemId').value, 10);
|
||||
const itemName = document.getElementById('editItemName').value;
|
||||
const itemQuantity = document.getElementById('editItemQuantity').value;
|
||||
const itemUnit = document.getElementById('editItemUnit').value;
|
||||
|
||||
editItem(itemId, itemName, itemQuantity, itemUnit);
|
||||
|
||||
const modalEl = document.getElementById('editItemModal');
|
||||
const modal = bootstrap.Modal.getInstance(modalEl);
|
||||
if (modal) modal.hide();
|
||||
});
|
||||
});
|
||||
@@ -9,7 +9,7 @@ function applyFilter(){const q=(filterInput?.value||'').trim().toLowerCase();let
|
||||
filterInput?.addEventListener('input',applyFilter);applyFilter();
|
||||
selectAll?.addEventListener('change',()=>{visibleRows().forEach(tr=>{const cb=tr.querySelector('.row-check'); if(cb) cb.checked=selectAll.checked;});});
|
||||
$$('.copy-share').forEach(btn=>btn.addEventListener('click',async()=>{const url=btn.dataset.url;try{await navigator.clipboard.writeText(url);}catch{const ta=Object.assign(document.createElement('textarea'),{value:url});document.body.appendChild(ta);ta.select();document.execCommand('copy');ta.remove();}showToast('Skopiowano link udostępnienia','success');}));
|
||||
function addGlobalToken(username){if(!username) return;const exists=$(`.user-token[data-user="${username}"]`,bulkTokens);if(exists) return;const token=document.createElement('span');token.className='badge rounded-pill text-bg-secondary user-token';token.dataset.user=username;token.innerHTML=`@${username} <button type="button" class="btn btn-sm btn-link p-0 ms-1 text-white">${uiIcon('x')}</button>`;token.querySelector('button').addEventListener('click',()=>token.remove());bulkTokens.appendChild(token);}
|
||||
function addGlobalToken(username){if(!username) return;const exists=$(`.user-token[data-user="${username}"]`,bulkTokens);if(exists) return;const token=document.createElement('span');token.className='badge rounded-pill text-bg-secondary user-token';token.dataset.user=username;token.innerHTML=`@${username} <button type="button" class="btn btn-sm btn-link p-0 ms-1 text-white">✕</button>`;token.querySelector('button').addEventListener('click',()=>token.remove());bulkTokens.appendChild(token);}
|
||||
bulkInput?.addEventListener('keydown',e=>{if(e.key==='Enter'){e.preventDefault();parseUserText(bulkInput.value).forEach(addGlobalToken);bulkInput.value='';}});
|
||||
bulkInput?.addEventListener('change',()=>{parseUserText(bulkInput.value).forEach(addGlobalToken);bulkInput.value='';});
|
||||
let hintCtrl=null;
|
||||
@@ -17,6 +17,6 @@ function renderBulkHints(users){const dl=$('#userHints'); if(!dl) return; dl.inn
|
||||
async function fetchBulkHints(q=''){const normalized=String(q||'').trim().replace(/^@/,'');try{hintCtrl?.abort();hintCtrl=new AbortController();const res=await fetch(`/admin/user-suggestions?q=${encodeURIComponent(normalized)}`,{credentials:'same-origin',signal:hintCtrl.signal});if(!res.ok) return renderBulkHints([]);const data=await res.json().catch(()=>({users:[]}));renderBulkHints(data.users||[]);}catch(e){renderBulkHints([]);}}
|
||||
bulkInput?.addEventListener('focus',()=>fetchBulkHints(bulkInput.value));
|
||||
bulkInput?.addEventListener('input',()=>fetchBulkHints(bulkInput.value));
|
||||
async function bulkGrant(){const lists=selectedListIds(), users=$$('.user-token',bulkTokens).map(t=>t.dataset.user);if(!lists.length) return showToast('Zaznacz przynajmniej jedną listę','warning');if(!users.length) return showToast('Dodaj przynajmniej jednego użytkownika','warning');bulkBtn.disabled=true;bulkBtn.textContent='Pracuję…';const url=location.pathname+location.search;let ok=0,fail=0;for(const lid of lists){for(const u of users){const form=new FormData();form.set('action','grant');form.set('target_list_id',lid);form.set('grant_username',u);try{const res=await fetch(url,{method:'POST',body:form,credentials:'same-origin',headers:{'Accept':'application/json','X-Requested-With':'fetch'}});if(res.ok) ok++; else fail++;}catch{fail++;}}}bulkBtn.disabled=false;setUiIconLabel(bulkBtn,'plus','Nadaj dostęp');showToast(`Gotowe. Sukcesy: ${ok}${fail?`, błędy: ${fail}`:''}`,fail?'danger':'success');if(ok) location.reload();}
|
||||
async function bulkGrant(){const lists=selectedListIds(), users=$$('.user-token',bulkTokens).map(t=>t.dataset.user);if(!lists.length) return showToast('Zaznacz przynajmniej jedną listę','warning');if(!users.length) return showToast('Dodaj przynajmniej jednego użytkownika','warning');bulkBtn.disabled=true;bulkBtn.textContent='Pracuję…';const url=location.pathname+location.search;let ok=0,fail=0;for(const lid of lists){for(const u of users){const form=new FormData();form.set('action','grant');form.set('target_list_id',lid);form.set('grant_username',u);try{const res=await fetch(url,{method:'POST',body:form,credentials:'same-origin',headers:{'Accept':'application/json','X-Requested-With':'fetch'}});if(res.ok) ok++; else fail++;}catch{fail++;}}}bulkBtn.disabled=false;bulkBtn.textContent='➕ Nadaj dostęp';showToast(`Gotowe. Sukcesy: ${ok}${fail?`, błędy: ${fail}`:''}`,fail?'danger':'success');if(ok) location.reload();}
|
||||
bulkBtn?.addEventListener('click',bulkGrant);
|
||||
})();
|
||||
@@ -1,11 +1,4 @@
|
||||
const socket = io({
|
||||
reconnection: true,
|
||||
reconnectionAttempts: Infinity,
|
||||
reconnectionDelay: 350,
|
||||
reconnectionDelayMax: 2000,
|
||||
randomizationFactor: 0.2,
|
||||
timeout: 5000
|
||||
});
|
||||
const socket = io();
|
||||
|
||||
/*──────────────── placeholder pustej listy ────────────────*/
|
||||
function toggleEmptyPlaceholder() {
|
||||
@@ -28,20 +21,7 @@ function toggleEmptyPlaceholder() {
|
||||
}
|
||||
|
||||
function setupList(listId, username) {
|
||||
// Ustaw dane pokoju przed pierwszym emit — dzięki temu reconnect, który trafi
|
||||
// dokładnie w moment inicjalizacji widoku, nadal wie do jakiego pokoju wrócić.
|
||||
window.LIST_ID = listId;
|
||||
window.usernameForReconnect = username;
|
||||
window.CURRENT_LIST_USERNAME = username;
|
||||
|
||||
// Jedno miejsce odpowiada za dołączanie do pokoju. Dzięki temu setupList()
|
||||
// nie ściga się z eventem `connect` i nie wysyła podwójnego join_list.
|
||||
if (typeof window.ensureCurrentListJoined === 'function') {
|
||||
window.ensureCurrentListJoined();
|
||||
}
|
||||
if (typeof window.refreshListSocketStatus === 'function') {
|
||||
window.refreshListSocketStatus();
|
||||
}
|
||||
socket.emit('join_list', { room: listId, username: username });
|
||||
|
||||
const newItemInput = document.getElementById('newItem');
|
||||
|
||||
@@ -101,8 +81,11 @@ function setupList(listId, username) {
|
||||
if (li) {
|
||||
const id = parseInt(li.id.replace('item-', ''), 10);
|
||||
|
||||
const intendedChecked = e.target.checked;
|
||||
const eventName = intendedChecked ? 'check_item' : 'uncheck_item';
|
||||
if (e.target.checked) {
|
||||
socket.emit('check_item', { item_id: id });
|
||||
} else {
|
||||
socket.emit('uncheck_item', { item_id: id });
|
||||
}
|
||||
|
||||
e.target.disabled = true;
|
||||
li.classList.add('opacity-50', 'is-pending');
|
||||
@@ -115,25 +98,6 @@ function setupList(listId, username) {
|
||||
spinner.setAttribute('aria-hidden', 'true');
|
||||
li.appendChild(spinner);
|
||||
}
|
||||
|
||||
// ACK od serwera zabezpiecza przypadek, w którym po wznowieniu karty
|
||||
// transport wygląda na aktywny, ale faktycznie już nie działa. Nie czekamy wtedy
|
||||
// bez końca z zablokowanym checkboxem.
|
||||
socket.timeout(7000).emit(eventName, { item_id: id }, (err, response) => {
|
||||
if (!err && response && response.ok) {
|
||||
updateItemState(id, intendedChecked);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!err && response && response.ok === false) {
|
||||
socket.emit('request_full_list', { list_id: window.LIST_ID });
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof window.recoverListSocket === 'function') {
|
||||
window.recoverListSocket();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -149,7 +113,7 @@ function setupList(listId, username) {
|
||||
socket.on('expense_added', data => {
|
||||
const badgeEl = document.getElementById('total-expense1');
|
||||
if (badgeEl) {
|
||||
badgeEl.innerHTML = `${uiIcon('coins')} ${formatCurrencyAmount(data.total)}`;
|
||||
badgeEl.innerHTML = `💸 ${data.total.toFixed(2)} PLN`;
|
||||
badgeEl.classList.remove('bg-secondary');
|
||||
badgeEl.classList.add('bg-success');
|
||||
badgeEl.style.display = '';
|
||||
@@ -157,10 +121,10 @@ function setupList(listId, username) {
|
||||
|
||||
const summaryEl = document.getElementById('total-expense2');
|
||||
if (summaryEl) {
|
||||
summaryEl.innerHTML = `<b>${uiIcon('coins')} Łącznie wydano:</b> ${formatCurrencyAmount(data.total)}`;
|
||||
summaryEl.innerHTML = `<b>💸 Łącznie wydano:</b> ${data.total.toFixed(2)} PLN`;
|
||||
}
|
||||
|
||||
showToast(`Dodano wydatek: ${formatCurrencyAmount(data.amount)}`, 'info');
|
||||
showToast(`Dodano wydatek: ${data.amount.toFixed(2)} PLN`, 'info');
|
||||
});
|
||||
|
||||
|
||||
@@ -175,13 +139,6 @@ function setupList(listId, username) {
|
||||
note: ''
|
||||
};
|
||||
|
||||
// Note: store newly added items locally so later edits do not depend on a full page refresh.
|
||||
if (Array.isArray(window.currentItems)) {
|
||||
window.currentItems.push(item);
|
||||
} else {
|
||||
window.currentItems = [item];
|
||||
}
|
||||
|
||||
const isOwnFreshShareItem = Boolean(
|
||||
window.IS_SHARE &&
|
||||
data.added_by &&
|
||||
@@ -259,45 +216,29 @@ function setupList(listId, username) {
|
||||
});
|
||||
|
||||
socket.on('item_edited', data => {
|
||||
const itemId = Number(data.item_id);
|
||||
const oldItem = document.getElementById(`item-${itemId}`);
|
||||
const currentItems = Array.isArray(window.currentItems) ? window.currentItems : [];
|
||||
const idx = currentItems.findIndex(item => Number(item.id) === itemId);
|
||||
const cachedItem = idx !== -1 ? currentItems[idx] : {};
|
||||
|
||||
// Note: keep the edited item visible immediately, even when the local list cache is stale.
|
||||
const updatedItem = {
|
||||
...cachedItem,
|
||||
id: itemId,
|
||||
name: data.new_name,
|
||||
quantity: data.new_quantity,
|
||||
quantity_value: data.quantity_value ?? data.new_quantity,
|
||||
quantity_unit: data.quantity_unit || 'szt',
|
||||
quantity_label: data.quantity_label || quantityLabel(data.quantity_value ?? data.new_quantity, data.quantity_unit || 'szt'),
|
||||
purchased: oldItem ? oldItem.classList.contains('bg-success') : !!cachedItem.purchased,
|
||||
not_purchased: oldItem ? oldItem.classList.contains('bg-warning') : !!cachedItem.not_purchased,
|
||||
not_purchased_reason: cachedItem.not_purchased_reason || '',
|
||||
note: cachedItem.note || ''
|
||||
};
|
||||
|
||||
const idx = window.currentItems.findIndex(i => i.id === data.item_id);
|
||||
if (idx !== -1) {
|
||||
currentItems[idx] = updatedItem;
|
||||
window.currentItems = currentItems;
|
||||
window.currentItems[idx].name = data.new_name;
|
||||
window.currentItems[idx].quantity = data.new_quantity;
|
||||
|
||||
const newItem = renderItem(window.currentItems[idx], window.IS_SHARE);
|
||||
const oldItem = document.getElementById(`item-${data.item_id}`);
|
||||
if (oldItem && newItem) {
|
||||
oldItem.replaceWith(newItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (oldItem) {
|
||||
oldItem.replaceWith(renderItem(updatedItem, window.IS_SHARE));
|
||||
} else if (window.LIST_ID) {
|
||||
socket.emit('request_full_list', { list_id: window.LIST_ID });
|
||||
}
|
||||
|
||||
showToast(`Zaktualizowano produkt: ${data.new_name} (${data.quantity_label || quantityLabel(data.quantity_value ?? data.new_quantity, data.quantity_unit || 'szt')})`, 'success');
|
||||
showToast(`Zaktualizowano produkt: ${data.new_name} (x${data.new_quantity})`, 'success');
|
||||
|
||||
updateProgressBar();
|
||||
toggleEmptyPlaceholder();
|
||||
applyHidePurchased();
|
||||
});
|
||||
|
||||
// --- WAŻNE: zapisz dane do reconnect ---
|
||||
window.LIST_ID = listId;
|
||||
window.usernameForReconnect = username;
|
||||
window.CURRENT_LIST_USERNAME = username;
|
||||
|
||||
}
|
||||
|
||||
function unmarkNotPurchased(itemId) {
|
||||
|
||||
@@ -9,24 +9,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
return str?.trim().toLowerCase() || '';
|
||||
}
|
||||
|
||||
function readQuantity(qty, fallback = 1) {
|
||||
const parsed = parseFloat(String(qty?.value ?? fallback).replace(',', '.'));
|
||||
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
||||
}
|
||||
|
||||
function makeUnitSelect() {
|
||||
const unit = document.createElement('select');
|
||||
unit.className = 'form-select form-select-sm bg-dark text-white border-secondary';
|
||||
unit.style.width = '78px';
|
||||
['szt', 'kg', 'g', 'l', 'ml', 'opak.'].forEach(value => {
|
||||
const option = document.createElement('option');
|
||||
option.value = value;
|
||||
option.textContent = value;
|
||||
unit.appendChild(option);
|
||||
});
|
||||
return unit;
|
||||
}
|
||||
|
||||
let sortMode = 'popularity';
|
||||
let limit = 25;
|
||||
let offset = 0;
|
||||
@@ -123,61 +105,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}
|
||||
|
||||
function getAlreadyAddedProducts() {
|
||||
const map = new Map();
|
||||
document.querySelectorAll('#items li[id^="item-"]').forEach(li => {
|
||||
if (!li.dataset.name) return;
|
||||
const nameBtn = li.querySelector('[data-item-name]');
|
||||
const name = nameBtn?.dataset.itemName || li.dataset.name || '';
|
||||
map.set(normalize(li.dataset.name), {
|
||||
id: parseInt(li.id.replace('item-', ''), 10),
|
||||
name: name,
|
||||
quantityValue: readQuantity({ value: nameBtn?.dataset.itemQuantity || 1 }),
|
||||
unit: nameBtn?.dataset.itemUnit || 'szt'
|
||||
});
|
||||
const set = new Set();
|
||||
document.querySelectorAll('#items li').forEach(li => {
|
||||
if (li.dataset.name) {
|
||||
set.add(normalize(li.dataset.name));
|
||||
}
|
||||
});
|
||||
return map;
|
||||
}
|
||||
|
||||
function appendQuantityControls(li, initialValue = 1, initialUnit = 'szt') {
|
||||
const qtyWrapper = document.createElement('div');
|
||||
qtyWrapper.className = 'd-flex align-items-center ms-2 quantity-controls';
|
||||
|
||||
const minusBtn = document.createElement('button');
|
||||
minusBtn.type = 'button';
|
||||
minusBtn.className = 'btn btn-outline-light btn-sm px-2';
|
||||
minusBtn.textContent = '−';
|
||||
|
||||
const qty = document.createElement('input');
|
||||
qty.type = 'number';
|
||||
qty.min = 0.001;
|
||||
qty.step = 1;
|
||||
qty.value = initialValue || 1;
|
||||
qty.className = 'form-control text-center p-1 rounded';
|
||||
qty.style.width = '62px';
|
||||
qty.style.margin = '0 2px';
|
||||
qty.title = 'Ilość / waga / objętość';
|
||||
setupQuantityStepper(qty);
|
||||
|
||||
const plusBtn = document.createElement('button');
|
||||
plusBtn.type = 'button';
|
||||
plusBtn.className = 'btn btn-outline-light btn-sm px-2';
|
||||
plusBtn.textContent = '+';
|
||||
|
||||
const unit = makeUnitSelect();
|
||||
unit.value = initialUnit || 'szt';
|
||||
|
||||
minusBtn.onclick = () => {
|
||||
qty.value = Math.max(0.001, readQuantity(qty) - 1);
|
||||
syncQuantityStepBase(qty);
|
||||
};
|
||||
plusBtn.onclick = () => {
|
||||
qty.value = readQuantity(qty) + 1;
|
||||
syncQuantityStepBase(qty);
|
||||
};
|
||||
|
||||
qtyWrapper.append(minusBtn, qty, plusBtn, unit);
|
||||
li.appendChild(qtyWrapper);
|
||||
return { qty, unit, qtyWrapper };
|
||||
return set;
|
||||
}
|
||||
|
||||
function renderProducts(products) {
|
||||
@@ -201,12 +135,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
if (addedProducts.has(normName)) {
|
||||
const nameSpan = document.createElement('span');
|
||||
nameSpan.textContent = name;
|
||||
nameSpan.style.flex = '1 1 auto';
|
||||
li.appendChild(nameSpan);
|
||||
li.classList.add('opacity-50', 'border-success');
|
||||
|
||||
li.classList.add('opacity-50');
|
||||
const badge = document.createElement('span');
|
||||
badge.className = 'badge bg-success ms-2';
|
||||
badge.className = 'badge bg-success ms-auto';
|
||||
badge.textContent = 'Dodano';
|
||||
li.appendChild(badge);
|
||||
} else {
|
||||
@@ -225,16 +157,12 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const qty = document.createElement('input');
|
||||
qty.type = 'number';
|
||||
qty.min = 0.001;
|
||||
qty.step = 1;
|
||||
qty.min = 1;
|
||||
qty.value = 1;
|
||||
qty.className = 'form-control text-center p-1 rounded';
|
||||
qty.style.width = '50px';
|
||||
qty.style.margin = '0 2px';
|
||||
qty.title = 'Ilość / waga / objętość';
|
||||
setupQuantityStepper(qty);
|
||||
|
||||
const unit = makeUnitSelect();
|
||||
qty.title = 'Ilość';
|
||||
|
||||
const plusBtn = document.createElement('button');
|
||||
plusBtn.type = 'button';
|
||||
@@ -242,28 +170,20 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
plusBtn.textContent = '+';
|
||||
|
||||
minusBtn.onclick = () => {
|
||||
qty.value = Math.max(0.001, readQuantity(qty) - 1);
|
||||
syncQuantityStepBase(qty);
|
||||
qty.value = Math.max(1, parseInt(qty.value) - 1);
|
||||
};
|
||||
plusBtn.onclick = () => {
|
||||
qty.value = readQuantity(qty) + 1;
|
||||
syncQuantityStepBase(qty);
|
||||
qty.value = parseInt(qty.value) + 1;
|
||||
};
|
||||
|
||||
qtyWrapper.append(minusBtn, qty, plusBtn, unit);
|
||||
qtyWrapper.append(minusBtn, qty, plusBtn);
|
||||
|
||||
const btn = document.createElement('button');
|
||||
btn.className = 'btn btn-sm btn-primary ms-4';
|
||||
btn.textContent = '+';
|
||||
btn.onclick = () => {
|
||||
const quantityValue = readQuantity(qty);
|
||||
socket.emit('add_item', {
|
||||
list_id: LIST_ID,
|
||||
name: name,
|
||||
quantity: Math.max(1, Math.round(quantityValue)),
|
||||
quantity_value: quantityValue,
|
||||
quantity_unit: unit.value
|
||||
});
|
||||
const quantity = parseInt(qty.value) || 1;
|
||||
socket.emit('add_item', { list_id: LIST_ID, name: name, quantity: quantity });
|
||||
};
|
||||
|
||||
li.append(qtyWrapper, btn);
|
||||
@@ -306,7 +226,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const undoBtn = document.createElement('button');
|
||||
undoBtn.className = 'btn btn-outline-warning';
|
||||
setUiIconLabel(undoBtn, 'refresh', 'Cofnij');
|
||||
undoBtn.innerHTML = '⟳ Cofnij';
|
||||
|
||||
const timerBtn = document.createElement('button');
|
||||
timerBtn.className = 'btn btn-outline-secondary disabled';
|
||||
@@ -346,16 +266,12 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const qty = document.createElement('input');
|
||||
qty.type = 'number';
|
||||
qty.min = 0.001;
|
||||
qty.step = 1;
|
||||
qty.min = 1;
|
||||
qty.value = 1;
|
||||
qty.className = 'form-control text-center p-1 rounded';
|
||||
qty.style.width = '50px';
|
||||
qty.style.margin = '0 2px';
|
||||
qty.title = 'Ilość / waga / objętość';
|
||||
setupQuantityStepper(qty);
|
||||
|
||||
const unit = makeUnitSelect();
|
||||
qty.title = 'Ilość';
|
||||
|
||||
const plusBtn = document.createElement('button');
|
||||
plusBtn.type = 'button';
|
||||
@@ -363,28 +279,24 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
plusBtn.textContent = '+';
|
||||
|
||||
minusBtn.onclick = () => {
|
||||
qty.value = Math.max(0.001, readQuantity(qty) - 1);
|
||||
syncQuantityStepBase(qty);
|
||||
qty.value = Math.max(1, parseInt(qty.value) - 1);
|
||||
};
|
||||
plusBtn.onclick = () => {
|
||||
qty.value = readQuantity(qty) + 1;
|
||||
syncQuantityStepBase(qty);
|
||||
qty.value = parseInt(qty.value) + 1;
|
||||
};
|
||||
|
||||
qtyWrapper.append(minusBtn, qty, plusBtn, unit);
|
||||
qtyWrapper.append(minusBtn, qty, plusBtn);
|
||||
li.appendChild(qtyWrapper);
|
||||
|
||||
const addBtn = document.createElement('button');
|
||||
addBtn.className = 'btn btn-sm btn-primary ms-4';
|
||||
addBtn.textContent = '+';
|
||||
addBtn.onclick = () => {
|
||||
const quantityValue = readQuantity(qty);
|
||||
const quantity = parseInt(qty.value) || 1;
|
||||
socket.emit('add_item', {
|
||||
list_id: LIST_ID,
|
||||
name: data.name,
|
||||
quantity: Math.max(1, Math.round(quantityValue)),
|
||||
quantity_value: quantityValue,
|
||||
quantity_unit: unit.value
|
||||
quantity: quantity
|
||||
});
|
||||
};
|
||||
li.appendChild(addBtn);
|
||||
|
||||
@@ -3,9 +3,9 @@ window.currentItemId = window.currentItemId ?? null;
|
||||
window.openNoteModal = function (event, itemId) {
|
||||
event.stopPropagation();
|
||||
window.currentItemId = itemId;
|
||||
const noteEl = document.querySelector(`#info-${itemId} .text-danger b`);
|
||||
const noteEl = document.querySelector(`#item-${itemId} small.text-danger`);
|
||||
document.getElementById('noteText').value = noteEl
|
||||
? noteEl.innerText.trim()
|
||||
? noteEl.innerText.replace(/\[|\]|Powód:/g, "").trim()
|
||||
: "";
|
||||
const modal = new bootstrap.Modal(document.getElementById('noteModal'));
|
||||
modal.show();
|
||||
|
||||