logo w navbarze lub tekst

This commit is contained in:
Mateusz Gruszczyński
2025-08-28 11:28:22 +02:00
parent 2186c81264
commit b7ab11d124
4 changed files with 119 additions and 38 deletions

View File

@@ -76,40 +76,81 @@
</div>
</div>
<div class="mb-4">
<h6 class="text-muted mb-2">Branding</h6>
<div class="row g-3 align-items-end">
<!-- Logo -->
<div class="col-md-6">
<label for="logo_url" class="form-label">Logo (adres URL PNG/SVG)</label>
<input type="text" class="form-control" id="logo_url" name="logo_url"
value="{{ settings.logo_url if settings else '' }}" placeholder="https://example.com/logo.png">
<div class="form-text">Najlepiej transparentne, do 60px wysokości.</div>
<!-- SEKCJA: Branding -->
<div class="card shadow-sm mb-4">
<div class="card-header bg-secondary text-white d-flex align-items-center justify-content-between gap-2">
<h3 class="card-title mb-0">Branding</h3>
<small class="opacity-75">Logo i tytuły wyświetlane w menu i stopce</small>
</div>
<div class="card-body">
<!-- Wspólne zasoby: logo + tytuł serwisu -->
<div class="row g-3 align-items-end">
<div class="col-md-6">
<label for="logo_url" class="form-label">Logo (URL PNG/SVG)</label>
<input type="text" class="form-control" id="logo_url" name="logo_url"
value="{{ settings.logo_url if settings else '' }}" placeholder="https://example.com/logo.svg">
<div class="form-text">Transparentne, do ~60px wysokości.</div>
{% if settings and settings.logo_url %}
<div class="mt-2">
<img src="{{ settings.logo_url }}" alt="Logo preview" style="max-height:50px">
</div>
{% endif %}
</div>
<div class="col-md-6">
<label for="site_title" class="form-label">Tytuł serwisu</label>
<input type="text" class="form-control" id="site_title" name="site_title"
value="{{ settings.site_title if settings else '' }}" placeholder="Np. Zbiórki unitraklub.pl">
</div>
</div>
<!-- Tekst -->
<div class="col-md-6">
<label for="site_title" class="form-label">Tytuł w navbarze</label>
<input type="text" class="form-control" id="site_title" name="site_title"
value="{{ settings.site_title if settings else '' }}" placeholder="Np. Zbiórki unitraklub.pl">
<hr class="my-4">
<!-- NAVBAR -->
<div class="row g-3">
<div class="col-md-6">
<h6 class="mb-2">Menu (navbar)</h6>
<div class="form-check">
<input class="form-check-input" type="radio" name="navbar_brand_mode" id="navbar_mode_logo" value="logo"
{% if settings and settings.navbar_brand_mode=='logo' or (settings and settings.show_logo_in_navbar)
%}checked{% endif %}>
<label class="form-check-label" for="navbar_mode_logo">Pokaż logo</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="navbar_brand_mode" id="navbar_mode_text" value="text"
{% if not settings or (settings and settings.navbar_brand_mode !='logo' and not
settings.show_logo_in_navbar) %}checked{% endif %}>
<label class="form-check-label" for="navbar_mode_text">Pokaż tekst</label>
</div>
<div class="form-text mt-1">Jeśli wybierzesz logo, użyjemy adresu z pola "Tytuł serwisu".</div>
</div>
<!-- STOPKA -->
<div class="col-md-6">
<h6 class="mb-2">Stopka</h6>
<div class="form-check">
<input class="form-check-input" type="radio" name="footer_brand_mode" id="footer_mode_logo" value="logo"
{% if settings and settings.footer_brand_mode=='logo' %}checked{% endif %}>
<label class="form-check-label" for="footer_mode_logo">Logo</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="footer_brand_mode" id="footer_mode_text" value="text"
{% if not settings or (settings and settings.footer_brand_mode !='logo' ) %}checked{% endif %}>
<label class="form-check-label" for="footer_mode_text">Tekst</label>
</div>
<label for="footer_text" class="form-label mt-2">Tekst w stopce (gdy wybrano „Tekst”)</label>
<input type="text" class="form-control" id="footer_text" name="footer_text"
value="{{ settings.footer_text if settings and settings.footer_text else '' }}"
placeholder="Np. © {{ now().year if now else '2025' }} Zbiórki">
<div class="form-text">Pozostaw pusty, by użyć domyślnego.</div>
</div>
</div>
</div>
<!-- Checkbox: logo w navbarze -->
<div class="form-check mt-3">
<input class="form-check-input" type="checkbox" id="show_logo_in_navbar" name="show_logo_in_navbar" {% if
settings and settings.show_logo_in_navbar %}checked{% endif %}>
<label class="form-check-label" for="show_logo_in_navbar">Wyświetlaj logo w navbarze</label>
</div>
{% if settings and settings.logo_url %}
<div class="mt-3">
<span class="form-text d-block mb-1">Podgląd logo:</span>
<img src="{{ settings.logo_url }}" alt="Logo preview" style="max-height:50px;">
</div>
{% endif %}
</div>
<!-- CTA -->
<div class="d-flex justify-content-between">
<a href="{{ url_for('admin_dashboard') }}" class="btn btn-outline-light border">Powrót</a>