{% extends "admin_base.html" %} {% import "macros/admin_crud_list.html" as crud %} {% import "macros/admin_management_header.html" as mh %} {% import "macros/modal.html" as modal %} {% import "macros/loading_spinner.html" as spinner %} {% block page_title %}Opinion Polls{% endblock %} {% block extra_head %} {% endblock %} {% block admin_content %}
{{ mh::management_header_simple(title="Opinion Polls", subtitle="Manage polls, designated poll creators, and voter exclusion.", actions_html=" Poll votes report") }} {% set ballot_state = ballot_status.state | default(value="") %} {% if ballot_state == "ready" %}

Voter details form: {{ ballot_status.label }} ({{ ballot_status.fields }} field{% if ballot_status.fields != 1 %}s{% endif %}{% if ballot_status.required %}, required{% else %}, optional{% endif %}) · Change in settings

{% elif ballot_state == "empty" %}

Voter details form (id {{ ballot_status.form_id }}) has no fields — add fields in Forms → Form library, otherwise voters see no details form. Change in settings

{% elif ballot_state == "missing" %}

Voter details form (id {{ ballot_status.form_id }}) no longer exists — pick an existing form in settings.

{% elif ballot_state == "inactive" %}

Voter details form (id {{ ballot_status.form_id }}) is not active — activate it in Forms → Form library.

{% else %}

No voter details form — voters vote without extra details. Pick one by name in settings.

{% endif %} {{ crud::shell_open(config_url="/plugins/opinion-poll/assets/admin/polls_list.json?v=polls-list-v2", mount_id="opinion-poll-list", custom_mount=true) }}
{{ spinner::table_skeleton(colspan=8, lines=3, label="Loading polls…") }}
{{ crud::shell_close() }} {{ crud::shell_open(config_url="/plugins/opinion-poll/assets/admin/creators_list.json", mount_id="opinion-poll-creators", custom_mount=true) }}
{{ spinner::table_skeleton(colspan=4, lines=3, label="Loading creators…") }}
{{ crud::shell_close() }} {{ crud::shell_open(config_url="/plugins/opinion-poll/assets/admin/excluded-voters.json", mount_id="opinion-poll-excluded", custom_mount=true) }}
{{ spinner::table_skeleton(colspan=7, lines=3, label="Loading voters…") }}
{{ crud::shell_close() }}
{{ modal::modal(id="opinionPollCreatorModal", title='Add poll creator', body_html='
', size="sm") }} {{ modal::modal(id="opinionPollVoterModal", title="Voter details", title_html='Voter details', body_html='
', size="lg") }} {{ modal::modal(id="opinionPollVotesModal", title="Poll votes", title_html='Poll votes', body_html='
', footer_html='
', size="xl") }} {{ modal::modal(id="opinionPollEditModal", title='Edit poll', body_html='
', size="lg") }} {% endblock %} {% block scripts %} {% endblock %}