-
Notifications
You must be signed in to change notification settings - Fork 502
WIP - Registration form templates at Category level #7111
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: master
Are you sure you want to change the base?
WIP - Registration form templates at Category level #7111
Conversation
| __titles__ = (None, _('Category'), _('Events'), _('Management')) | ||
| category = 1 | ||
| events = 2 | ||
| management = 3 |
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.
By looking at how we use CategoryLogRealm, I don't see the need to add a management attribute. It should be ok to use CategoryLogRealm.category in all cases.
indico/modules/registration/client/js/form/fields/EmailInput.jsx
Outdated
Show resolved
Hide resolved
| return RegistrationFormPrincipalSchema(many=True).jsonify(self.event.registration_forms) | ||
|
|
||
|
|
||
| class RHAPIEventSessionBlocks(RHProtectedEventBase): |
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.
While this RH is used in the registration form, it's entirely related to an event context. I wonder if we should still have a indico.modules.events.registrations module, where some of the event-specific registration code lives.
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.
Since it is used for fetching data for use in the timetable sessions field of the registration from, I think it's ok to belong in the registrations module.
Btw this is related to the question I've asked at the description of this pr and also to @ThiefMaster on matrix, on how much to move to a different module. So let me know if you have a strong opinion about having registrations stuff under 2 modules or not.
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.
I'd say this should stay in the event...
FWIW my initial understanding was that the only thing you're going to move out from modules/events/registration would be:
- RHs for form management
- react components
- possibly models that are not specific to events (or turning some of them into mixins to be used in the actual models such as
Registrationwithin the event)
but not ALL the registration logic...
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.
I've move back almost ALL the registration logic...keeping only those required by the registration form
indico/modules/registration/templates/management/regform_clone.html
Outdated
Show resolved
Hide resolved
| <a href="" class="i-button icon-plus arrow js-dropdown" | ||
| title="Create form" | ||
| data-toggle="dropdown"> | ||
| Create form |
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.
i18n
| {% block create_form_button %} | ||
| {% if event is defined %} | ||
| <a href="" class="i-button icon-plus arrow js-dropdown" | ||
| title="Create form" |
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.
i18n
indico/modules/registration/clone.py
Outdated
| new_form = RegistrationForm(event=event, title=title, cloned_from=regform, | ||
| **{attr: getattr(regform, attr) for attr in attrs}) | ||
| cloner._clone_form_items(regform, new_form, False) | ||
| signals.event.registration.after_registration_form_clone.send(regform, new_form=new_form) |
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.
I'm not sure we need to send this signal. We are sending signals.event.registration_form_created right after calling clone_from_template_regform().
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.
I'm sending that signal because after the normal creation of a regform that signal is sent, plus we do use this signal in the plugin to add extra settings after a regform has been created and other plugins might as well
indico/modules/registration/templates/management/_regform_list_event_features.html
Outdated
Show resolved
Hide resolved
60c86e6 to
12e2282
Compare
Some preamble: this branch is not up to date with the latest master and since rebasing it will have a lot of conflicts, I would rather wait until I get a little bit more clarity on some things before doing so. Also, I was supposed to put the move of the registration module in a separate PR, but I haven't done so yet since it's still not clear if it's the registrations or only registration forms that should go to a different module. In this PR, it is the registrations that's been moved to a different module. (I tried moving only the registration forms at first but it resulted in similar things being found in 2 places). I will eventually create that move PR once this question has been answered.
This PR adds minimal features from the Event registration section into the category: A new registrations section in the category. Option for creating/deleting/editing registration form. Configuring registration form fields and setting the privacy and data retention settings. And then reusing the forms at the events.
Some screenshots: They look the same as the registration forms in the event section.
No registration form at category:
One or more registration forms in the category
If create from template was selected:
@OmeGak, could you please take a first look?