diff --git a/changelog/8683.md b/changelog/8683.md new file mode 100644 index 0000000000..a86d9ed0eb --- /dev/null +++ b/changelog/8683.md @@ -0,0 +1,6 @@ +### Changed +- New design for platform mail form +- sender field is now required to prevent issues with email clients +- CKEditor styling for redesign +- change default values for fields in platform email form + diff --git a/meinberlin/apps/platformemails/forms.py b/meinberlin/apps/platformemails/forms.py index de84d49042..5b2ccc59dc 100644 --- a/meinberlin/apps/platformemails/forms.py +++ b/meinberlin/apps/platformemails/forms.py @@ -17,3 +17,7 @@ class Meta: "people in summer." ), } + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.fields["sender"].required = True diff --git a/meinberlin/apps/platformemails/templates/meinberlin_platformemails/platformemail_form.html b/meinberlin/apps/platformemails/templates/meinberlin_platformemails/platformemail_form.html index a5ed113719..c752ade82e 100644 --- a/meinberlin/apps/platformemails/templates/meinberlin_platformemails/platformemail_form.html +++ b/meinberlin/apps/platformemails/templates/meinberlin_platformemails/platformemail_form.html @@ -1,35 +1,31 @@ -{% extends "a4dashboard/base_dashboard.html" %} +{% extends "base.html" %} {% load i18n %} {% block title %} - {% translate 'Create platform email' %} + {% translate 'Create platform email' %} {% endblock title %} {% block content %} -
-
-

{% translate 'Create platform email' %}

-

- {% blocktranslate %}This email will be sent to all registered and verified users of mein.berlin.de.{% endblocktranslate %} -

-
- {% csrf_token %} - {{ form.media }} -
- {% include 'a4forms/includes/form_field.html' with field=form.sender_name %} - {% include 'a4forms/includes/form_field.html' with field=form.sender %} -
- {% include 'a4forms/includes/form_field.html' with field=form.subject %} - {% include 'a4forms/includes/form_field.html' with field=form.body %} - -
-
-
+
+

{% translate 'Create platform email' %}

+

+ {% blocktranslate %}This email will be sent to all registered and verified users of mein.berlin.de.{% endblocktranslate %} +

+
+ {% csrf_token %} + {{ form.media }} +
+ {% include 'meinberlin_contrib/includes/form_field.html' with field=form.sender_name %} + {% include 'meinberlin_contrib/includes/form_field.html' with field=form.sender %} +
+ {% include 'meinberlin_contrib/includes/form_field.html' with field=form.subject %} + {% include 'meinberlin_contrib/includes/form_field.html' with field=form.body %} + + + +
+
{% endblock content %} diff --git a/meinberlin/apps/platformemails/views.py b/meinberlin/apps/platformemails/views.py index 5c9bb62903..3c070bf358 100644 --- a/meinberlin/apps/platformemails/views.py +++ b/meinberlin/apps/platformemails/views.py @@ -1,4 +1,3 @@ -from django.conf import settings from django.contrib import auth from django.contrib import messages from django.http.response import HttpResponseRedirect @@ -24,11 +23,9 @@ class PlatformEmailCreateView(rules_mixins.PermissionRequiredMixin, generic.Crea def get_form_kwargs(self): kwargs = super().get_form_kwargs() - sender_name = settings.WAGTAIL_SITE_NAME - kwargs["initial"] = { - "sender_name": sender_name, - "sender": settings.CONTACT_EMAIL, + "sender_name": "mein.berlin.de", + "sender": "support@mein.berlin.de", } return kwargs diff --git a/meinberlin/assets/scss/components_user_facing/_narrow-wrapper.scss b/meinberlin/assets/scss/components_user_facing/_narrow-wrapper.scss index 33da001751..831aa4daac 100644 --- a/meinberlin/assets/scss/components_user_facing/_narrow-wrapper.scss +++ b/meinberlin/assets/scss/components_user_facing/_narrow-wrapper.scss @@ -15,6 +15,12 @@ } } +.narrow-wrapper__secondary-cta--left { + padding-left: 0; + margin-left: 0; + text-align: left; +} + .narrow-wrapper__footer { padding: 1em 0 3em; @@ -30,4 +36,4 @@ padding: 1.2em 0 4.6em; } -} \ No newline at end of file +} diff --git a/meinberlin/assets/scss/components_user_facing/ck-editor/_base.scss b/meinberlin/assets/scss/components_user_facing/ck-editor/_base.scss new file mode 100644 index 0000000000..04aad801a5 --- /dev/null +++ b/meinberlin/assets/scss/components_user_facing/ck-editor/_base.scss @@ -0,0 +1,8 @@ +.ck .ck-toolbar { + border: 2px solid black !important; + border-bottom: none !important; +} + +.ck .ck-editor__editable { + border: 2px solid black !important; +} diff --git a/meinberlin/assets/scss/style_user_facing.scss b/meinberlin/assets/scss/style_user_facing.scss index 30becaebed..c0380418c9 100644 --- a/meinberlin/assets/scss/style_user_facing.scss +++ b/meinberlin/assets/scss/style_user_facing.scss @@ -74,5 +74,6 @@ @import "components_user_facing/adhocracy4/a4-textarea-with-counter"; // ck-editor +@import "components_user_facing/ck-editor/base"; @import "components_user_facing/ck-editor/collapsible-fragment"; @import "components_user_facing/ck-editor/iframe"; diff --git a/meinberlin/assets/scss/styles_user_facing/_utility.scss b/meinberlin/assets/scss/styles_user_facing/_utility.scss index bcd341a0e3..42e840e4f4 100644 --- a/meinberlin/assets/scss/styles_user_facing/_utility.scss +++ b/meinberlin/assets/scss/styles_user_facing/_utility.scss @@ -42,6 +42,10 @@ margin-top: 0.5em; } +.mb-1 { + margin-bottom: .5em; +} + .mb-2 { margin-bottom: 1em; }