Skip to content

Commit 428b3ee

Browse files
authored
Merge pull request #35 from benavlabs/fix-image
fix location of icon
2 parents fddcd76 + 49af583 commit 428b3ee

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

crudadmin/templates/auth/login.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@
124124

125125
<div class="login-container">
126126
<div class="login-header">
127-
<img src="/{{ mount_path }}/static/favicon.png" alt="FastAPI Admin" class="login-header-icon">
127+
<img src="{% if mount_path %}/{{ mount_path }}{% endif %}/static/favicon.png" alt="FastAPI Admin" class="login-header-icon">
128128
FastAPI Administration
129129
</div>
130130

131131
<form class="login-form"
132-
action="/{{ mount_path }}/login"
132+
action="{% if mount_path %}/{{ mount_path }}{% endif %}/login"
133133
method="post"
134134
enctype="application/x-www-form-urlencoded">
135135
{% if error %}

crudadmin/templates/base/base.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<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">
88
<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>
1010
<style>
1111
/* Modern CSS Reset */
1212
*, *::before, *::after {
@@ -278,12 +278,12 @@
278278
<div class="{% if include_sidebar_and_header %}admin-container{% endif %}">
279279
{% if include_sidebar_and_header %}
280280
<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">
283283
FastAPI Admin
284284
</a>
285285
<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'">
287287
Logout
288288
</a>
289289
</div>
@@ -299,7 +299,7 @@ <h3 class="sidebar-section-title">Navigation</h3>
299299
</div>
300300
<ul class="sidebar-nav">
301301
<li>
302-
<a href="/{{ mount_path }}/" class="sidebar-link active">
302+
<a href="{% if mount_path %}/{{ mount_path }}{% endif %}/" class="sidebar-link active">
303303
Dashboard
304304
</a>
305305
</li>
@@ -314,14 +314,14 @@ <h3 class="sidebar-section-title">Management</h3>
314314
</div>
315315
<ul class="sidebar-nav">
316316
<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">
318318
Health Checks
319319
<span class="badge badge-primary">System</span>
320320
</a>
321321
</li>
322322
{% if track_events %}
323323
<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">
325325
Event Logs
326326
<span class="badge badge-primary">System</span>
327327
</a>
@@ -339,7 +339,7 @@ <h3 class="sidebar-section-title">Authentication</h3>
339339
<ul class="sidebar-nav">
340340
{% for auth_table_name in auth_table_names %}
341341
<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">
343343
{{ auth_table_name }}
344344
<span class="model-count">{{ auth_model_counts[auth_table_name]|default(0) }}</span>
345345
</a>
@@ -358,7 +358,7 @@ <h3 class="sidebar-section-title">Models</h3>
358358
<ul class="sidebar-nav">
359359
{% for table_name in table_names %}
360360
<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">
362362
{{ table_name }}
363363
<span class="model-count">{{ model_counts[table_name]|default(0) }}</span>
364364
</a>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "crudadmin"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
description = "FastAPI-based admin interface with authentication, event logging and CRUD operations"
55
readme = "README.md"
66
requires-python = ">=3.9.2"

0 commit comments

Comments
 (0)