fix: address code review issues (stack traces, duplicate code, template logic, import alias)
Agent-Logs-Url: https://github.com/dsaub/proyecto-final/sessions/09bd2b8f-753c-4431-816f-eba20606d5a0 Co-authored-by: dsaub <54474838+dsaub@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
233e42c14e
commit
ff475ef2dc
@@ -104,19 +104,16 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2" class="text-end">Subtotal:</th>
|
||||
<th colspan="2" class="text-end">{{ cart.get_total|format_price }}€</th>
|
||||
<td></td>
|
||||
<th colspan="4" class="text-end">Subtotal:</th>
|
||||
<th class="text-end">{{ cart.get_total|format_price }}€</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2" class="text-end">IVA (21%):</th>
|
||||
<th colspan="2" class="text-end text-success">+{{ cart.get_vat_amount|format_price }}€</th>
|
||||
<td></td>
|
||||
<th colspan="4" class="text-end">IVA (21%):</th>
|
||||
<th class="text-end text-success">+{{ cart.get_vat_amount|format_price }}€</th>
|
||||
</tr>
|
||||
<tr style="background-color: #f8f9fa;">
|
||||
<th colspan="2" class="text-end" style="font-size: 1.1rem;">Total:</th>
|
||||
<th colspan="2" class="text-end" style="font-size: 1.1rem;">{{ cart.get_total_with_vat|format_price }}€</th>
|
||||
<td></td>
|
||||
<th colspan="4" class="text-end" style="font-size: 1.1rem;">Total:</th>
|
||||
<th class="text-end" style="font-size: 1.1rem;">{{ cart.get_total_with_vat|format_price }}€</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
<a href="{% url 'agregar_tarjeta' %}" class="btn btn-sm btn-success">➕ Añadir tarjeta</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for metodo in metodos %}
|
||||
{% if metodo.method_type == 'card' %}
|
||||
{% with has_card=False %}
|
||||
{% for metodo in metodos %}{% if metodo.method_type == 'card' %}
|
||||
<div class="d-flex justify-content-between align-items-center border rounded p-3 mb-2">
|
||||
<div>
|
||||
<span class="fw-semibold">{{ metodo.label }}</span>
|
||||
@@ -50,9 +50,9 @@
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Eliminar</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if not metodos %}
|
||||
{% endif %}{% endfor %}
|
||||
{% endwith %}
|
||||
{% if not cards_exist %}
|
||||
<p class="text-muted mb-0">No tienes tarjetas guardadas.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -67,8 +67,7 @@
|
||||
<a href="{% url 'agregar_paypal' %}" class="btn btn-sm btn-warning">➕ Añadir PayPal</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for metodo in metodos %}
|
||||
{% if metodo.method_type == 'paypal' %}
|
||||
{% for metodo in metodos %}{% if metodo.method_type == 'paypal' %}
|
||||
<div class="d-flex justify-content-between align-items-center border rounded p-3 mb-2">
|
||||
<div>
|
||||
<span class="fw-semibold">{{ metodo.paypal_email }}</span>
|
||||
@@ -79,9 +78,8 @@
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Eliminar</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if not metodos %}
|
||||
{% endif %}{% endfor %}
|
||||
{% if not paypal_exist %}
|
||||
<p class="text-muted mb-0">No tienes cuentas de PayPal guardadas.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user