-
Notifications
You must be signed in to change notification settings - Fork 380
Default to include Wikimedia ID in speaker export #2683
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
base: dev
Are you sure you want to change the base?
Changes from all commits
b1fb683
9c129ad
2320f9a
4a1dd3f
0f1e8e7
6f53939
062c224
cf1144c
de55c5d
a581194
3d67add
2357cae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| {% extends 'account/base.jinja' %} | ||
|
|
||
| {% block head_title %} | ||
| {{ _('Sign Up') }} | ||
| {% endblock head_title %} | ||
|
|
||
| {% block content %} | ||
| <div class='password-reset-container'> | ||
| <h1>{{ _('Sign Up') }}</h1> | ||
|
|
||
|
hongquan marked this conversation as resolved.
|
||
| <p class='description'> | ||
| {% 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) }} | ||
| </p> | ||
|
|
||
| {% if form.non_field_errors() %} | ||
| <div class='alert alert-danger'> | ||
| <i class='fa fa-exclamation-triangle'></i> | ||
| {% for error in form.non_field_errors() %} | ||
| <p>{{ error }}</p> | ||
| {% endfor %} | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| <form method='post' action="{{ url_for('socialaccount_signup') }}" class='password-form'> | ||
|
Saksham-Sirohi marked this conversation as resolved.
|
||
| <input type='hidden' name='csrfmiddlewaretoken' value='{{ csrf_token }}'> | ||
|
|
||
| {% for hidden in form.hidden_fields() %} | ||
| {{ hidden }} | ||
| {% endfor %} | ||
|
|
||
| {% for field in form.visible_fields() %} | ||
| <div class='form-group'> | ||
| <label for='{{ field.id_for_label }}'> | ||
| {{ field.label }} | ||
| {% if field.field.required %}<span class='required'>*</span>{% endif %} | ||
| </label> | ||
| {{ field }} | ||
| {% if field.errors %} | ||
| <div class='field-error'> | ||
| {% for error in field.errors %} | ||
| <span>{{ error }}</span> | ||
| {% endfor %} | ||
| </div> | ||
| {% endif %} | ||
| {% if field.help_text %} | ||
| <div class='field-help'>{{ field.help_text }}</div> | ||
| {% endif %} | ||
| </div> | ||
| {% endfor %} | ||
|
|
||
| {% if redirect_field %} | ||
| {{ redirect_field }} | ||
| {% elif redirect_field_name and redirect_field_value %} | ||
| <input type='hidden' name='{{ redirect_field_name }}' value='{{ redirect_field_value }}'> | ||
| {% endif %} | ||
|
|
||
| <button type='submit' class='btn btn-primary btn-lg'> | ||
| <i class='fa fa-user-plus'></i> | ||
| {{ _('Sign Up') }} | ||
| </button> | ||
| </form> | ||
| </div> | ||
| {% endblock content %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,10 +2,9 @@ | |
| from django.utils.functional import cached_property | ||
| from django.utils.translation import gettext_lazy as _ | ||
|
|
||
| from eventyay.base.models import SubmissionStates, User | ||
| from eventyay.common.text.phrases import phrases | ||
| from eventyay.orga.forms.export import ExportForm | ||
| from eventyay.base.models import User | ||
| from eventyay.base.models import SubmissionStates | ||
|
|
||
|
|
||
| class SpeakerExportForm(ExportForm): | ||
|
|
@@ -54,6 +53,11 @@ def __init__(self, *args, **kwargs): | |
| label=_('Picture License'), | ||
| help_text=_("The license of the speaker's profile picture"), | ||
| ) | ||
| self.fields['wikimedia_username'] = forms.BooleanField( | ||
| required=False, | ||
| label=_('Wikimedia Username'), | ||
| initial=True, | ||
| ) | ||
|
|
||
| @cached_property | ||
| def questions(self): | ||
|
|
@@ -74,6 +78,7 @@ def export_field_names(self): | |
| 'avatar_license', | ||
| 'submission_ids', | ||
| 'submission_titles', | ||
| 'wikimedia_username', | ||
| ] | ||
|
Comment on lines
78
to
82
|
||
|
|
||
| def get_queryset(self): | ||
|
|
@@ -99,6 +104,9 @@ def _get_submission_ids_value(self, obj): | |
| def _get_submission_titles_value(self, obj): | ||
| return list(obj.submissions.filter(event=self.event).values_list('title', flat=True)) | ||
|
|
||
| def _get_wikimedia_username_value(self, obj): | ||
| return obj.wikimedia_username | ||
|
|
||
| def _prepare_object_data(self, obj): | ||
| obj._profile = obj.event_profile(self.event) | ||
| return obj | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the global default for the
include_wikimedia_usernameevent setting from False to True has broader effects than speaker export: it will enable Wikimedia username collection/display in checkout and include it in other exports (e.g. order list export) by default for new events. Please confirm this wider default change is intended; if the goal is only to default the speaker export column to included, this setting default should likely remain False.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hongquan
So, this means the ticketing checkout would always have "wikimedia" enabled? The decision if it is enabled should depend on the ticketing configuration. As far as I understand though, if we have it enabled here, it must be enabled in the ticketing config as well or how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mariobehling This PR makes it enabled at the same time for two places: Ticketing and Speaker export (Talk). These two are not linked yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, in that case there should be a helper text and a link to the other place, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still Wikimedia should not be a default field for all events. E.g. we dont want it on eventyay.com. It is preferable for wikimedia.eventyay.com though.
So, what options are there to control this? Maybe we need a config option for the platform?
In particular events on eventyay.com should not include Wikimedia as a default.