diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index 3bb095d5f49a724601a436c75872f6e1e61ed8e7..7e10759b1090590ad52e49d12b4897ae4aa6d835 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -84,6 +84,7 @@ INSTALLED_APPS = [ "pwa", "ckeditor", "django_js_reverse", + "colorfield", ] merge_app_settings("INSTALLED_APPS", INSTALLED_APPS, True) @@ -362,11 +363,14 @@ CONSTANCE_ADDITIONAL_FIELDS = { 'widget': 'django.forms.Select', "choices": i18n_day_name_choices_lazy }], + "colour_field": ["django.forms.CharField", { + "widget": "colorfield.widgets.ColorWidget" + }], } CONSTANCE_CONFIG = { "SITE_TITLE": ("AlekSIS", _("Site title"), "char_field"), - "COLOUR_PRIMARY": ("#0d5eaf", _("Primary colour")), - "COLOUR_SECONDARY": ("#0d5eaf", _("Secondary colour")), + "COLOUR_PRIMARY": ("#0d5eaf", _("Primary colour"), "colour_field"), + "COLOUR_SECONDARY": ("#0d5eaf", _("Secondary colour"), "colour_field"), "MAIL_OUT_NAME": ("AlekSIS", _("Mail out name")), "MAIL_OUT": (DEFAULT_FROM_EMAIL, _("Mail out address"), "email_field"), "PRIVACY_URL": ("", _("Link to privacy policy"), "url_field"), diff --git a/poetry.lock b/poetry.lock index cddd88404b719f223ed78da94545c39d68fb9848..3cd63a6623ce450777912eb7b931eaa985778452 100644 --- a/poetry.lock +++ b/poetry.lock @@ -389,6 +389,14 @@ version = "5.9.0" [package.dependencies] django-js-asset = ">=1.2.2" +[[package]] +category = "main" +description = "simple color field for your models with a nice color-picker in the admin-interface." +name = "django-colorfield" +optional = false +python-versions = "*" +version = "0.2.1" + [[package]] category = "main" description = "Django live settings with pluggable backends, including Redis." @@ -1978,7 +1986,7 @@ celery = ["Celery", "django-celery-results", "django-celery-beat", "django-celer ldap = ["django-auth-ldap"] [metadata] -content-hash = "9484e75acdde0cb26c243a9408ac2d5b5ea76c92ba925282bfc9db63218cae0c" +content-hash = "1e88a08a068b90ed69f3436a378a03dcabf458a98913ab58b5fd46f3a85d0650" python-versions = "^3.7" [metadata.files] @@ -2134,6 +2142,10 @@ django-ckeditor = [ {file = "django-ckeditor-5.9.0.tar.gz", hash = "sha256:e4d112851a72c5bf8b586e1c674d34084cab16d28f2553ad15cc770d1e9639c7"}, {file = "django_ckeditor-5.9.0-py2.py3-none-any.whl", hash = "sha256:71c3c7bb46b0cbfb9712ef64af0d2a406eab233f44ecd7c42c24bdfa39ae3bde"}, ] +django-colorfield = [ + {file = "django-colorfield-0.2.1.tar.gz", hash = "sha256:2a20722384a1703ff9b91a395de6e2649a8786161f8baff4d21998ba839f9017"}, + {file = "django_colorfield-0.2.1-py2-none-any.whl", hash = "sha256:c22c9cdae8608432adcde09d6e9e05dd4c498207e1cda0ab8fba0ab3ceb85dcd"}, +] django-constance = [ {file = "django-constance-2.6.0.tar.gz", hash = "sha256:12d827f9d5552ee39884fb6fb356f231f32b1ab8958acc715e3d1a6ecf913653"}, ] diff --git a/pyproject.toml b/pyproject.toml index 2b56df2dc86dd3b5008304b16231857abc3110c3..33df6f829b2f78fa42be8264d1df04e4d5218ed5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ django-celery-email = {version="^3.0.0", optional=true} django-jsonstore = "^0.4.1" django-polymorphic = "^2.1.2" django-otp = "0.7.5" +django-colorfield = "^0.2.1" [tool.poetry.extras] ldap = ["django-auth-ldap"]