Skip to content

Commit c3b7a4d

Browse files
Changed style of last action button.
1 parent 62e8e17 commit c3b7a4d

3 files changed

Lines changed: 42 additions & 18 deletions

File tree

django/geno/forms.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ def __init__(self, *args, **kwargs):
215215
CollapsibleSection(
216216
_("Mitglieder-Attribute"),
217217
Div(
218-
HTML('<p class="text-xs font-medium text-gray-500 mb-2">{}</p>'.format(_("Filter A"))),
218+
HTML(
219+
'<p class="text-xs font-medium text-gray-500 mb-2">{}</p>'.format(
220+
_("Filter A")
221+
)
222+
),
219223
Div(
220224
Div("select_attributeA", css_class="mb-4"),
221225
Div("select_attributeA_value", css_class="mb-4"),
@@ -224,7 +228,11 @@ def __init__(self, *args, **kwargs):
224228
css_class="mb-4",
225229
),
226230
Div(
227-
HTML('<p class="text-xs font-medium text-gray-500 mb-2">{}</p>'.format(_("Filter B"))),
231+
HTML(
232+
'<p class="text-xs font-medium text-gray-500 mb-2">{}</p>'.format(
233+
_("Filter B")
234+
)
235+
),
228236
Div(
229237
Div("select_attributeB", css_class="mb-4"),
230238
Div("select_attributeB_value", css_class="mb-4"),
@@ -242,9 +250,14 @@ def __init__(self, *args, **kwargs):
242250
Div("select_flag_04", css_class="mb-4"),
243251
Div("select_flag_05", css_class="mb-4"),
244252
Div("ignore_join_date", css_class="mb-4"),
245-
*([Div("share_paid_01", css_class="mb-4"), Div("share_unpaid", css_class="mb-4")]
246-
if settings.GENO_ID == "HSG"
247-
else []),
253+
*(
254+
[
255+
Div("share_paid_01", css_class="mb-4"),
256+
Div("share_unpaid", css_class="mb-4"),
257+
]
258+
if settings.GENO_ID == "HSG"
259+
else []
260+
),
248261
collapsed=True,
249262
),
250263
initial_display="none",

django/geno/templates/geno/member_send_mail.html

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,25 @@ <h3 class="text-lg font-medium text-font-important-light dark:text-font-importan
141141
</a>
142142
{% else %}
143143
{# Submit button with form attribute #}
144-
{% component "unfold/components/button.html" with submit=1 attrs=attrs_button %}
145-
{% trans "Weiter" %}
146-
{% endcomponent %}
147-
{# Back button (shown on steps 2 and 3) #}
148-
{% if back_url %}
149-
{% component "unfold/components/button.html" with href=back_url variant="default" %}
150-
{% trans "Zurück" %}
151-
{% endcomponent %}
152-
{% endif %}
153-
{% endif %}
144+
{% if last_step %}
145+
{% component "unfold/components/button.html" with submit=1 attrs=attrs_button class="bg-red-600" %}
146+
{% trans "Aktion ausführen!" %}
147+
{% endcomponent %}
148+
{% else %}
149+
{% component "unfold/components/button.html" with submit=1 attrs=attrs_button %}
150+
{% trans "Weiter" %}
151+
{% endcomponent %}
152+
{% endif %}
153+
{# Back button (shown on steps 2 and 3) #}
154+
{% if back_url %}
155+
{% component "unfold/components/button.html" with href=back_url variant="default" %}
156+
{% trans "Zurück" %}
157+
{% endcomponent %}
158+
{% endif %}
159+
{% endif %}
160+
</div>
161+
</div>
154162
</div>
155-
</div>
156-
</div>
157163
{% endblock %}
158164

159165
{% block extrajs %}

django/geno/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,9 @@ def send_member_mail_filter_by_invoice(form, member_list):
31483148
if member["id"]:
31493149
count += 1
31503150
if count == 0:
3151-
errors.append(_("Keine Empfänger:innen gefunden, welche diesen Filterkriterien entsprechen."))
3151+
errors.append(
3152+
_("Keine Empfänger:innen gefunden, welche diesen Filterkriterien entsprechen.")
3153+
)
31523154
return errors
31533155

31543156

@@ -3160,6 +3162,7 @@ class MailWizardView(CohivaAdminViewMixin, FormView):
31603162
permission_required = "geno.send_mail"
31613163
template_name = "geno/member_send_mail.html"
31623164
form_class = MemberMailForm
3165+
last_step = False
31633166

31643167
def __init__(self, *args, **kwargs):
31653168
super().__init__(*args, **kwargs)
@@ -3172,6 +3175,7 @@ def get_context_data(self, **kwargs):
31723175
"response": self.result,
31733176
"attrs_button": {"form": "mail-wizard-form"},
31743177
"back_url": self.back_url,
3178+
"last_step": self.last_step,
31753179
}
31763180
)
31773181
# Override title to show step
@@ -3230,6 +3234,7 @@ class MailWizardActionView(MailWizardView):
32303234
form_class = MemberMailActionForm
32313235
form_action = reverse_lazy("geno:mail-wizard-action")
32323236
back_url = reverse_lazy("geno:mail-wizard-select")
3237+
last_step = True
32333238

32343239
def get_initial(self):
32353240
return {"email_copy": settings.GENO_DEFAULT_EMAIL}

0 commit comments

Comments
 (0)