4
4
< meta charset ="UTF-8 ">
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
< title > {% block title %}FastAPI Admin{% endblock %}</ title >
7
- < link rel ="icon " type ="image/png " href ="/{{ mount_path }}/static/favicon.png?v=1 ">
7
+ < link rel ="icon " type ="image/png " href ="{% if mount_path %} /{{ mount_path }}{% endif % }/static/favicon.png?v=1 ">
8
8
< link href ="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap " rel ="stylesheet ">
9
- < script src ="/{{ mount_path }}/static/htmx.min.js "> </ script >
9
+ < script src ="{% if mount_path %} /{{ mount_path }}{% endif % }/static/htmx.min.js "> </ script >
10
10
< style >
11
11
/* Modern CSS Reset */
12
12
* , * ::before , * ::after {
278
278
< div class ="{% if include_sidebar_and_header %}admin-container{% endif %} ">
279
279
{% if include_sidebar_and_header %}
280
280
< header class ="admin-header ">
281
- < a href ="/{{ mount_path }}/ " class ="brand ">
282
- < img src ="/{{ mount_path }}/static/favicon.png " alt ="FastAPI Admin " class ="brand-icon ">
281
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/ " class ="brand ">
282
+ < img src ="{% if mount_path %} /{{ mount_path }}{% endif % }/static/favicon.png " alt ="FastAPI Admin " class ="brand-icon ">
283
283
FastAPI Admin
284
284
</ a >
285
285
< div class ="flex items-center gap-4 ">
286
- < a href ="/{{ mount_path }}/logout " style ="color: white; text-decoration: none; font-weight: 500; transition: color 0.2s " onmouseover ="this.style.color='var(--primary-light)' " onmouseout ="this.style.color='white' ">
286
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/logout " style ="color: white; text-decoration: none; font-weight: 500; transition: color 0.2s " onmouseover ="this.style.color='var(--primary-light)' " onmouseout ="this.style.color='white' ">
287
287
Logout
288
288
</ a >
289
289
</ div >
@@ -299,7 +299,7 @@ <h3 class="sidebar-section-title">Navigation</h3>
299
299
</ div >
300
300
< ul class ="sidebar-nav ">
301
301
< li >
302
- < a href ="/{{ mount_path }}/ " class ="sidebar-link active ">
302
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/ " class ="sidebar-link active ">
303
303
Dashboard
304
304
</ a >
305
305
</ li >
@@ -314,14 +314,14 @@ <h3 class="sidebar-section-title">Management</h3>
314
314
</ div >
315
315
< ul class ="sidebar-nav ">
316
316
< li >
317
- < a href ="/{{ mount_path }}/management/health " class ="sidebar-link ">
317
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/management/health " class ="sidebar-link ">
318
318
Health Checks
319
319
< span class ="badge badge-primary "> System</ span >
320
320
</ a >
321
321
</ li >
322
322
{% if track_events %}
323
323
< li >
324
- < a href ="/{{ mount_path }}/management/events " class ="sidebar-link ">
324
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/management/events " class ="sidebar-link ">
325
325
Event Logs
326
326
< span class ="badge badge-primary "> System</ span >
327
327
</ a >
@@ -339,7 +339,7 @@ <h3 class="sidebar-section-title">Authentication</h3>
339
339
< ul class ="sidebar-nav ">
340
340
{% for auth_table_name in auth_table_names %}
341
341
< li >
342
- < a href ="/{{ mount_path }}/{{ auth_table_name }}/ " class ="sidebar-link ">
342
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/{{ auth_table_name }}/ " class ="sidebar-link ">
343
343
{{ auth_table_name }}
344
344
< span class ="model-count "> {{ auth_model_counts[auth_table_name]|default(0) }}</ span >
345
345
</ a >
@@ -358,7 +358,7 @@ <h3 class="sidebar-section-title">Models</h3>
358
358
< ul class ="sidebar-nav ">
359
359
{% for table_name in table_names %}
360
360
< li >
361
- < a href ="/{{ mount_path }}/{{ table_name }}/ " class ="sidebar-link ">
361
+ < a href ="{% if mount_path %} /{{ mount_path }}{% endif % }/{{ table_name }}/ " class ="sidebar-link ">
362
362
{{ table_name }}
363
363
< span class ="model-count "> {{ model_counts[table_name]|default(0) }}</ span >
364
364
</ a >
0 commit comments