poprawka w ladowaniu bibliotek

This commit is contained in:
Mateusz Gruszczyński
2025-08-14 16:25:21 +02:00
parent 840c466b0c
commit 97cebbdd49

View File

@@ -6,18 +6,28 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Live Lista Zakupów{% endblock %}</title>
<link rel="icon" type="image/svg+xml" href="{{ url_for('favicon') }}">
{% if not is_blocked %}
{# --- Style CSS ładowane tylko dla niezablokowanych --- #}
{% if not is_blocked %}
<link href="{{ url_for('static_bp.serve_css', filename='style.css') }}" rel="stylesheet">
<link href="{{ url_for('static_bp.serve_css_lib', filename='glightbox.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static_bp.serve_css_lib', filename='sort_table.min.css') }}" rel="stylesheet">
{% endif %}
<link href="{{ url_for('static_bp.serve_css_lib', filename='bootstrap.min.css') }}" rel="stylesheet">
{% if '/admin/receipts' in request.path or '/edit_my_list' in request.path %}
{% endif %}
{# --- Bootstrap zawsze --- #}
<link href="{{ url_for('static_bp.serve_css_lib', filename='bootstrap.min.css') }}" rel="stylesheet">
{# --- Cropper CSS tylko dla wybranych podstron --- #}
{% set substrings_cropper = ['/admin/receipts', '/edit_my_list'] %}
{% if substrings_cropper | select("in", request.path) | list | length > 0 %}
<link href="{{ url_for('static_bp.serve_css_lib', filename='cropper.min.css') }}" rel="stylesheet">
{% endif %}
{% if '/edit_my_list' or '/admin/edit_list' in request.path or '/admin/mass_edit_categories' %}
{% endif %}
{# --- Tom Select CSS tylko dla wybranych podstron --- #}
{% set substrings_tomselect = ['/edit_my_list', '/admin/edit_list', '/admin/mass_edit_categories'] %}
{% if substrings_tomselect | select("in", request.path) | list | length > 0 %}
<link href="{{ url_for('static_bp.serve_css_lib', filename='tom-select.bootstrap5.min.css') }}" rel="stylesheet">
{% endif %}
{% endif %}
</head>
@@ -103,10 +113,14 @@
});
</script>
{% if '/admin/receipts' in request.path or '/edit_my_list' in request.path %}
{% set substrings = ['/admin/receipts', '/edit_my_list'] %}
{% if substrings | select("in", request.path) | list | length > 0 %}
<script src="{{ url_for('static_bp.serve_js_lib', filename='cropper.min.js') }}"></script>
{% endif %}
{% if '/edit_my_list' or '/admin/edit_list' or '/admin/mass_edit_categories' in request.path %}
{% set substrings = ['/edit_my_list', '/admin/edit_list', '/admin/mass_edit_categories'] %}
{% if substrings | select("in", request.path) | list | length > 0 %}
<script src="{{ url_for('static_bp.serve_js_lib', filename='tom-select.complete.min.js') }}"></script>
{% endif %}