diff --git a/.github/instructions/jinja.instructions.md b/.github/instructions/jinja.instructions.md new file mode 100644 index 00000000000..f1c229a5d7f --- /dev/null +++ b/.github/instructions/jinja.instructions.md @@ -0,0 +1,16 @@ +--- +applyTo: "app/eventyay/**/jinja-templates/**/*.jinja" +--- + +# Jinja Template Instructions + +## Formatting + +- Prefer single quotes in template markup and expressions. +- Use different quote styles when nesting quotes inside expressions. +- Use 2-space indentation. + +## Template logic + +- Keep templates focused on presentation. Move non-trivial business logic to Python views/forms/helpers. +- Avoid complex conditional chains inside HTML attributes. Compute values before rendering when possible. diff --git a/app/eventyay/base/configurations/default_setting.py b/app/eventyay/base/configurations/default_setting.py index 3c013ad9192..6219c46fb53 100644 --- a/app/eventyay/base/configurations/default_setting.py +++ b/app/eventyay/base/configurations/default_setting.py @@ -15,7 +15,6 @@ from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_noop, pgettext, pgettext_lazy from i18nfield.forms import I18nFormField, I18nTextarea, I18nTextInput -from eventyay.base.forms import I18nAutoExpandingTextarea from i18nfield.strings import LazyI18nString from rest_framework import serializers @@ -27,7 +26,7 @@ from eventyay.base.configurations.lazy_i18n_string_list_base import ( LazyI18nStringList, ) -from eventyay.base.forms import I18nURLFormField +from eventyay.base.forms import I18nAutoExpandingTextarea, I18nURLFormField from eventyay.base.models.tax import TaxRule from eventyay.base.reldate import ( RelativeDateField, @@ -234,7 +233,7 @@ def primary_font_kwargs(): ), }, 'include_wikimedia_username': { - 'default': 'False', + 'default': 'True', 'type': bool, 'form_class': forms.BooleanField, 'serializer_class': serializers.BooleanField, @@ -2790,7 +2789,7 @@ def primary_font_kwargs(): ), 'concatenation': lambda d: ( str(d.get('family_name', '')) - + str((', ' if d.get('family_name') and d.get('given_name') else '')) + + str(', ' if d.get('family_name') and d.get('given_name') else '') + str(d.get('given_name', '')) ), 'sample': { @@ -2893,7 +2892,7 @@ def primary_font_kwargs(): ), 'concatenation': lambda d: ( ' '.join(str(p) for p in (d.get(key, '') for key in ['title', 'given_name', 'family_name']) if p) - + str((', ' if d.get('degree') else '')) + + str(', ' if d.get('degree') else '') + str(d.get('degree', '')) ), 'sample': { diff --git a/app/eventyay/jinja-templates/socialaccount/signup.jinja b/app/eventyay/jinja-templates/socialaccount/signup.jinja new file mode 100644 index 00000000000..a628e62dcd5 --- /dev/null +++ b/app/eventyay/jinja-templates/socialaccount/signup.jinja @@ -0,0 +1,67 @@ +{% extends 'account/base.jinja' %} + +{% block head_title %} + {{ _('Sign Up') }} +{% endblock head_title %} + +{% block content %} +
+ {% set provider_name = account.get_provider().name %} + {{ _( + 'You are about to use your {provider_name} account to login to {site_name}. ' + 'As a final step, please complete the following form:' + ).format(provider_name=provider_name, site_name=site.name) }} +
+ + {% if form.non_field_errors() %} +{{ error }}
+ {% endfor %} +