diff --git a/README.md b/README.md index 6bad3014..cd035515 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,12 @@ You can add a theme you've created through the admin to this repository by [send ### Add theme support to third-party libraries You can add **theme support to existing third-party libraries** using the following **CSS variables**: +### Body colors +- `--admin-interface-body-background-color` +- `--admin-interface-body-foreground-color` +- `--admin-interface-body-quiet-color` +- `--admin-interface-body-loud-color` + #### Header - `--admin-interface-header-background-color` diff --git a/admin_interface/admin.py b/admin_interface/admin.py index 504fe43b..9f9da4da 100644 --- a/admin_interface/admin.py +++ b/admin_interface/admin.py @@ -73,6 +73,18 @@ class ThemeAdmin(admin.ModelAdmin): ), }, ), + ( + _("Body"), + { + "classes": ("wide",), + "fields": ( + "css_body_foreground_color", + "css_body_background_color", + "css_body_quiet_color", + "css_body_loud_color", + ), + }, + ), ( _("Header"), { diff --git a/admin_interface/locale/de/LC_MESSAGES/django.po b/admin_interface/locale/de/LC_MESSAGES/django.po index 73683d94..4628f077 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-01-10 04:13-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -38,6 +38,10 @@ msgstr "Favicon" msgid "Title" msgstr "Titel" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Header" @@ -173,10 +177,36 @@ msgstr "Code" msgid "display" msgstr "Anzeige" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "Hintergrundfarbe" + #: admin_interface/models.py msgid "background color" msgstr "Hintergrundfarbe" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "Textfarbe" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "Linkfarbe" + #: admin_interface/models.py msgid "text color" msgstr "Textfarbe" diff --git a/admin_interface/locale/es/LC_MESSAGES/django.po b/admin_interface/locale/es/LC_MESSAGES/django.po index b74e44c9..7c618e7b 100644 --- a/admin_interface/locale/es/LC_MESSAGES/django.po +++ b/admin_interface/locale/es/LC_MESSAGES/django.po @@ -10,7 +10,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-01-10 04:13-0600\n" "PO-Revision-Date: 2023-08-04 11:52-0300\n" "Last-Translator: Santiago Muñoz \n" "Language-Team: Spanish \n" @@ -40,6 +40,10 @@ msgstr "Favicon" msgid "Title" msgstr "Título" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Encabezado" @@ -174,10 +178,36 @@ msgstr "código" msgid "display" msgstr "mostrar" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "color de fondo" + #: admin_interface/models.py msgid "background color" msgstr "color de fondo" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "color de texto" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "color de enlace" + #: admin_interface/models.py msgid "text color" msgstr "color de texto" @@ -236,7 +266,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.po b/admin_interface/locale/fa/LC_MESSAGES/django.po index 90d098f9..76ab28b1 100644 --- a/admin_interface/locale/fa/LC_MESSAGES/django.po +++ b/admin_interface/locale/fa/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-01-10 04:13-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Amir Ajorloo \n" "Language-Team: Farsi \n" @@ -37,6 +37,10 @@ msgstr "آیکون تب" msgid "Title" msgstr "عنوان" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "هدر" @@ -172,10 +176,36 @@ msgstr "کد" msgid "display" msgstr "نمایش" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "رنگ پسزمینه" + #: admin_interface/models.py msgid "background color" msgstr "رنگ پسزمینه" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "رنگ متن" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "رنگ لینک" + #: admin_interface/models.py msgid "text color" msgstr "رنگ متن" diff --git a/admin_interface/locale/fr/LC_MESSAGES/django.mo b/admin_interface/locale/fr/LC_MESSAGES/django.mo index 1f254460..32aa1a9d 100644 Binary files a/admin_interface/locale/fr/LC_MESSAGES/django.mo and b/admin_interface/locale/fr/LC_MESSAGES/django.mo differ diff --git a/admin_interface/locale/fr/LC_MESSAGES/django.po b/admin_interface/locale/fr/LC_MESSAGES/django.po index 5b5f1464..faec81f4 100644 --- a/admin_interface/locale/fr/LC_MESSAGES/django.po +++ b/admin_interface/locale/fr/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-01-10 10:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -38,6 +38,10 @@ msgstr "Favicon" msgid "Title" msgstr "Titre" +#: admin_interface/admin.py +msgid "Body" +msgstr "Corps" + #: admin_interface/admin.py msgid "Header" msgstr "Bannière" @@ -174,10 +178,30 @@ msgstr "code" msgid "display" msgstr "affichage" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "Champs requis, messages d'erreur" + +#: admin_interface/models.py +msgid "foreground color" +msgstr "couleur du premier plan" + #: admin_interface/models.py msgid "background color" msgstr "couleur d'arrière-plan" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "Défaut: #666 (champs optionnels, texte d'aide, contenu des champs)" + +#: admin_interface/models.py +msgid "quiet color" +msgstr "couleur discrète" + +#: admin_interface/models.py +msgid "loud color" +msgstr "couleur forte" + #: admin_interface/models.py msgid "text color" msgstr "couleur du texte" diff --git a/admin_interface/locale/it/LC_MESSAGES/django.po b/admin_interface/locale/it/LC_MESSAGES/django.po index 580ab43d..fc08bc03 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-01-10 04:13-0600\n" "PO-Revision-Date: 2018-12-30 19:13-0500\n" "Last-Translator: Fabio Caccamo \n" "Language-Team: Italian \n" @@ -39,6 +39,10 @@ msgstr "Favicon" msgid "Title" msgstr "Titolo" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Header" @@ -175,10 +179,36 @@ msgstr "codice" msgid "display" msgstr "visualizzazione" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "colore di sfondo" + #: admin_interface/models.py msgid "background color" msgstr "colore di sfondo" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "colore del testo" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "colore dei link" + #: admin_interface/models.py msgid "text color" msgstr "colore del testo" diff --git a/admin_interface/locale/pl/LC_MESSAGES/django.po b/admin_interface/locale/pl/LC_MESSAGES/django.po index 127fd7b1..745723a7 100644 --- a/admin_interface/locale/pl/LC_MESSAGES/django.po +++ b/admin_interface/locale/pl/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-01-10 04:13-0600\n" "PO-Revision-Date: 2022-02-04 19:13-0500\n" "Last-Translator: Kamil Paduszyński \n" "Language-Team: Polish \n" @@ -39,6 +39,10 @@ msgstr "Ikonka" msgid "Title" msgstr "Tytuł" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Nagłówek" @@ -175,10 +179,36 @@ msgstr "kod" msgid "display" msgstr "wyświetlaj" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "kolor tła" + #: admin_interface/models.py msgid "background color" msgstr "kolor tła" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "kolor tekstu" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "kolor linku" + #: admin_interface/models.py msgid "text color" msgstr "kolor tekstu" diff --git a/admin_interface/locale/pt_BR/LC_MESSAGES/django.po b/admin_interface/locale/pt_BR/LC_MESSAGES/django.po index 78169b0b..922878bb 100644 --- a/admin_interface/locale/pt_BR/LC_MESSAGES/django.po +++ b/admin_interface/locale/pt_BR/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-01-10 04:13-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -38,6 +38,10 @@ msgstr "Favicon" msgid "Title" msgstr "Título" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Cabeçalho" @@ -176,10 +180,36 @@ msgstr "código" msgid "display" msgstr "exibição" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "cor de fundo" + #: admin_interface/models.py msgid "background color" msgstr "cor de fundo" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "cor do texto" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "cor do link" + #: admin_interface/models.py msgid "text color" msgstr "cor do texto" diff --git a/admin_interface/locale/ru/LC_MESSAGES/django.po b/admin_interface/locale/ru/LC_MESSAGES/django.po index 03a31a31..3e149710 100644 --- a/admin_interface/locale/ru/LC_MESSAGES/django.po +++ b/admin_interface/locale/ru/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-06-23 16:28-0500\n" +"POT-Creation-Date: 2024-01-10 04:13-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,6 +40,10 @@ msgstr "Иконка адресной строки" msgid "Title" msgstr "Заголовок" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Шапка" @@ -176,10 +180,36 @@ msgstr "код" msgid "display" msgstr "отображение" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "цвет заднего фона" + #: admin_interface/models.py msgid "background color" msgstr "цвет заднего фона" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "цвет текста" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "цвет ссылки" + #: admin_interface/models.py msgid "text color" msgstr "цвет текста" diff --git a/admin_interface/locale/tr/LC_MESSAGES/django.po b/admin_interface/locale/tr/LC_MESSAGES/django.po index 8ae3bba9..9d5fc7d9 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-01-10 04:13-0600\n" "PO-Revision-Date: 2020-01-29 04:53+0300\n" "Last-Translator: Ishak Okutan \n" "Language-Team: \n" @@ -39,6 +39,10 @@ msgstr "Favicon" msgid "Title" msgstr "Başlık" +#: admin_interface/admin.py +msgid "Body" +msgstr "" + #: admin_interface/admin.py msgid "Header" msgstr "Üst Kısım" @@ -177,10 +181,36 @@ msgstr "kod" msgid "display" msgstr "görüntüle" +#: admin_interface/models.py +msgid "Required fields, error messages" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "background color" +msgid "foreground color" +msgstr "arka plan rengi" + #: admin_interface/models.py msgid "background color" msgstr "arka plan rengi" +#: admin_interface/models.py +msgid "Optional fields, help text, field content" +msgstr "" + +#: admin_interface/models.py +#, fuzzy +#| msgid "text color" +msgid "quiet color" +msgstr "metin rengi" + +#: admin_interface/models.py +#, fuzzy +#| msgid "link color" +msgid "loud color" +msgstr "bağlantı rengi" + #: admin_interface/models.py msgid "text color" msgstr "metin rengi" diff --git a/admin_interface/migrations/0031_theme_css_body_background_color_and_more.py b/admin_interface/migrations/0031_theme_css_body_background_color_and_more.py new file mode 100644 index 00000000..ccea5507 --- /dev/null +++ b/admin_interface/migrations/0031_theme_css_body_background_color_and_more.py @@ -0,0 +1,65 @@ +# Generated by Django 5.0.1 on 2024-01-08 15:37 + +import colorfield.fields +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("admin_interface", "0030_theme_collapsible_stacked_inlines_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="theme", + name="css_body_background_color", + field=colorfield.fields.ColorField( + blank=True, + default="#fff", + help_text="#fff", + image_field=None, + max_length=10, + samples=None, + verbose_name="background color", + ), + ), + migrations.AddField( + model_name="theme", + name="css_body_foreground_color", + field=colorfield.fields.ColorField( + blank=True, + default="#333", + help_text="#333", + image_field=None, + max_length=10, + samples=None, + verbose_name="foreground color", + ), + ), + migrations.AddField( + model_name="theme", + name="css_body_loud_color", + field=colorfield.fields.ColorField( + blank=True, + default="#000", + help_text="#000", + image_field=None, + max_length=10, + samples=None, + verbose_name="loud color", + ), + ), + migrations.AddField( + model_name="theme", + name="css_body_quiet_color", + field=colorfield.fields.ColorField( + blank=True, + default="#666", + help_text="#666", + image_field=None, + max_length=10, + samples=None, + verbose_name="quiet color", + ), + ), + ] diff --git a/admin_interface/migrations/0032_alter_theme_css_body_foreground_color_and_more.py b/admin_interface/migrations/0032_alter_theme_css_body_foreground_color_and_more.py new file mode 100644 index 00000000..0a3293fd --- /dev/null +++ b/admin_interface/migrations/0032_alter_theme_css_body_foreground_color_and_more.py @@ -0,0 +1,39 @@ +# Generated by Django 5.0.1 on 2024-01-10 10:09 + +import colorfield.fields +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("admin_interface", "0031_theme_css_body_background_color_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="theme", + name="css_body_foreground_color", + field=colorfield.fields.ColorField( + blank=True, + default="#333", + help_text="Required fields, error messages", + image_field=None, + max_length=10, + samples=None, + verbose_name="foreground color", + ), + ), + migrations.AlterField( + model_name="theme", + name="css_body_quiet_color", + field=colorfield.fields.ColorField( + blank=True, + default="#666", + help_text="Optional fields, help text, field content", + image_field=None, + max_length=10, + samples=None, + verbose_name="quiet color", + ), + ), + ] diff --git a/admin_interface/models.py b/admin_interface/models.py index a29f5238..bf8f6a8b 100644 --- a/admin_interface/models.py +++ b/admin_interface/models.py @@ -156,6 +156,35 @@ class Theme(models.Model): verbose_name=_("display"), ) + css_body_foreground_color = ColorField( + blank=True, + default="#333", + help_text=_("Required fields, error messages"), + max_length=10, + verbose_name=_("foreground color"), + ) + css_body_background_color = ColorField( + blank=True, + default="#fff", + help_text="#fff", + max_length=10, + verbose_name=_("background color"), + ) + css_body_quiet_color = ColorField( + blank=True, + default="#666", + help_text=_("Optional fields, help text, field content"), + max_length=10, + verbose_name=_("quiet color"), + ) + css_body_loud_color = ColorField( + blank=True, + default="#000", + help_text="#000", + max_length=10, + verbose_name=_("loud color"), + ) + css_header_background_color = ColorField( blank=True, default="#0C4B33", diff --git a/admin_interface/static/admin_interface/css/admin-interface.css b/admin_interface/static/admin_interface/css/admin-interface.css index c0768ae2..2aa67e6b 100644 --- a/admin_interface/static/admin_interface/css/admin-interface.css +++ b/admin_interface/static/admin_interface/css/admin-interface.css @@ -43,6 +43,18 @@ } } +:root .admin-interface { + --body-fg: var(--admin-interface-body-foreground-color); + --body-bg: var(--admin-interface-body-background-color); + --body-quiet-color: var(--admin-interface-body-quiet-color); + --body-loud-color: var(--admin-interface-body-loud-color); +} + +body.admin-interface { + color: var(--admin-interface-body-foreground-color); + background: var(--admin-interface-body-background-color); +} + .admin-interface { overflow-x: hidden; } diff --git a/admin_interface/templates/admin/base_site.html b/admin_interface/templates/admin/base_site.html index 9df49110..31447f07 100644 --- a/admin_interface/templates/admin/base_site.html +++ b/admin_interface/templates/admin/base_site.html @@ -16,6 +16,10 @@ --admin-interface-logo-color: {{ theme.logo_color }}; --admin-interface-logo-default-background-image: url("data:image/svg+xml;utf8,"); --admin-interface-env-color: {{ theme.env_color }}; + --admin-interface-body-foreground-color: {{ theme.css_body_foreground_color }}; + --admin-interface-body-background-color: {{ theme.css_body_background_color }}; + --admin-interface-body-quiet-color: {{ theme.css_body_quiet_color }}; + --admin-interface-body-loud-color: {{ theme.css_body_loud_color }}; --admin-interface-header-background-color: {{ theme.css_header_background_color }}; --admin-interface-header-text-color: {{ theme.css_header_text_color }}; --admin-interface-header-link-color: {{ theme.css_header_link_color }};