fix(templates): use url_for for static assets and root_path for nav links

Fixes 404 errors for CSS/JS when served behind IIS reverse proxy with
/gomag prefix. Replaces hardcoded /static/ paths with request.url_for()
and nav links with request.scope root_path prefix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-16 15:04:03 +00:00
parent 926543a2e4
commit ee60a17f00
5 changed files with 135 additions and 72 deletions

View File

@@ -67,17 +67,19 @@
<table class="table table-hover mb-0">
<thead>
<tr>
<th style="width:24px"></th>
<th>#</th>
<th class="sortable" onclick="sortOrdersBy('order_date')">Data comanda <span class="sort-icon" data-col="order_date"></span></th>
<th class="sortable" onclick="sortOrdersBy('order_number')">Nr. comanda <span class="sort-icon" data-col="order_number"></span></th>
<th class="sortable" onclick="sortOrdersBy('customer_name')">Client <span class="sort-icon" data-col="customer_name"></span></th>
<th class="sortable" onclick="sortOrdersBy('items_count')">Articole <span class="sort-icon" data-col="items_count"></span></th>
<th class="text-end">Transport</th>
<th class="text-end">Discount</th>
<th class="text-end">Total</th>
<th class="sortable" onclick="sortOrdersBy('status')">Status <span class="sort-icon" data-col="status"></span></th>
</tr>
</thead>
<tbody id="runOrdersBody">
<tr><td colspan="7" class="text-center text-muted py-3">Selecteaza un sync run</td></tr>
<tr><td colspan="9" class="text-center text-muted py-3">Selecteaza un sync run</td></tr>
</tbody>
</table>
</div>
@@ -116,11 +118,11 @@
<small class="text-muted">ID Adr. Livrare:</small> <span id="detailIdAdresaLivr">-</span>
</div>
</div>
<div class="d-flex justify-content-end gap-3 mb-2 flex-wrap" id="detailTotals">
<span><small class="text-muted">Valoare articole:</small> <strong id="detailItemsTotal">-</strong></span>
<span id="detailDeliveryWrap" style="display:none"><small class="text-muted">Transport:</small> <strong id="detailDeliveryCost">-</strong></span>
<span id="detailDiscountWrap" style="display:none"><small class="text-muted">Discount:</small> <strong id="detailDiscount">-</strong></span>
<span><small class="text-muted">Total comanda:</small> <strong id="detailOrderTotal">-</strong></span>
<div id="detailTotals" class="d-flex gap-3 mb-2 flex-wrap" style="font-size:0.875rem">
<span><small class="text-muted">Valoare:</small> <strong id="detailItemsTotal">-</strong></span>
<span id="detailDiscountWrap"><small class="text-muted">Discount:</small> <strong id="detailDiscount">-</strong></span>
<span id="detailDeliveryWrap"><small class="text-muted">Transport:</small> <strong id="detailDeliveryCost">-</strong></span>
<span><small class="text-muted">Total:</small> <strong id="detailOrderTotal">-</strong></span>
</div>
<div class="table-responsive d-none d-md-block">
<table class="table table-sm table-bordered mb-0">
@@ -128,12 +130,10 @@
<tr>
<th>SKU</th>
<th>Produs</th>
<th>CODMAT</th>
<th>Cant.</th>
<th>Pret</th>
<th>TVA</th>
<th>CODMAT</th>
<th>Status</th>
<th>Actiune</th>
<th class="text-end">Valoare</th>
</tr>
</thead>
<tbody id="detailItemsBody">
@@ -183,5 +183,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/logs.js?v=7"></script>
<script src="{{ request.url_for('static', path='js/logs.js') }}?v=9"></script>
{% endblock %}