{# The reminder dialog for the groups that have not filled yet. A near-copy of core's `events/registration/management/email.html`, and it has to be a copy rather than a reuse: that template builds the preview URL with the relative endpoint `.email_registrants_preview`, which resolves against whichever blueprint is handling the request -- so rendering it from this plugin's blueprint asks Flask for `plugin_group_registration.email_registrants_preview` and raises `BuildError`. The preview button is **not** core's. Core binds `#preview-email` inside `setupRegistrationList()` (`registration/client/js/reglists.js:39`), and that function is called from one template only -- `management/regform_reglist.html:257`, the registrant list. This dialog opens from the Groups page, where it has never run, so borrowing core's id gave a button with no handler behind it at all. See the note on the button itself. #} {% from 'forms/_form.html' import form_header, form_rows, form_footer %} {% from 'message_box.html' import message_box %} {% if not form %} {% call message_box('info') %} {% trans %}No group on this form is still forming, so there is nobody to remind.{% endtrans %} {% endcall %}
{% else %} {# Two paragraphs rather than two sentences: the box is as wide as the dialog, so run together they come out as one line of small print that nobody finishes reading. `

` is the idiom the message box is built for -- `_messageboxes.scss` already trims the margin off its first and last child paragraph, which is why neither needs a class here. #} {% call message_box('info') %}

{%- trans count=count, groups=group_count, deadline=deadline | format_datetime(timezone=event.tzinfo) -%} One member of a group that is still forming gets this e-mail. Those groups are repriced on {{ deadline }} if they have not filled. {%- pluralize count -%} {{ count }} members of the {{ groups }} groups that are still forming get this e-mail. Those groups are repriced on {{ deadline }} if they have not filled. {%- endtrans -%}

{%- trans %}Each figure below is filled in per recipient from their own group. A group that fills while this dialog is open is dropped when you send.{% endtrans -%}

{% endcall %} {{ form_header(form) }} {{ form_rows(form) }} {% call form_footer(form) %} {# Declarative rather than core's `#preview-email`, and deliberately without that id: `setupActionLinks` in `jquery/utils/declarative.js:101` binds `input:button[data-href][data-ajax-dialog]` on `body` at `$(document).ready` on *every* page, which is the same handler that opens this dialog from the Groups page. So it is there whether or not the registrant list ever loaded. `data-params-selector` is what makes it work without JavaScript of our own: given a JSON object, `getParamsFromSelectors` (`declarative.js:25`) sends `$(selector).val()` for each key, read at click time. `#body` is TinyMCE's hidden input, which the editor writes back to on every keystroke (`tinymce.js:277-282`), so this previews what the organizer is looking at rather than the draft the dialog opened with. That object form of the attribute is what puts the plugin's Indico floor at 3.3.5 -- before it, the string was read as a bare CSS selector, nothing would be posted, and the endpoint would answer 400 on the missing `body`. Core's version also sends `registration_id: getSelectedRows()[0]` -- another registrant-list global that does not exist here, and one `RHRemindFormingGroupsPreview` would ignore anyway: it picks its own recipient, the first member of a group still forming. #} {% endcall %} {% endif %}