# HG changeset patch # User Goffi # Date 1638290386 -3600 # Node ID 67487063f42159175f6c31915d8ad470305880e3 # Parent a24d362796beb6f96ca3264962bc25765c6f6690 fix membership following changes with new theme diff -r a24d362796be -r 67487063f421 pages/association/membership/page_meta.py --- a/pages/association/membership/page_meta.py Tue Nov 30 17:38:36 2021 +0100 +++ b/pages/association/membership/page_meta.py Tue Nov 30 17:39:46 2021 +0100 @@ -63,8 +63,7 @@ "The form you posted is not complete, we can't validate this membership request.\n" "Please fill all the required fields, thank you!") -@defer.inlineCallbacks -def on_data_post(self, request): +async def on_data_post(self, request): data = FormData(*self.getPostedData(request, FIELDS, raise_on_missing=False)) if any(not getattr(data, f) for f in REQUIRED): log.warning("missing data fields:\n{data}".format(data=data)) @@ -77,13 +76,13 @@ None, "email_admins_list", default=Exception) - yield email.sendEmail( + await email.sendEmail( self.host.main_conf, addresses, SUBJECT_ADMIN, BODY_ADMIN.format(**data._asdict()), ) - yield email.sendEmail( + await email.sendEmail( self.host.main_conf, data.email, SUBJECT, diff -r a24d362796be -r 67487063f421 templates/default/association/membership.html --- a/templates/default/association/membership.html Tue Nov 30 17:38:36 2021 +0100 +++ b/templates/default/association/membership.html Tue Nov 30 17:39:46 2021 +0100 @@ -3,71 +3,66 @@ {% import 'input/field.html' as field with context %} {% block body %} -

{% trans %}Salut à Toi association membership request{% endtrans %}

-

{% trans %}Please fill the form below if you're willing to join the Salut à Toi association.{% endtrans %}

+

{% trans %}Salut à Toi association membership request{% endtrans %}

+
+
{% trans %}Please fill the form below if you're willing to join the Salut à Toi association.{% endtrans %}
+
- {% call form.form(class="form--paper form__panel--center") %} -

{% trans %}Identity{% endtrans %}

+ {% call form.form() %} {{ field.text("firstname", _("firstname"), placeholder=_("Given name"), required=true, - class="form__field--big") }} + ) }} {{ field.text("name", _("name"), placeholder=_("Family name"), required=true, - class="form__field--big") }} + ) }} {{ field.textarea("address", _("address"), placeholder=_("Address, post code, city"), required=true, - class="form__field--big") }} -

{% trans %}Contacts{% endtrans %}

+ ) }} {{ field.email("email", _("email address"), placeholder=_("please double check your email address"), required=true, - class="form__field--big") }} + ) }} {{ field.text("jid", "Jabber ID", placeholder=_("XMPP identifier (may be your SàT login)"), - class="form__field--big") }} -

{% trans %}Subscription{% endtrans %}

- {{ field.select("subscription", - (("0", _("0€")), - ("10", _("10€")), - ("20", _("20€")), - ("30", _("30€")), - ("50", _("50€")), - ("80", _("80€")), - ("100", _("100€"))), - selected=["10"], - required=true, - class="form__field--big", - ) }} -

{% trans %}Reference{% endtrans %}

+ ) }} + {{ field.text("reference", _("reference (in case of renewal)"), placeholder=_("Your adherent number. You may let empty if you don't know it."), - class="form__field--big") }} -

{% trans %}Comment{% endtrans %}

+ ) }} {{ field.textarea("comment", _("comment"), placeholder=_("This is a free field if you have anything to say or request."), - class="form__field--big") }} - + ) }} {{ field.checkbox("mailing_list", - _("I would like to subscribe to the adherents' mailing list (low traffic)."), checked=true) }} + {% trans %}I would like to subscribe to the adherents' mailing list (low traffic).{% endtrans %} {{ field.checkbox("documents_read", - _("I have read the %(statutes)s and %(rules)s and I agree with both of them", - statutes=''|safe + _("statutes") + ''|safe, - rules=''|safe + _("rules") + ''|safe, - ), checked=false, required=true) }} - {{ field.submit(_("join the association"), id="membership_submit") }} + {% trans statutes=''|safe + _("statutes") + ''|safe, rules=''|safe + _("rules") + ''|safe %}I have read the {{statutes}} and {{rules}} and I agree with both of them{% endtrans %} + {{ field.submit(_("join the association"), id="membership_submit", class="mt-3") }} {% endcall %}