Skip to content

Conversation

@openprojects
Copy link
Contributor

@openprojects openprojects commented Jun 5, 2025

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).
Screenshot 2025-06-05 at 16 12 48

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.
Screenshot 2025-06-05 at 16 13 37

@openprojects openprojects force-pushed the Add-Registration-form-description branch 4 times, most recently from a75496a to 1c13312 Compare June 5, 2025 14:26

class RegistrationDescriptionForm(IndicoForm):
description = TextAreaField('Registration Description',
widget=TinyMCEWidget(absolute_urls=True),
Copy link
Member

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.

Copy link
Contributor Author

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.

Comment on lines 19 to 21
event_settings = EventSettingsProxy('registration', defaults={
'registration_description': ''
})
Copy link
Member

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

Comment on lines 43 to 47
return jsonify_template(
'events/registration/management/registration_description.html',
form=form,
event=self.event
)
Copy link
Member

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.

Copy link
Contributor Author

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.

{% set description = event_settings.get(event, 'registration_description') %}
{% if description %}
<div class="registration-description">
{{ description | safe }}
Copy link
Member

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...

Copy link
Member

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 %}
Copy link
Member

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)

@openprojects openprojects force-pushed the Add-Registration-form-description branch from 0fd3809 to 508af94 Compare June 23, 2025 12:03
@openprojects openprojects force-pushed the Add-Registration-form-description branch from 508af94 to 6bfd945 Compare September 24, 2025 14:12
@ThiefMaster ThiefMaster force-pushed the Add-Registration-form-description branch from 6bfd945 to 857c443 Compare December 2, 2025 12:04
@ThiefMaster ThiefMaster added this to the v3.3 milestone Dec 2, 2025
@ThiefMaster ThiefMaster force-pushed the Add-Registration-form-description branch from b7d1cea to 0f2d221 Compare December 2, 2025 12:08
@ThiefMaster ThiefMaster changed the title Add Registration form description Add multi-regform announcement text Dec 2, 2025
@ThiefMaster ThiefMaster enabled auto-merge (squash) December 2, 2025 12:11
@ThiefMaster ThiefMaster merged commit e2a81c9 into indico:master Dec 2, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants