From ddb480b624e95459c4854fa3ac97556a00ad88c1 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Tue, 19 Mar 2024 23:56:20 +0100 Subject: [PATCH 1/8] feat(settings): add on ready application config check if settings attribute are sets --- admin_interface/apps.py | 3 +++ admin_interface/settings.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/admin_interface/apps.py b/admin_interface/apps.py index 93fe6951..323d45b0 100644 --- a/admin_interface/apps.py +++ b/admin_interface/apps.py @@ -11,3 +11,6 @@ def ready(self): from admin_interface import settings settings.check_installed_apps() + + # must check if LOCAL_FILE_DIR is set in settings + settings.check_settings("LOCAL_FILE_DIR") diff --git a/admin_interface/settings.py b/admin_interface/settings.py index f63f139d..95eeaa5e 100644 --- a/admin_interface/settings.py +++ b/admin_interface/settings.py @@ -25,5 +25,18 @@ def check_installed_app(app, max_dj_version=None): ) +def check_settings(setting_attribute): + """ + Check if the setting_attribute is set in the settings module. + """ + + if not hasattr(settings, setting_attribute): + raise ImproperlyConfigured( + "You must set the {} setting in your settings module.".format( + setting_attribute + ) + ) + + def check_installed_apps(): check_installed_app("colorfield") From ae6b6b5ee430be06e5ca82682df0989a335aac01 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Tue, 19 Mar 2024 23:57:00 +0100 Subject: [PATCH 2/8] test: add missing tests check settings rel to #728d847d86ddfbdcf75f4c32856153bd7839ba8d --- tests/settings.py | 1 + tests/test_settings.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/settings.py b/tests/settings.py index 812a8214..d4938e9e 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -120,3 +120,4 @@ STATIC_ROOT = os.path.join(BASE_DIR, "admin_interface/public/static/") STATIC_URL = "/static/" +LOCAL_FILE_DIR = os.path.join(BASE_DIR, "admin_interface/public/") diff --git a/tests/test_settings.py b/tests/test_settings.py index 4a7e64eb..df4790ee 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -2,7 +2,8 @@ from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings -from admin_interface.settings import check_installed_apps +from admin_interface.settings import check_installed_apps, check_settings +import os class AdminInterfaceSettingsTestCase(TestCase): @@ -28,6 +29,12 @@ def __test_installed_apps(self): else: check_installed_apps() + def __test_check_settings(self): + if not hasattr(settings, "LOCAL_FILE_DIR"): + self.assertRaises(ImproperlyConfigured, check_settings, "LOCAL_FILE_DIR") + else: + check_settings("LOCAL_FILE_DIR") + @override_settings( INSTALLED_APPS=[ "admin_interface", @@ -47,3 +54,7 @@ def test_installed_apps_all(self): ) def test_installed_apps_no_colorfield(self): self.__test_installed_apps() + + @override_settings(LOCAL_FILE_DIR=os.path.join(settings.BASE_DIR, "local_file_dir")) + def test_check_settings_local_file_dir(self): + self.__test_check_settings() From 80a3bf7af0c1c90dd46914336008085377435fd1 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Tue, 19 Mar 2024 23:59:01 +0100 Subject: [PATCH 3/8] feat(model): add FilePathField for static file (logo) path ref to #355 --- admin_interface/admin.py | 1 + .../migrations/0031_theme_static_logo_path.py | 24 +++++++++++++++ admin_interface/models.py | 30 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 admin_interface/migrations/0031_theme_static_logo_path.py diff --git a/admin_interface/admin.py b/admin_interface/admin.py index 504fe43b..edf474b0 100644 --- a/admin_interface/admin.py +++ b/admin_interface/admin.py @@ -58,6 +58,7 @@ class ThemeAdmin(admin.ModelAdmin): "logo_max_height", "logo_color", "logo_visible", + "static_logo_path", ), }, ), diff --git a/admin_interface/migrations/0031_theme_static_logo_path.py b/admin_interface/migrations/0031_theme_static_logo_path.py new file mode 100644 index 00000000..a2e60960 --- /dev/null +++ b/admin_interface/migrations/0031_theme_static_logo_path.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.3 on 2024-03-19 22:29 + +import admin_interface.models +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("admin_interface", "0030_theme_collapsible_stacked_inlines_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="theme", + name="static_logo_path", + field=models.FilePathField( + blank=True, + match="^.*\\.(jpg|jpeg|png|svg)$", + max_length=255, + path=admin_interface.models.static_logo_directory_path, + verbose_name="static logo", + ), + ), + ] diff --git a/admin_interface/models.py b/admin_interface/models.py index a29f5238..5fdd134d 100644 --- a/admin_interface/models.py +++ b/admin_interface/models.py @@ -5,10 +5,16 @@ from django.dispatch import receiver from django.utils.encoding import force_str from django.utils.translation import gettext_lazy as _ +from django.conf import settings +import os from .cache import del_cached_active_theme +def static_logo_directory_path(): + return settings.LOCAL_FILE_DIR + + class ThemeQuerySet(models.QuerySet): def get_active(self): objs_active_qs = self.filter(active=True) @@ -62,6 +68,14 @@ class Theme(models.Model): verbose_name=_("visible"), ) + static_logo_path = models.FilePathField( + path=static_logo_directory_path, + blank=True, + verbose_name=_("static logo"), + match=r"^.*\.(jpg|jpeg|png|svg)$", + max_length=255, + ) + logo = models.FileField( upload_to="admin-interface/logo/", blank=True, @@ -401,10 +415,26 @@ class Theme(models.Model): objects = ThemeQuerySet.as_manager() + @property + def static_logo_relative_url(self): + return os.path.relpath(self.static_logo_path, settings.STATIC_ROOT) + def set_active(self): self.active = True self.save() + def save(self, *args, **kwargs): + if self.static_logo_path: + # clear cache if static logo path has changed + try: + obj = Theme.objects.get(pk=self.pk) + if obj.static_logo_path != self.static_logo_path: + del_cached_active_theme() + except Theme.DoesNotExist: + pass + + super().save(*args, **kwargs) + class Meta: app_label = "admin_interface" verbose_name = _("Theme") From 89fe3e59761afc3c44104c5792a50fe7b041e863 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Wed, 20 Mar 2024 00:01:02 +0100 Subject: [PATCH 4/8] feat(template): integrate #8f0abe843dd3b839403dab8bc3d285e6d3f208cf to render first the static logo (server-uploaded), after the other logo (client-uploaded) ref to #355 --- admin_interface/templates/admin/base_site.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin_interface/templates/admin/base_site.html b/admin_interface/templates/admin/base_site.html index 9df49110..935a1bd7 100644 --- a/admin_interface/templates/admin/base_site.html +++ b/admin_interface/templates/admin/base_site.html @@ -169,6 +169,8 @@

{% if theme.logo_visible %} {% if theme.logo %} + {% elif theme.static_logo_path %} + {% else %} {% endif %} From 892b7ac54f4532c5f1cc18fceb1c3afae15b9fe5 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Wed, 20 Mar 2024 00:01:39 +0100 Subject: [PATCH 5/8] test: add missing tests model new fields for #8f0abe843dd3b839403dab8bc3d285e6d3f208cf --- tests/test_models.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/test_models.py b/tests/test_models.py index 5754e967..aff6ed04 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -4,7 +4,7 @@ from django.conf import settings from django.test import TestCase -from admin_interface.models import Theme +from admin_interface.models import Theme, static_logo_directory_path class AdminInterfaceModelsTestCase(TestCase): @@ -90,6 +90,33 @@ def test_str(self): theme = Theme.objects.get_active() self.assertEqual(str(theme), "Django") + def test_save_clear_cache(self): + theme = Theme.objects.get_active() + theme.static_logo_path = "test" + theme.save() + + self.assertEqual(str(theme), "Django") + + fake_dir = settings.LOCAL_FILE_DIR + "/fake" + theme.static_logo_path = fake_dir + theme.save() + + assert theme.static_logo_path == fake_dir + + def test_save_clear_cache_no_matched_theme(self): + theme = Theme( + name="Custom 1", + active=True, + static_logo_path=settings.LOCAL_FILE_DIR + "/fake", + ) + theme.pk = 999 + theme.save() + + def test_static_path(self): + # the `static_logo_directory_path` function is used as the callable + # in the `path` argument of the `static_logo_path` field + assert static_logo_directory_path() == settings.LOCAL_FILE_DIR + # class AdminInterfaceModelsMultiDBTestCase(TestCase): # databases = ["default", "replica"] From 5e787966a17bd52e5ff1e4f1ec2f672f86fca562 Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Wed, 20 Mar 2024 00:31:37 +0100 Subject: [PATCH 6/8] feat(locale): add missing traduction field rel to #8f0abe843dd3b839403dab8bc3d285e6d3f208cf --- .../locale/de/LC_MESSAGES/django.mo | Bin 3820 -> 3864 bytes .../locale/de/LC_MESSAGES/django.po | 6 +++++- .../locale/es/LC_MESSAGES/django.mo | Bin 4072 -> 4115 bytes .../locale/es/LC_MESSAGES/django.po | 9 +++++++-- .../locale/fa/LC_MESSAGES/django.mo | Bin 3025 -> 3087 bytes .../locale/fa/LC_MESSAGES/django.po | 6 +++++- .../locale/fr/LC_MESSAGES/django.mo | Bin 3731 -> 3773 bytes .../locale/fr/LC_MESSAGES/django.po | 6 +++++- .../locale/it/LC_MESSAGES/django.mo | Bin 3504 -> 3569 bytes .../locale/it/LC_MESSAGES/django.po | 6 +++++- .../locale/pl/LC_MESSAGES/django.mo | Bin 2889 -> 2940 bytes .../locale/pl/LC_MESSAGES/django.po | 6 +++++- .../locale/pt_BR/LC_MESSAGES/django.mo | Bin 3343 -> 3386 bytes .../locale/pt_BR/LC_MESSAGES/django.po | 6 +++++- .../locale/ru/LC_MESSAGES/django.mo | Bin 5920 -> 5986 bytes .../locale/ru/LC_MESSAGES/django.po | 6 +++++- .../locale/tr/LC_MESSAGES/django.mo | Bin 2976 -> 3023 bytes .../locale/tr/LC_MESSAGES/django.po | 6 +++++- 18 files changed, 47 insertions(+), 10 deletions(-) diff --git a/admin_interface/locale/de/LC_MESSAGES/django.mo b/admin_interface/locale/de/LC_MESSAGES/django.mo index fed60dbd047a5a7212fad80179b0b8293bc126b2..83c4bcecd45b65f495c01bbce22b2bb13a2571e6 100644 GIT binary patch delta 1150 zcmXxkPe@cz6vy%Nnm47+` z^UuI`(csSx@Kc9}aV?%ky?7mcoInMbbWWq5f9Cq{Pz!&-IL;%vSd^$VEr#kRUB40Q zEHGO|qk)MIOyUk~!h=|kB~${JQ40(se|FV*!+8srFg}S&BjG&5_p1I=QS$v8B}FHBC+i| z1}PfzG+MEqXxluqEb7dMc)K6RPyuFfIsQUbs*&hQq#d=>Zq%9gAxqj(RG>lB`$g1q zWz><3#;CtC9b=#u@1Xj#s7h2&FZ@O=kRW|kDvcWNLVbkWQS*7!PS2nM47vV!=Oxs8 z!>A38$Em+|^q2uH^xj!PCD1@NS}=uLFpb(#o3jH|i7YCC-OfX(Kn2t{bPjctBdB=e zs7gHuXeiJt)Ytt6Rnkvxd=9tJub={Ccu4a(Y{mgpfU~HN_6jP{1S;{ns6h8oNAeQ2 z(YLr7n|{#X$gP`OmnL;(L(kvub%g_dyVnzz{nqp*M%Q!e6I{cswEkcE@3Ap_>Sw&o oQ(p99r20tdWWME8;do)HTy;B|D3%x~=1&|ew)8O=uB(0Y7tgV4^#A|> delta 1108 zcmXxjO-K}B9LMoz*O^+|^<_7ed{0~mG_i}WYnJGtM3g;v5b0on1cIjy!YVX~X$J)l zqv%0`AR!XG7=k5OCxZwt9#q_*=-@%chg`S`bu?x6yuQ1ADno*PDO{TM3I zi7@-$PG!z^?4q_hgL>gRYJyYL4!JBt{iUdnuMRbSAGOi}RDeO-erz2$hoJ8%^3sju9 z9u>rwZ4&ibp+it7*L GZ~q6~0bd{h diff --git a/admin_interface/locale/de/LC_MESSAGES/django.po b/admin_interface/locale/de/LC_MESSAGES/django.po index 73683d94..570a00a9 100644 --- a/admin_interface/locale/de/LC_MESSAGES/django.po +++ b/admin_interface/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 18:20-0500\n" +"POT-Creation-Date: 2024-03-19 18:27-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -114,6 +114,10 @@ msgstr "Farbe" msgid "visible" msgstr "sichtbar" +#: admin_interface/models.py +msgid "static logo" +msgstr "statisches Logo" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Dieses Feld leer lassen um das Django Standard Logo zu benutzen" diff --git a/admin_interface/locale/es/LC_MESSAGES/django.mo b/admin_interface/locale/es/LC_MESSAGES/django.mo index 289e0d60498045c87291364ef43c7548a31366fb..a5bab3bcd03526b3b1c4030ab344e422477e0502 100644 GIT binary patch delta 1219 zcmXxjOGs2v9LMo9dDWS8oSQjjnatSWET)*45GKbSf(ZpBA{4o3ks(%8113SZn8Zzx z^twc}NXQv0!Gu~4<-4pQNE z$9VX70yB64weTJ)mdB_Ko|KY%*v zVNBs^EQXw$MP+D>)dk$hE}A!p%E(z%=5C_qJwyeth@0^}5{p|w?ei1c@OK0G*Fv8t z6j=(D`Yh^X{isw;p)xUxntuy5?~#p{t^XY+=>KBvKd5y+$JdGDr~ukg-$W`({`FC1 z=uqT6sK|#<5sso3OyL%sL7jLGm4R27#&4(%>Uo*wN6om|f%+G9q4w!T{ba)>>lj6C zc-aPS<0jhks1qzAw|mZmz1#=X2|nWy{EiAd$6KkoepIH0Q5hUVz5kMp-#`W0IY&hi zJ+Y1@OwxXhJ8&h4c!`m{)c#+)t&+ig6osKs`zYHe`zhU&EM+@I`O>8?YR|tKe@f&d zaJ|8_w=>#9EoUS7V9C1{Dl8nT4Qe7MC(oQpo-2+Q7nZ|=bxo=z$1YC3d_aFONXK6M E1$@V8GXMYp delta 1178 zcmXxjPe@cz6vy#1`JD0p=-^DL)tLP;rsyA9Hd?M40<%S%n1u-vw9K#~2zpSEMYPC= z8zDEf$W2IYiZ%*CB(w@53Zhy_kQ-^B288$^O<$MFUP?9iH_8 zW2gWoy#E^3(!S;W_wfkrDb$rLqt^N8?NwAp)=}%$FCwf63clQS(Zu6PHl|{6XD)g0$#wsi~3tEAlOL zDDoaugay=uQEbNxs1x5rW#9?!!dIvbexSy$xn(!TF8VL1MeUPCUDaW47eXr9aKwMO ziW_O)Mx9_5dF>G&*0g7+6D;B|zD5O}W>saV8qras7e>Jlz\n" "Language-Team: Spanish \n" @@ -116,6 +116,10 @@ msgstr "color" msgid "visible" msgstr "visible" +#: admin_interface/models.py +msgid "static logo" +msgstr "logo estático" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Dejar en blanco para usar el logo por defecto de Django" @@ -236,7 +240,8 @@ msgstr "anclar posición" #: admin_interface/models.py msgid "quick remove links for active filters at top of sidebar" -msgstr "remover enlaces para filtros activos en la parte superior de la barra lateral" +msgstr "" +"remover enlaces para filtros activos en la parte superior de la barra lateral" #: admin_interface/models.py msgid "foldable apps" diff --git a/admin_interface/locale/fa/LC_MESSAGES/django.mo b/admin_interface/locale/fa/LC_MESSAGES/django.mo index 537e1295fc333589927984bba40d74d970636412..b17b55b5037a2d8277c545770ba64055830d595c 100644 GIT binary patch delta 1049 zcmXxjJ4jqX6vpwRyFTLjh;P^UxW08&FlCTf1VvIv6vQGRDi$IU1+}r-Msy3oLZXdD zf=JLnB5aw;G!`k6fS6qugG!n}2r4AD{=ap0xO0DVcW36FIWzZr`Fch8XOaK4Q97wr z)a5j@r}!tG8|B<*R*Dx`hqw3wgMPCDoJNgX!hGCB_20z+e!?s~!aV$nnRtc|&BFGJ zMu;E&p$2#vW;Cq>>0pmh6F);uFod}{hFmtoO%u+$=OyLH)mi zVGVpkLtC(iitHH6@e0*3o8@T5^{D&0TzT~MAZ&1&96QiM7+cjpu>L9ny?mdH?_b delta 987 zcmYk*JxEny7{KvI@AV_SWtw%pSIcYJ$Gtj4Ll6y3Vzh|h5J8aM!Ohu0JX5G(G(?Uq z4Iu~#H>k-af(!|yNiZF3iT1Fe=>I>Rp_lW%zxUkpemv(n?|s_0TTBjm^3Q`ZN*$ms zG)3IT{bm}<$6Ul&+{Ph1#0hN5M|9yNI&T_J;UYTz33lR3Y{S=h65nDge!$ZaN$k+6 z@xxbiLVHUD-RMOIL8|?0y!VKZoZq!5&=0UR=jK`^Od? zu6R#lq}!Rh*v0Zhn z>@&&~ALBzTw?~}8c{Gq!G_@}>-ym0fqA`FkSi&P@$@qRfE<9!j`pn{&Co9H@qyow1r{}me0269D%#(=jv$bXs6 z=j?~?c!m34=mr%IgcGZ1K-bYTa1R+0_wh2;(NwRX8C=6Ye1{}BEuH~CiveGxdZtQ# ze-DG3SPW*E>f5;BHL8CE)=4u1Y4IFbeB1MB@837A(l>C6ff(cn)hzf4EoR0-Qe)sQ ujgkIeJf*%>jcS@a17^i?fjUU#h@_c-;2#;4#$N7Gb7QQv+VX6\n" "Language-Team: Farsi \n" @@ -113,6 +113,10 @@ msgstr "رنگ" msgid "visible" msgstr "نمایان" +#: admin_interface/models.py +msgid "static logo" +msgstr "لوگوی استاتیک" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "برای نمایش لوگوی پیش فرض، خالی بگذارید." diff --git a/admin_interface/locale/fr/LC_MESSAGES/django.mo b/admin_interface/locale/fr/LC_MESSAGES/django.mo index 1f2544609a30e7d070d83926d1de0f3376857834..21560b0f328781829fc62d6cfbbfb3f97b77bc33 100644 GIT binary patch delta 1130 zcmXZbPiPZC6vy#bveB$b)Yh8*(P&yrA{r1HtG0>|j0nB-R4Rgs6e|TyQKJW;E*`xU z%j!YIg4muEdWfJ0EqbUTDnw7#LoM{ui}WH0LWc7C>E2kygeRDiSS;V3FW8TH(_>rbEpKE?z-Lt@)2?0$;&Kyp5aio*RFJ+vq<>#eJ*$G7_ycNh7f^{;Q3>iu@hr-Ise%bqMYE`d^`a_z0(iHOJldJ zi>3*ME0Mgf|32S>6~eSP@#vq~Y{2oboLy`m6NM7jwK6#V|2`41+-{S%Y#etv zTRHz!n2q2@fG>_?&#VRi<29_WEYEjiJ>wUs=a#SzS5fzGVgyTAjeA&yKd~17md)9T zn+P-8z(gZTnSRp@} zxbPb<;VE9g7|T}TE>ys7R3#Z_zjFw+fDu&SNo>TY7{=%B`XV+nUO~nEtaL$KnhVc%n#nr)bz!++L9hESPN-%_4;3%pCPRAMt!oQHe{a1p7#{>=&wYN2pGQ**6swM|CoZY3xJAe}?M7%Lx5f zOI~q70Sc&uMK|6?&F`ZU{X-=_K~?Ngt_))g8&GjlsLBWMDo&vam_sG@QE}eX(0{G; zEf?emH?fXd=?3b-@6H2v{TP)fNITTZ1S)VAS)1K+4x?VAF&xIns6X*L)WX&$_@URQ zgctD$^(P8(mnyrAs-z9I;y%>Y3}PofLALaKf3tX-Q=QO}@qYyRLwd2|T|4!<0&D4Dq0-;2-8%!P?p\n" "Language-Team: LANGUAGE \n" @@ -114,6 +114,10 @@ msgstr "couleur" msgid "visible" msgstr "visible" +#: admin_interface/models.py +msgid "static logo" +msgstr "logo statique" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Laisser vide pour utiliser le logo Django par défaut" diff --git a/admin_interface/locale/it/LC_MESSAGES/django.mo b/admin_interface/locale/it/LC_MESSAGES/django.mo index a75aa70a61141692c635328695a5658edf3163b8..ab971e31dd61bce46dd42d27b64c9079246fed1a 100644 GIT binary patch delta 1290 zcmYk*OGs5g9Dwmj@73yFOD!K|+O?;dWoA~3S`zV<`R0)0nVZA2IKQJw7)UT;snxlc#K@(Y4V&8 z;W-66dWklCja=a!H#?liYW#|oSi~~cVio#bGum-0a)plQVKf5Aa3!8X`#XbvH)uWM zhf5Sz;MMrzCLZ8<6bYw-xyqxC&VlQ4iz z=n6XCt$ciO8x7?ox)l#`3%*6RFgf|2iGAetWK&0hB$V4J$3Hf>r6xn|b~s^IZ*np@ z3nYK}yt6VH{zkH^{g?c&jfOKeY}?2t&x8liWY}GasfpZ1ZXs_Xx09KF*h)6llXoYj z!j1FSot#)trTdngV%%AHpPXW&u!~$2>%<7{`S01{4l>6fiK5S~-liX=(#4sYW0nW6qtobsUvUxsz-F}359EPKhbfV+PFHCaD;Rjrezp#sKteIDw_!S1^bN<+8J@;vcoALsP2?9Ia;e29X#WXx0&mdFOra_Nh9oEa!7BWR+pvm# zbF13W40M*U|EBT;4W{Zs>~I|$xWA1)A4Xr8h`vHUFo}#ErqB<4itWGAh5SV)TtT`# zbWK=;2hjJAm6LxfT{M{LZgfSL(Uo6~?RU@@AE6T&i|x~-C2_Uu3f1DF*i3yBVLE3^%WMTr_fDcIwz-Psg!}Iy^xSyZET-JWxni?v w*-q3GCBzoHau^H6ee(2L))xt@aBZxcepBfGrMl7gsdVY+mrP%J;9B<5e~kTG761SM diff --git a/admin_interface/locale/it/LC_MESSAGES/django.po b/admin_interface/locale/it/LC_MESSAGES/django.po index 580ab43d..11acc62a 100644 --- a/admin_interface/locale/it/LC_MESSAGES/django.po +++ b/admin_interface/locale/it/LC_MESSAGES/django.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: django-admin-interface\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 18:20-0500\n" +"POT-Creation-Date: 2024-03-19 18:27-0500\n" "PO-Revision-Date: 2018-12-30 19:13-0500\n" "Last-Translator: Fabio Caccamo \n" "Language-Team: Italian \n" @@ -115,6 +115,10 @@ msgstr "colore" msgid "visible" msgstr "visibile" +#: admin_interface/models.py +msgid "static logo" +msgstr "logo statico" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Lasciare vuoto per usare il logo Django di default" diff --git a/admin_interface/locale/pl/LC_MESSAGES/django.mo b/admin_interface/locale/pl/LC_MESSAGES/django.mo index 0587f3fdf49fd1c389fa5643fe07e7364236c578..256256b5a6775235060ae42b6ff88d0fab62e345 100644 GIT binary patch delta 1038 zcmXxjPl!!X9Ki9PdDj^4@ys6{2>}+;^IDKj+@L=XZYRch8$C{Vg>=b|<%jwvE1) zeq}+#Zv589h4v{Iu>$9CJ^sdn*qcNw!%=iz1B-YYeg8fd@HsBRm$($)Vmr=aXGAkT zGpO<47doM`FoIzWA}_>tH1J+Dz+qg1Cy~Dx<6^*x?7orRH_`c5v4nT98=v5EoW_Lp z<2?iZ;sX~moy+`+UEKe`Jmy%%fJHRHzRZ5K5(DT4cA@X@N2bOhG~uIY{5r0|GgxK) zxW?cFWq*X0uA_t9Vi`wp7%TV!x8N6aC!LGucTz`N~ z>F|p+E@oOw{fO<{Z(6Kr8sZ9^;3j*ja_hC~HTbP%2QDxSen?7@dPo>1;N zI+pA!qegHKC-F*aLmWDHICE;`R- zmioK!RQiVm&G;Fb;cN88DxStAG~svX1RLo1Ei}QO*oCgr2PLGy`{5aIE;n|L=0*#C ze@p3PhKro1RcJ2cB>p3qwLAM4o&&@0*}31Vm$;w4i5OOdd}4s+W;{zqZ=Il6QM|#$ s9sD1D;|sJh&4XoyF4By%G\n" "Language-Team: Polish \n" @@ -115,6 +115,10 @@ msgstr "kolor" msgid "visible" msgstr "widoczny" +#: admin_interface/models.py +msgid "static logo" +msgstr "statyczne logo" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Puste ustawia domyślne logo Django" diff --git a/admin_interface/locale/pt_BR/LC_MESSAGES/django.mo b/admin_interface/locale/pt_BR/LC_MESSAGES/django.mo index c81bb244bbcf4a81c2c2132e1e668abe80183094..80a5cf166970314fe82b6d0085a2fc77d05063d1 100644 GIT binary patch delta 1043 zcmXZaPe{{Y9LMqR{LPt8UE3<%DpTemg0h@VIuvw>Qj$8wB2i47MT=n?L6=2;P8A(~ zN{0^8LAqoVgAN6OSri0C7(ziFJcPqb1c5???~gt|_WWMYpWpL*pYQYRLGo3yxDX3Y z7*8i<2jyG9tPAgXym+1m&9>qTY{3tB3dK|7?~tE;<+UBZV+#M`QLZtuX(Q8fMAg+@!816H zNnFOFjv~bB3b+$>5_^%kb{rMpG&W)umEj2TvzxrM;rp1uNz^*?sLX$%PIMV#s4O)< zj+)mR=KOWH89FrK7%IbVTo3HpSyaY-s0A;f7QBJln2$>2DQey<>i_!*iEUq8{}0r6 zi>O3b!<;{Li?h1!Y!@m(8rSa*wZR@#X1%UIkNSSZjo(3KHtw841%8SAY=)OM_8GPD zdDID)qg0xx{K4HAt@E#Y?SW2z+G_~3`|rI}V4q+1(k%xV)a4$e=usNlnI7#V;~x$- zB=%EFQ|D;dpL@wM7c#5Bd91_Nn895v!N&am^DbdA?JR2iAVzQu3-KYI#3|P?^3$imh=wjT=~xyLgr3`-{r3lW01!EN1a8CU6_|{wL-X z&?AbzKpBRy8Ck\n" "Language-Team: LANGUAGE \n" @@ -114,6 +114,10 @@ msgstr "cor" msgid "visible" msgstr "visível" +#: admin_interface/models.py +msgid "static logo" +msgstr "logo estático" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Deixe em branco para usar o logotipo padrão do Django" diff --git a/admin_interface/locale/ru/LC_MESSAGES/django.mo b/admin_interface/locale/ru/LC_MESSAGES/django.mo index 1f77b53695bb7f794ed8679de1878617dfdeb1fa..f7b1b58aeb5a0cad1e888292097690221e18121b 100644 GIT binary patch delta 1346 zcmXxiOGs2v9LMo9Hd8(tHOdlc;qLa+~YCQt&n|!y!z?r`9Q4LjOHx;S6g1pM~*= zNnw_@$wWV{v=-U%?Z|Dac%@@K7UL0AAP1FeA8O-^)|;sHG24HFitpl5oJOCC7&A*l z34HlCV9XpU;5=&KqQr&ybX34>T!BTHfz_CchjBT!qkiw;D(u0vc+2*m+x{o?vA;=9 zTKI?Q)*Nd9Rnj6<=9Q=f!lDprhI*Mc0QIcM!dC3YG0EexRIk0Q7E$SZ)~ zuoAN()VYktL99c^_Qz2lsM)Y1$gSCSA82j)zL9usb_cmyD!a~)ZEo}BGBH^+7b6852b{h l$!<5sGdy|0y+7%=kKAGRVZa@6N8PwPstNaTJeJkz`3pfhmmdHC delta 1287 zcmXxiPe@cz6vy#1I!`BUbku1ytkhDgDgPjf{lU`FMkJ`D7X90}Fp3}=5Cb6w+C-p9 zJq)ppwJL+qhW^kh+_VWJC`v3TS1qETR#s5oU)~<~z0bY(-MQz?xo@d{vOc|792_&Q zZtiv5N3zWNa5%_=E0SY&5R0%7`%vprNVBUv@^K7{@D>(e#yN|*j9=jzoJXzywlbf# zUvy}e&8jfwIm=MBcjt{h#4#oI}sjW(#x_ z=+nOmv(KmvzoHiYaPKX&vSBX9m@mU(Y{0dcz$l(X{XT`|IEXcP-Ho5P@oV&mZ$Ie} z!)(=xA!h_t(lS)$anwKBfjWvF_x>2>F+S_w4`K=9%cw+dy7!YvvwLp-A*NfIcuGeb zen$n&VmFPWsKC{z08KnRY(rJ16P5TO)IU9nn{WVM1kA>9h;cuQTks>QQZY8wA88Cz z|7toNOw{5j+=wH%9;Z=>%;8pCM3p?mLC3Kil}Hj5_%N2@1thkOqCUC_+X5s#F1KYh4mKH9PH0p%NQHeFGz?0Jo85&v{hhJKTlK z*oe((>fJ@BA2l(B`WP3m8JDmZOWD00&!EOrs04l^dzr_9>!XZe9oC`tJAwN6hEWxK zfJ*E=s^aMY>8eCqumShrPCSRI%pKGQkDVV-0kip$&Nhmw$S7*v3~t7^Zu|#nRzr5= zYP(StIDqV5Vpr(&Ffop8xD@jzf=%HLy4$&RjP3q>up+S6Uk\n" "Language-Team: LANGUAGE \n" @@ -116,6 +116,10 @@ msgstr "цвет" msgid "visible" msgstr "видимый" +#: admin_interface/models.py +msgid "static logo" +msgstr "статический логотип" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Оставьте пустым, чтобы по умолчанию использовать логотип Django" diff --git a/admin_interface/locale/tr/LC_MESSAGES/django.mo b/admin_interface/locale/tr/LC_MESSAGES/django.mo index 9a1606f05849b46d88fc1f453c8a202967e0e363..8ae7a127b34efc36eae7c97dafae071e02e2e269 100644 GIT binary patch delta 1034 zcmXxjJ!n%=7=Yo=CQWP7A6qrCT5ar)+B6+R2P-%zI*K~ff(Z5pD#6l<%~Bk)h%OF- zRK-aI2Nhhp2;$Jmv2+nZlvZ2{MQ{*T-#6YI?zzu7$vx*g=R5blD6AD~-@DVxK^dj? zQt$1EID^|w+$bBVh`qRphw(37!k%8CgTLqk;2i270lCW!#4o=uU4VuT4Be=Xr!K zY&lE*o$w_;9Kkneiq~-%f1m@}SiW|lXPHO-ic#c>Q`}t8c{K1vblzDU!FfE1&yhse zH|K&!JpV>^o4llN2*hXmrp_#mZ`GvMIM%ovK!5 aigOD$7gmayt#o#AYPwRb_aC?Bp8W&mHcZd} delta 987 zcmYk*OGs2v7{KvwbkgyakDMk;P3=9-#tbThT!j%r1co3j5*G$V&_2AYYSpS#+6Apz zhzo@_;U)qNL0k$})XI=HE~J(8|Igf@!<_RwbLTw1^PM{zg|~&|TU&NEC?#qq^=T&J z8g5t7P*$rW^0L#}GeGBVx7hP~44X~D7wGqukD>|+h84@Kl(2MB0!*~Km@DxtrL_)e>(COyE zPe$FvOfKRcj^hzr#y(s{Pq2#ya)55sTvyp3kB;v`Hy%JUdL4)G7MjUtXyC6gal)JQ zhXpjnAJLP4K?iQ5C-{Nv8Nbkt_t2C7L9Z~!@sHskdeTwkb%_V)I*-u6o}lZ^)RX_S zbe{9T6D{BcTtO%7r2at}>qLS2uNbVwQ+Abml{+ML89>$DX&Q%DK7M(X~ tJi-6PJ3d1#QcbT{WR@(xCnu?%)~m9Z;-00g>ibnoH)?jWudX!A{{_qTMiu}7 diff --git a/admin_interface/locale/tr/LC_MESSAGES/django.po b/admin_interface/locale/tr/LC_MESSAGES/django.po index 8ae3bba9..f6da6e6e 100644 --- a/admin_interface/locale/tr/LC_MESSAGES/django.po +++ b/admin_interface/locale/tr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: django-admin-interface\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 18:20-0500\n" +"POT-Creation-Date: 2024-03-19 18:27-0500\n" "PO-Revision-Date: 2020-01-29 04:53+0300\n" "Last-Translator: Ishak Okutan \n" "Language-Team: \n" @@ -115,6 +115,10 @@ msgstr "renk" msgid "visible" msgstr "göster" +#: admin_interface/models.py +msgid "static logo" +msgstr "sabit logo" + #: admin_interface/models.py msgid "Leave blank to use the default Django logo" msgstr "Varsayılan Django logosunu kullanmak için boş bırakın" From b4d8d0e33ad903431bf49a961d3fdfc829ebff2a Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Wed, 20 Mar 2024 00:39:53 +0100 Subject: [PATCH 7/8] fix(template): use static template django keys, instead of {{}} new static logo field --- admin_interface/templates/admin/base_site.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_interface/templates/admin/base_site.html b/admin_interface/templates/admin/base_site.html index 935a1bd7..2fe57272 100644 --- a/admin_interface/templates/admin/base_site.html +++ b/admin_interface/templates/admin/base_site.html @@ -170,7 +170,7 @@

{% if theme.logo %} {% elif theme.static_logo_path %} - + {% else %} {% endif %} From ee8c179a9bd19f257dc804b5fbfef3699fc087ed Mon Sep 17 00:00:00 2001 From: Francesco Cataldo Date: Wed, 20 Mar 2024 00:49:13 +0100 Subject: [PATCH 8/8] add missing test for static_logo_relative_url property --- tests/test_models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index aff6ed04..42f5ad87 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -117,6 +117,13 @@ def test_static_path(self): # in the `path` argument of the `static_logo_path` field assert static_logo_directory_path() == settings.LOCAL_FILE_DIR + def test_property_static_logo(self): + theme = Theme.objects.get_active() + theme.static_logo_path = settings.LOCAL_FILE_DIR + "/fake" + theme.save() + + assert theme.static_logo_relative_url == "../fake" + # class AdminInterfaceModelsMultiDBTestCase(TestCase): # databases = ["default", "replica"]