-
Notifications
You must be signed in to change notification settings - Fork 510
Add multi-regform announcement text #6916
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
Add multi-regform announcement text #6916
Conversation
a75496a to
1c13312
Compare
|
|
||
| class RegistrationDescriptionForm(IndicoForm): | ||
| description = TextAreaField('Registration Description', | ||
| widget=TinyMCEWidget(absolute_urls=True), |
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 would prefer markdown here instead of full WYSIWYG HTML.
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.
@OmeGak I hope this will be fine with our needs.
| event_settings = EventSettingsProxy('registration', defaults={ | ||
| 'registration_description': '' | ||
| }) |
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.
This belongs in indico/modules/events/registration/settings.py
| return jsonify_template( | ||
| 'events/registration/management/registration_description.html', | ||
| form=form, | ||
| event=self.event | ||
| ) |
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.
return jsonify_form(form) does everything for you w/o the need for a custom template. The only think you do not get is the info box on top, but that could go in the description of the field instead.
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, for the info message I used the message param, but up to use if you want a different solution.
indico/modules/events/registration/templates/management/regform_list.html
Outdated
Show resolved
Hide resolved
indico/modules/events/registration/templates/management/regform_list.html
Outdated
Show resolved
Hide resolved
| {% set description = event_settings.get(event, 'registration_description') %} | ||
| {% if description %} | ||
| <div class="registration-description"> | ||
| {{ description | safe }} |
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.
This introduces an XSS vulnerability...
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.
For HTML the correct thing to use here would be the sanitize_html filter, and for markdown it's the markdown filter.
| @@ -0,0 +1,14 @@ | |||
| {% from 'forms/_form.html' import form_header, form_footer, form_rows, form_row %} | |||
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.
This template can most likely be removed (see my other comment)
0fd3809 to
508af94
Compare
508af94 to
6bfd945
Compare
6bfd945 to
857c443
Compare
…m_list.html Co-authored-by: Adrian <[email protected]>
…m_list.html Co-authored-by: Adrian <[email protected]>
b7d1cea to
0f2d221
Compare
As discussed, this PR let the Event manager, in case of multiple registration forms, to add a Description field that will be displayed in the available registration form template (see picture).

To configure this "Description field" a new section has been added below the "Registration tags" one, but it will be visible ONLY if multiple registration forms are created.
