From bd4d0fff105241bfa17472f6546c68cdc91648b4 Mon Sep 17 00:00:00 2001 From: Guillermo Doghel Date: Sun, 24 May 2026 14:37:27 -0300 Subject: [PATCH] Add billing cycle and sede subscription improvements --- tickets/templates/tickets/base.html | 36 ++++++++++ user_profile/admin.py | 70 +++++++++++++++++-- user_profile/admin_sede_subscriptions.py | 28 +------- user_profile/impersonation.py | 1 + ...0009_sedesubscriptionplan_billing_cycle.py | 18 +++++ user_profile/models.py | 1 + user_profile/services/sede_mercadopago.py | 60 +++++++++++++--- .../admin/admin_sede_subscriptions.html | 14 ++-- .../mi_fuego/my_tickets/la_sede.html | 48 ++++++++----- user_profile/urls.py | 2 + user_profile/views.py | 59 +++++++++++++--- 11 files changed, 262 insertions(+), 75 deletions(-) create mode 100644 user_profile/impersonation.py create mode 100644 user_profile/migrations/0009_sedesubscriptionplan_billing_cycle.py diff --git a/tickets/templates/tickets/base.html b/tickets/templates/tickets/base.html index a27cf5d..4102309 100644 --- a/tickets/templates/tickets/base.html +++ b/tickets/templates/tickets/base.html @@ -81,6 +81,29 @@ .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important; } + + .impersonation-badge { + position: fixed; + top: 10px; + right: 10px; + z-index: 1200; + background: #ffc107; + color: #212529; + border-radius: 999px; + padding: 8px 12px; + display: flex; + align-items: center; + gap: 10px; + box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); + font-size: 14px; + font-weight: 600; + } + + .impersonation-badge a { + color: #212529; + text-decoration: underline; + font-weight: 700; + } @@ -127,6 +150,13 @@ +{% if request.session.impersonation_admin_user_id %} +
+ Impersonalizando: {{ user.email }} + Salir +
+{% endif %} +