Skip to content

Commit

Permalink
feat: use favicon_url instead of logo_url for favicon (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-lambdaloopers authored Aug 20, 2024
1 parent 7eda592 commit a5f6d13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions sqladmin/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(
base_url: str = "/admin",
title: str = "Admin",
logo_url: str | None = None,
favicon_url: str | None = None,
templates_dir: str = "templates",
middlewares: Sequence[Middleware] | None = None,
authentication_backend: AuthenticationBackend | None = None,
Expand All @@ -78,6 +79,7 @@ def __init__(
self.templates_dir = templates_dir
self.title = title
self.logo_url = logo_url
self.favicon_url = favicon_url

if session_maker:
self.session_maker = session_maker
Expand Down Expand Up @@ -340,6 +342,7 @@ def __init__(
base_url: str = "/admin",
title: str = "Admin",
logo_url: str | None = None,
favicon_url: str | None = None,
middlewares: Sequence[Middleware] | None = None,
debug: bool = False,
templates_dir: str = "templates",
Expand All @@ -353,6 +356,7 @@ def __init__(
base_url: Base URL for Admin interface.
title: Admin title.
logo_url: URL of logo to be displayed instead of title.
favicon_url: URL of favicon to be displayed.
"""

super().__init__(
Expand All @@ -362,6 +366,7 @@ def __init__(
base_url=base_url,
title=title,
logo_url=logo_url,
favicon_url=favicon_url,
templates_dir=templates_dir,
middlewares=middlewares,
authentication_backend=authentication_backend,
Expand Down
4 changes: 2 additions & 2 deletions sqladmin/templates/sqladmin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<link rel="stylesheet" href="{{ url_for('admin:statics', path='css/select2.min.css') }}">
<link rel="stylesheet" href="{{ url_for('admin:statics', path='css/flatpickr.min.css') }}">
<link rel="stylesheet" href="{{ url_for('admin:statics', path='css/main.css') }}">
{% if admin.logo_url %}
<link rel="icon" href="{{ admin.logo_url}}"/>
{% if admin.favicon_url %}
<link rel="icon" href="{{ admin.favicon_url }}">
{% endif %}
{% block head %}
{% endblock %}
Expand Down

0 comments on commit a5f6d13

Please sign in to comment.