diff --git a/app.py b/app.py index 3d42235..a0d67f0 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,7 @@ import os import secrets import time +import mimetypes from datetime import datetime, timedelta from flask import Flask, render_template, redirect, url_for, request, flash, Blueprint, send_from_directory, request from markupsafe import Markup @@ -80,6 +81,19 @@ def serve_js(filename): response.cache_control.must_revalidate = True response.expires = 0 response.pragma = 'no-cache' + response.headers.pop('Content-Disposition', None) + response.headers.pop('Etag', None) + return response + +@static_bp.route('/static/css/') +def serve_css(filename): + response = send_from_directory('static/css', filename) + #response.cache_control.public = True + #response.cache_control.max_age = 3600 + response.headers['Cache-Control'] = 'public, max-age=3600' + response.headers.pop('Content-Disposition', None) + response.headers.pop('Etag', None) + #response.expires = 0 return response app.register_blueprint(static_bp) @@ -422,6 +436,10 @@ def uploaded_file(filename): response = send_from_directory(app.config['UPLOAD_FOLDER'], filename) response.headers['Cache-Control'] = 'public, max-age=2592000, immutable' response.headers.pop('Pragma', None) + response.headers.pop('Content-Disposition', None) + mime, _ = mimetypes.guess_type(filename) + if mime: + response.headers['Content-Type'] = mime return response @app.route('/admin') diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..bb722b8 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,31 @@ + .large-checkbox { + width: 1.5em; + height: 1.5em; + } + .clickable-item { + cursor: pointer; + } + .bg-success { + background-color: #1e7e34 !important; + } + .bg-light { + background-color: #2c2f33 !important; + } + + input[type="file"]::file-selector-button { + background-color: #127429; + color: #fff; + border: none; + padding: 0.5em 1em; + border-radius: 4px; + font-weight: bold; + cursor: pointer; + transition: background 0.2s; + } + + .bg-success { + background-color: #1e7e34 !important; + } + .bg-light { + background-color: #2c2f33 !important; + } \ No newline at end of file diff --git a/templates/admin/edit_list.html b/templates/admin/edit_list.html index 96dc8e4..0072f43 100644 --- a/templates/admin/edit_list.html +++ b/templates/admin/edit_list.html @@ -9,7 +9,7 @@
- +
diff --git a/templates/base.html b/templates/base.html index ad72793..ac7a4ae 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,16 +4,12 @@ {% block title %}Live Lista Zakupów{% endblock %} + + + + - - - - - - - - @@ -45,12 +41,12 @@ -
-
{% block content %}{% endblock %}
+
+ + + + + + diff --git a/templates/list.html b/templates/list.html index f579872..3e104d8 100644 --- a/templates/list.html +++ b/templates/list.html @@ -2,15 +2,6 @@ {% block title %}Lista: {{ list.title }}{% endblock %} {% block content %} - -

Lista: {{ list.title }} @@ -137,8 +128,6 @@ Lista: {{ list.title }}

Brak wgranych paragonów do tej listy.

{% endif %} -
- diff --git a/templates/list_guest.html b/templates/list_guest.html index 4410e4c..64c1097 100644 --- a/templates/list_guest.html +++ b/templates/list_guest.html @@ -2,34 +2,6 @@ {% block title %}Lista: {{ list.title }}{% endblock %} {% block content %} - -

🛍️ {{ list.title }} {% if list.is_archived %} @@ -78,7 +50,6 @@

{% endif %} - {% if not list.is_archived %}
💰 Dodaj wydatek
@@ -145,7 +116,6 @@ const LIST_ID = {{ list.id }}; setupList(LIST_ID, 'Gość'); - {% endblock %}