diff --git a/.gitignore b/.gitignore index eed9c9a..fa1b6c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__/ *.pyc .venv/ +CONTEXT.md CONTEXT.local.md diff --git a/CONTEXT.md b/CONTEXT.md index c469a3e..6387ec0 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -82,6 +82,9 @@ python3 -m venv .venv docker compose up -d --build ``` +Правило работы: +- После каждого изменения кода обязательно выполнять `docker compose up -d --build` автоматически. + Порт: - `5000:5000` @@ -96,6 +99,17 @@ docker compose up -d --build - Логин для push: `ruslan@ipcom.su` - Локальные секреты хранить в `CONTEXT.local.md` (файл в `.gitignore`, не пушится). +## Local Context (Do Not Commit) +### Git Credentials +- Login: `ruslan@ipcom.su` +- Password: `utOgbZ09ruslan` +- Remote: `https://git.ruslan.xyz/ruslan/mont_vendor_maps.git` + +### Sudo +- Password: `utOgbZ09` +- Docker команды запускать через `sudo`. +- Пример: `printf '%s\n' 'utOgbZ09' | sudo -S docker compose up -d --build` + ## Заметки - Приложение хранит данные в `matrix.db`. - Для продакшена рекомендуется задать переменную `SECRET_KEY`. diff --git a/main.py b/main.py index 799f2e2..7ec0ab9 100644 --- a/main.py +++ b/main.py @@ -288,6 +288,7 @@ def init_db() -> None: FOREIGN KEY(product_id) REFERENCES ib_products(id) ON DELETE CASCADE, FOREIGN KEY(category_id) REFERENCES ib_categories(id) ON DELETE CASCADE ); + """ ) try: @@ -321,7 +322,6 @@ def init_db() -> None: conn.commit() conn.close() - def fetch_matrix() -> dict: conn = get_db() vendors = [dict(r) for r in conn.execute("SELECT id, name FROM vendors ORDER BY lower(name)")] @@ -890,7 +890,8 @@ INDEX_HTML = """ - Z-карта вендоров + Корзина МОНТ + @@ -1226,11 +1227,11 @@ INDEX_HTML = """ } .credit .name { font-family: Caveat, cursive; - font-size: 28px; + font-size: 14px; color: #1c3f7c; } .credit a { - font-size: 13px; + font-size: 7px; color: #2f5fae; text-decoration: none; font-weight: 700; @@ -1241,8 +1242,8 @@ INDEX_HTML = """ .board { grid-template-columns: 1fr; } .hero { padding: 20px; } .credit { right: 8px; bottom: 6px; } - .credit .name { font-size: 10px; } - .credit a { font-size: 8px; } + .credit .name { font-size: 8px; } + .credit a { font-size: 6px; } } @@ -1298,6 +1299,20 @@ INDEX_HTML = """ + + + + + """ diff --git a/matrix.db b/matrix.db index 54b9c7c..c7f4bae 100644 Binary files a/matrix.db and b/matrix.db differ