fix(views): correct elif placement in base.html and clean HTML5 data attributes (v3.8.40)

This commit is contained in:
2026-10-28 05:53:18 -03:00
parent e5e6bfa094
commit 58d94f28d1
10 changed files with 112 additions and 31 deletions
+23 -2
View File
@@ -107,8 +107,13 @@
<span class="text-muted small">
<i class="bi bi-geo-alt-fill text-danger me-1"></i>{{ b.building_name or 'Todas las Sedes' }}
</span>
<button type="button" class="btn btn-primary btn-sm rounded-pill px-3 shadow-sm"
onclick='openRedeemModal({{ b | tojson | safe }})'>
<button type="button" class="btn btn-primary btn-sm rounded-pill px-3 shadow-sm btn-redeem-benefit"
data-title="{{ b.title }}"
data-partner="{{ b.partner_name }}"
data-discount="{{ b.discount_label }}"
data-desc="{{ b.description or '' }}"
data-terms="{{ b.terms_conditions or '' }}"
data-coupon="{{ b.coupon_code or '' }}">
<i class="bi bi-ticket-perforated me-1"></i> Ver Beneficio
</button>
</div>
@@ -168,6 +173,22 @@
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('click', function(e) {
const btn = e.target.closest('.btn-redeem-benefit');
if (btn) {
openRedeemModal({
title: btn.getAttribute('data-title'),
partner_name: btn.getAttribute('data-partner'),
discount_label: btn.getAttribute('data-discount'),
description: btn.getAttribute('data-desc'),
terms_conditions: btn.getAttribute('data-terms'),
coupon_code: btn.getAttribute('data-coupon')
});
}
});
});
function openRedeemModal(b) {
document.getElementById('redeemTitle').innerText = b.title;
document.getElementById('redeemPartner').innerText = b.partner_name;