Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#8683] platform-mail: update styling #5919

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/8683.md
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions meinberlin/apps/platformemails/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ class Meta:
"people in summer."
),
}

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.fields["sender"].required = True
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
{% extends "a4dashboard/base_dashboard.html" %}
{% extends "base.html" %}
{% load i18n userindicator %}
{% block title %}
{% translate 'Create platform email' %}
{% translate 'Create platform email' %}
{% endblock title %}
{% block content %}
<div class="container">
{% userindicator %}
<div class="offset-lg-3 col-lg-6">
<h1>{% translate 'Create platform email' %}</h1>
<p class="form-hint">
{% blocktranslate %}This email will be sent to all registered and verified users of mein.berlin.de.{% endblocktranslate %}
</p>
<form novalidate
enctype="multipart/form-data"
action="{{ request.path }}"
method="post">
{% csrf_token %}
{{ form.media }}
<div class="l-tiles-2">
{% include 'a4forms/includes/form_field.html' with field=form.sender_name %}
{% include 'a4forms/includes/form_field.html' with field=form.sender %}
</div>
{% include 'a4forms/includes/form_field.html' with field=form.subject %}
{% include 'a4forms/includes/form_field.html' with field=form.body %}
<div class="u-spacer-bottom">
<input type="submit"
class="btn btn--primary"
name="send"
value="{% translate 'Send' %}" />
<a href="{% url 'wagtail_serve' '' %}" class="btn btn--light">{% translate 'Cancel' %}</a>
</div>
</form>
<div class="narrow-wrapper">
<div class="offset-lg-3 col-lg-6">
Copy link
Contributor

@goapunk goapunk Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not up to scratch about the redesign process, but aren't those bootstrap classes? Is it ok to use them outside of the dashboard (or does this still count as dashboard?) ?

<h1>{% translate 'Create platform email' %}</h1>
<p class="form-hint">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the margin between the heading and the form-hint seems a bit too big compared to the design, but also I'm not sure if that matters ?

{% blocktranslate %}This email will be sent to all registered and verified users of mein.berlin.de.{% endblocktranslate %}
</p>
<form novalidate
enctype="multipart/form-data"
action="{{ request.path }}"
method="post">
{% csrf_token %}
{{ form.media }}
<div class="l-tiles-2">
{% include 'meinberlin_contrib/includes/form_field.html' with field=form.sender_name %}
{% include 'meinberlin_contrib/includes/form_field.html' with field=form.sender %}
</div>
{% include 'meinberlin_contrib/includes/form_field.html' with field=form.subject %}
{% include 'meinberlin_contrib/includes/form_field.html' with field=form.body %}

<div class="narrow-wrapper__secondary-cta narrow-wrapper__secondary-cta--left">
<a href="{% url 'wagtail_serve' '' %}">{% translate 'Cancel' %}</a>
</div>
<button type="submit" class="button button--full-width" name="send">{% translate 'Send' %}</button>
</form>
</div>
</div>
{% endblock content %}
7 changes: 2 additions & 5 deletions meinberlin/apps/platformemails/views.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -30,4 +36,4 @@
padding: 1.2em 0 4.6em;
}

}
}
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions meinberlin/assets/scss/style_user_facing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,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";