fix(templates): use root_path for static assets instead of url_for

url_for generates absolute URLs with internal host (localhost:5003)
which browsers block via ERR_BLOCKED_BY_ORB. Using root_path prefix
generates correct relative paths (/gomag/static/...).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-16 15:15:56 +00:00
parent 843378061a
commit ced6c0a2d4
5 changed files with 7 additions and 7 deletions

View File

@@ -6,11 +6,11 @@
<title>{% block title %}GoMag Import Manager{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css" rel="stylesheet">
<link href="{{ request.url_for('static', path='css/style.css') }}?v=8" rel="stylesheet">
{% set rp = request.scope.get('root_path', '') %}
<link href="{{ rp }}/static/css/style.css?v=9" rel="stylesheet">
</head>
<body>
<!-- Top Navbar -->
{% set rp = request.scope.get('root_path', '') %}
<nav class="top-navbar">
<div class="navbar-brand">GoMag Import</div>
<div class="navbar-links">
@@ -28,7 +28,7 @@
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="{{ request.url_for('static', path='js/shared.js') }}?v=8"></script>
<script src="{{ rp }}/static/js/shared.js?v=9"></script>
{% block scripts %}{% endblock %}
</body>
</html>

View File

@@ -185,5 +185,5 @@
{% endblock %}
{% block scripts %}
<script src="{{ request.url_for('static', path='js/dashboard.js') }}?v=9"></script>
<script src="{{ request.scope.get('root_path', '') }}/static/js/dashboard.js?v=9"></script>
{% endblock %}

View File

@@ -183,5 +183,5 @@
{% endblock %}
{% block scripts %}
<script src="{{ request.url_for('static', path='js/logs.js') }}?v=9"></script>
<script src="{{ request.scope.get('root_path', '') }}/static/js/logs.js?v=9"></script>
{% endblock %}

View File

@@ -154,5 +154,5 @@
{% endblock %}
{% block scripts %}
<script src="{{ request.url_for('static', path='js/mappings.js') }}?v=7"></script>
<script src="{{ request.scope.get('root_path', '') }}/static/js/mappings.js?v=7"></script>
{% endblock %}

View File

@@ -94,5 +94,5 @@
{% endblock %}
{% block scripts %}
<script src="{{ request.url_for('static', path='js/settings.js') }}?v=1"></script>
<script src="{{ request.scope.get('root_path', '') }}/static/js/settings.js?v=1"></script>
{% endblock %}