From 997009d88c81881b8928cbbbe63def5116e6e5cd Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Wed, 11 Mar 2026 07:29:06 +0100 Subject: [PATCH] fix: move GBP connection status to top of page with action buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved the OAuth connection status banner from the middle of the page to directly below the header for immediate visibility. Added direct link buttons to /konto/integracje for each state: "Zarządzaj" (active), "Połącz ponownie" (expired), "Połącz konto" (not connected). Co-Authored-By: Claude Opus 4.6 --- templates/gbp_audit.html | 99 ++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 59 deletions(-) diff --git a/templates/gbp_audit.html b/templates/gbp_audit.html index 86a8168..0faedd9 100644 --- a/templates/gbp_audit.html +++ b/templates/gbp_audit.html @@ -961,6 +961,46 @@ +{# GBP Console Connection Status — at the top for visibility #} +{% if gbp_connection and gbp_connection.connected %} + {% if gbp_connection.is_active and not gbp_connection.is_expired %} +
+ +
+ Konsola Google Business Profile połączona +

+ Dostępne są pełne dane: wyświetlenia, wyszukiwania, kliknięcia i interakcje klientów. + {% if gbp_connection.created_at %}Połączone od {{ gbp_connection.created_at.strftime('%d.%m.%Y') }}.{% endif %} +

+
+ Zarządzaj +
+ {% else %} +
+ +
+ Połączenie z konsolą GBP wygasło +

+ Autoryzacja Google wygasła{% if gbp_connection.expires_at %} {{ gbp_connection.expires_at.strftime('%d.%m.%Y') }}{% endif %}. + Dane audytu pochodzą z publicznego API. Połącz ponownie, aby uzyskać pełne statystyki. +

+
+ Połącz ponownie +
+ {% endif %} +{% else %} +
+ +
+ Konsola Google Business Profile niepołączona +

+ Dane audytu pochodzą wyłącznie z publicznego API Google Places. Po połączeniu konta będą dostępne dodatkowe statystyki: wyświetlenia w Google, kliknięcia, połączenia telefoniczne i nawigacje. +

+
+ Połącz konto +
+{% endif %} + {% if audit %} {# Unified 5-level color scale: 0-29 red, 30-49 orange, 50-69 amber, 70-89 lime, 90-100 green #} @@ -1988,65 +2028,6 @@ {% endif %} -{# GBP Console Connection Status #} -
-

- - - - Połączenie z konsolą Google Business Profile -

- - {% if gbp_connection and gbp_connection.connected %} - {% if gbp_connection.is_active and not gbp_connection.is_expired %} - {# Active and valid connection #} -
- -
- Połączone -

- Konsola GBP jest aktywna. Dostępne są dane o wyświetleniach, wyszukiwaniach i interakcjach klientów. -

-
-
- {% elif gbp_connection.is_expired or not gbp_connection.is_active %} - {# Expired or inactive connection #} -
- -
- Połączenie wygasło -

- Autoryzacja Google wygasła{% if gbp_connection.expires_at %} ({{ gbp_connection.expires_at.strftime('%d.%m.%Y') }}){% endif %}. - {% if gbp_connection.has_refresh_token %} - Token odświeżający jest dostępny, ale wymaga ponownej autoryzacji. - {% endif %} - Właściciel firmy powinien ponownie połączyć konto w panelu Konto → Integracje. -

-
-
- {% endif %} - -
- Połączone od: {{ gbp_connection.created_at.strftime('%d.%m.%Y') if gbp_connection.created_at else '—' }} - {% if gbp_connection.has_location %} · Lokalizacja GBP skonfigurowana{% endif %} -
- {% else %} - {# No connection at all #} -
- -
- Brak połączenia -

- Konsola Google Business Profile nie jest połączona. Dane audytu pochodzą wyłącznie z publicznego API Google Places. - Po połączeniu konta będą dostępne dodatkowe statystyki: wyświetlenia w Google, kliknięcia, połączenia telefoniczne i nawigacje. -

-

- Właściciel firmy może połączyć konto w panelu Konto → Integracje. -

-
-
- {% endif %} -
{# Google Reviews from Places API — data is dict with 'reviews' key #} {% if places_data and places_data.google_reviews_data is mapping and places_data.google_reviews_data.get('reviews') %}