From a5f6d13f261f643e768fb35ce8559869d6d8273e Mon Sep 17 00:00:00 2001 From: alex-lambdaloopers Date: Tue, 20 Aug 2024 17:37:43 +0200 Subject: [PATCH 1/2] feat: use favicon_url instead of logo_url for favicon (#800) --- sqladmin/application.py | 5 +++++ sqladmin/templates/sqladmin/base.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sqladmin/application.py b/sqladmin/application.py index c0660e61..74f31142 100644 --- a/sqladmin/application.py +++ b/sqladmin/application.py @@ -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, @@ -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 @@ -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", @@ -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__( @@ -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, diff --git a/sqladmin/templates/sqladmin/base.html b/sqladmin/templates/sqladmin/base.html index 3e464995..2524648b 100644 --- a/sqladmin/templates/sqladmin/base.html +++ b/sqladmin/templates/sqladmin/base.html @@ -10,8 +10,8 @@ - {% if admin.logo_url %} - + {% if admin.favicon_url %} + {% endif %} {% block head %} {% endblock %} From 869930fdb516ade74837c9b1682d04104d42e4a1 Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Wed, 21 Aug 2024 09:40:22 +0200 Subject: [PATCH 2/2] Update mkdocstrings (#807) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0683cd72..b765f014 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ dependencies = [ dependencies = [ "mkdocs-material==9.1.3", "mkdocs==1.4.2", - "mkdocstrings[python]==0.20.0", + "mkdocstrings[python]==0.25.0", ] [tool.hatch.envs.test.scripts]