2018-06-12 12:31:38 +00:00
{% extends "bases/bootstrap-with-nav.html" %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block content %}
2018-06-14 16:01:14 +00:00
< script type = "text/javascript" >
// This events list is generated for later input validation
var events_list = [
{% for event in events %}
{% if not forloop.first %},{% endif %}
{
title: "{{ event.title }}",
slug: "{{ event.EID }}"
}
{% endfor %}
];
// This list of demo user emails will be used for input validation
var user_emails = [
{% for user in demo_users %}
{% if not forloop.first %},{% endif %}
{
email: "{{ user.email }}"
}
{% endfor %}
];
< / script >
2018-06-12 12:31:38 +00:00
<!-- The following UI was ported from the Election Authority UI in DEMOS1 by Vincent de Almeida -->
<!-- The DEMOS1 repository can be found at: https://github.com/mlevogiannis/demos - voting -->
<!-- TODO: look into i18n translations as this was a feature implemented in DEMOS1 -->
< div class = "container" >
< div class = "page-header" >
< h2 > Create New Event with Polls< / h2 >
< / div >
< div class = "row" >
< div class = "col-xs-12" >
< form id = "election-form" class = "form-horizontal" method = "POST" novalidate >
{% csrf_token %}
<!-- TODO: Have not imported the if form not valid template code as this needs further investigating -->
<!-- Name -->
2018-06-14 16:01:14 +00:00
< div class = "form-group" >
2018-06-12 12:31:38 +00:00
< label for = "name-input" class = "col-sm-3 col-md-2 control-label" > Name:< / label > <!-- This text can be a template variable -->
< div class = "col-sm-9 col-md-10" >
2018-06-26 16:02:36 +00:00
< input type = "text" class = "form-control input-control" id = "name-input" placeholder = "Example: EU Election" name = "name-input" maxlength = "255" { % if invalid_fields % } value = "{{ invalid_fields.event_name_data.val }}" { % endif % } >
2018-06-14 16:01:14 +00:00
< span id = "name-input-hint-block" class = "help-block" >
2018-06-12 12:31:38 +00:00
A short and clear name.
2018-06-14 16:01:14 +00:00
< / span >
< span id = "name-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.event_name %}{{ invalid_fields.event_name.error }}{% endif %}
2018-06-12 12:31:38 +00:00
< / span >
< / div >
< / div >
<!-- Slug / Identifier -->
2018-06-14 16:01:14 +00:00
< div class = "form-group" >
2018-06-12 12:31:38 +00:00
< label for = "identifier-input" class = "col-sm-3 col-md-2 control-label" > Identifier:< / label > <!-- This text can be a template variable -->
< div class = "col-sm-9 col-md-10" >
2018-06-26 16:02:36 +00:00
< input type = "text" class = "form-control input-control" id = "identifier-input" placeholder = "Example: eu-election" name = "identifier-input" maxlength = "255" { % if invalid_fields % } value = "{{ invalid_fields.identifier_data.val }}" { % endif % } >
2018-06-12 12:31:38 +00:00
< span id = "identifier-input-help-block" class = "help-block" >
Used in the election URL, it must only consist of letters, numbers, underscores or hyphens; no whitespace is permitted.
2018-06-14 16:01:14 +00:00
< / span >
< span id = "identifier-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.identifier %}{{ invalid_fields.identifier.error }}{% endif %}
2018-06-12 12:31:38 +00:00
< / span >
< / div >
< / div >
<!-- Voting start time -->
2018-06-14 16:01:14 +00:00
< div class = "form-group " >
2018-06-12 12:31:38 +00:00
< label for = "vote-start-input" class = "col-sm-3 col-md-2 control-label" > Voting starts at:< / label >
< div class = "col-sm-9 col-md-10" >
< div class = "input-group date" >
2018-06-26 16:02:36 +00:00
< input type = "text" class = "form-control input-control" data-date-format = "YYYY-MM-DD H:mm Z" id = "vote-start-input" name = "vote-start-input" { % if invalid_fields % } value = "{{ invalid_fields.starts_at_data.val }}" { % endif % } >
2018-06-12 12:31:38 +00:00
< span class = "input-group-addon btn" >
< i class = "fa fa-calendar" aria-hidden = "true" > < / i >
/
< i class = "fa fa-clock-o" aria-hidden = "true" > < / i >
< / span >
< / div >
< span id = "vote-start-input-help-block" class = "help-block" >
2018-06-13 12:01:55 +00:00
Date and time when registered voters can commence voting. This includes the UTC offset starting with '+'.
2018-06-12 12:31:38 +00:00
< / span >
2018-06-14 16:01:14 +00:00
< span id = "vote-start-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.starts_at %}{{ invalid_fields.starts_at.error }}{% endif %}
2018-06-14 16:01:14 +00:00
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
<!-- Voting end time -->
2018-06-14 16:01:14 +00:00
< div class = "form-group " >
2018-06-12 12:31:38 +00:00
< label for = "vote-end-input" class = "col-sm-3 col-md-2 control-label" > Voting ends at:< / label >
< div class = "col-sm-9 col-md-10" >
< div class = "input-group date" >
2018-06-26 16:02:36 +00:00
< input type = "text" class = "form-control input-control" data-date-format = "YYYY-MM-DD H:mm Z" id = "vote-end-input" name = "vote-end-input" { % if invalid_fields % } value = "{{ invalid_fields.ends_at_data.val }}" { % endif % } >
2018-06-12 12:31:38 +00:00
< span class = "input-group-addon btn" >
< i class = "fa fa-calendar" aria-hidden = "true" > < / i >
/
< i class = "fa fa-clock-o" aria-hidden = "true" > < / i >
< / span >
< / div >
< span id = "vote-end-input-help-block" class = "help-block" >
2018-06-13 12:01:55 +00:00
Date and time when registered voters can no longer vote. This includes the UTC offset starting with '+'.
2018-06-12 12:31:38 +00:00
< / span >
2018-06-14 16:01:14 +00:00
< span id = "vote-end-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.ends_at %}{{ invalid_fields.ends_at.error }}{% endif %}
2018-06-14 16:01:14 +00:00
< / span >
2018-06-19 14:15:42 +00:00
< span id = "event-timings-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.event_timings %}{{ invalid_fields.event_timings.error }}{% endif %}
2018-06-19 14:15:42 +00:00
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
2018-06-18 16:09:44 +00:00
<!-- Questions -->
2018-06-12 12:31:38 +00:00
< div class = "form-group" >
2018-06-18 16:09:44 +00:00
< label for = "questions-input" class = "col-sm-3 col-md-2 control-label" > Polls:< / label > <!-- This text can be a template variable -->
2018-06-12 12:31:38 +00:00
< div class = "col-sm-9 col-md-10" >
2018-06-14 16:01:14 +00:00
< div class = "form-group" >
2018-06-19 14:15:42 +00:00
< table id = "polls-input-table" class = "table table-hover" >
2018-06-12 12:31:38 +00:00
< thead >
< tr >
< th class = "text-center" > #< / th >
2018-06-18 16:09:44 +00:00
< th > Question / Statement< / th >
2018-06-12 12:31:38 +00:00
< th class = "text-center" > Actions< / th >
< / tr >
< / thead >
2018-06-19 14:15:42 +00:00
< tbody class = "formset questions-formset" data-formset-prefix = "polls" data-formset-type = "modal" data-formset-modal-title = "Add a New Poll" >
2018-06-26 16:02:36 +00:00
{% if invalid_fields %}
{% for poll in invalid_fields.polls_data.val %}
<!-- Poll -->
< tr class = "formset-form" data-formset-form-prefix = "poll" >
<!-- # -->
< td class = "formset-form-index text-center" scope = row >
{{ forloop.counter }}
< / td >
<!-- Question / Statement Label -->
< th class = "formset-form-name" >
{{ poll.name.val }}
< / th >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-edit" aria-label = "Edit" >
< i class = "fa fa-pencil-square-o" aria-hidden = "true" > < / i >
< / button >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< td class = "hidden" >
< div class = "formset-form-fields" >
<!-- Name -->
< div class = "form-group dialogFormField" >
< label for = "question-name-input" > Question / Statement< / label >
< input type = "text" class = "form-control dialogQ" id = "question-name-input-{{ poll.no.val }}" name = "question-name-input-{{ poll.no.val }}" placeholder = "Example: Elections for the European Parliament" maxlength = "200" value = "{{ poll.name.val }}" >
< span id = "question-name-input-help-block" class = "help-block" >
Question / Statement that will be put forward to voters along with the below options.
< / span >
< span id = "question-input-error-block-{{ poll.no.val }}" class = "help-block errorText" >
<!-- Errors flagged here -->
{% if poll.errors.val.name %}{{ poll.errors.val.name.val }}{% endif %}
< / span >
< / div >
<!-- Options -->
< div class = "form-group dialogFormField" >
< label for = "options-table" > Options< / label >
< table id = "options-table" class = "table table-hover" >
< thead >
< tr >
< th class = "text-center" > #< / th >
< th > Option< / th >
< th class = "text-center" > Actions< / th >
< / tr >
< / thead >
< tbody id = "sort" class = "formset option-formset" data-formset-prefix = "options" data-formset-type = "inline" >
{% for option in poll.options.val %}
<!-- Option -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "option" >
<!-- # -->
< th class = "formset-form-index text-center" scope = row >
{{ forloop.counter }}
< / th >
<!-- Option Label -->
< td >
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control dialogO" placeholder = "Example: Candidate 1" id = "option-name-input-{{ poll.no.val }}" name = "option-name-input-{{ poll.no.val }}" maxlength = "200" value = "{{ option }}" >
< / div >
< / td >
<!-- Delete Action -->
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% endfor %}
<!-- Option: Hidden -->
< tr class = "formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix = "option" >
<!-- # -->
< th class = "formset-form-index text-center" scope = row >
X
< / th >
<!-- Option Label -->
< td >
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control dialogO" placeholder = "Example: Candidate X" id = "option-name-input-{{ poll.no.val }}" name = "option-name-input-{{ poll.no.val }}" maxlength = "200" >
< / div >
< / td >
<!-- Delete Action -->
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
< / tbody >
< / table >
< div class = "clearfix" >
< button type = "button" class = "btn btn-primary formset-add" data-formset-prefix = "options" >
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
Add Poll Option
< / button >
< / div >
< span id = "question-input-help-block" class = "help-block" >
Drag and drop to re-order options.
< / span >
< span id = "options-input-error-block-{{ poll.no.val }}" class = "help-block errorText" >
<!-- Errors flagged here -->
{% if poll.errors.val.options %}{{ poll.errors.val.options.val }}{% endif %}
< / span >
< / div >
<!-- Number of option selections -->
< div class = "form-group dialogFormField" >
< label for = "selections-input" class = "control-label" > Number of Selections:< / label > <!-- This text can be a template variable -->
< div class = "row" >
< div class = "col-xs-6" >
< label class = "sr-only" for = "minimum-input" > Minimum< / label >
< input type = "number" class = "form-control min-input" id = "minimum-input-{{ poll.no.val }}" placeholder = "Minimum" value = "{{ poll.min_selection.val }}" name = "minimum-input-{{ poll.no.val }}" min = "0" max = "{{ poll.options.val.length }}" > <!-- Max is the default number of options initially displayed (2) -->
< / div >
< div class = "col-xs-6" >
< label class = "sr-only" for = "maximum-input" > Maximum< / label >
< input type = "number" class = "form-control max-input" id = "maximum-input-{{ poll.no.val }}" placeholder = "Maximum" value = "{{ poll.max_selection.val }}" name = "maximum-input-{{ poll.no.val }}" min = "1" max = "{{ poll.options.val.length }}" > <!-- Max is the default number of options initially displayed (2) -->
< / div >
< / div >
< span id = "question-input-help-block" class = "help-block" >
Minimum and maximum number of option selections that a voter can make for the specified question / statement.
< / span >
< span id = "selections-input-error-block-{{ poll.no.val }}" class = "help-block errorText" >
<!-- Errors flagged here -->
{% if poll.errors.val.min_max %}{{ poll.errors.val.min_max.val }}{% endif %}
< / span >
< / div >
< / div >
< / td >
< / tr >
{% endfor %}
{% else %}
<!-- Poll -->
< tr class = "formset-form formset-form-empty hidden" data-formset-form-prefix = "poll" >
<!-- # -->
< td class = "formset-form-index text-center" scope = row >
1
< / td >
<!-- Question / Statement Label -->
< th class = "formset-form-name" >
<!-- Q Label Goes Here -->
< / th >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-edit" aria-label = "Edit" >
< i class = "fa fa-pencil-square-o" aria-hidden = "true" > < / i >
< / button >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< td class = "hidden" >
< div class = "formset-form-fields" >
<!-- Name -->
< div class = "form-group dialogFormField" >
< label for = "question-name-input" > Question / Statement< / label >
< input type = "text" class = "form-control dialogQ" id = "question-name-input" name = "question-name-input" placeholder = "Example: Elections for the European Parliament" maxlength = "200" >
< span id = "question-name-input-help-block" class = "help-block" >
Question / Statement that will be put forward to voters along with the below options.
< / span >
< span id = "question-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
< / span >
< / div >
<!-- Options -->
< div class = "form-group dialogFormField" >
< label for = "options-table" > Options< / label >
< table id = "options-table" class = "table table-hover" >
< thead >
< tr >
< th class = "text-center" > #< / th >
< th > Option< / th >
< th class = "text-center" > Actions< / th >
< / tr >
< / thead >
< tbody id = "sort" class = "formset option-formset" data-formset-prefix = "options" data-formset-type = "inline" >
<!-- Option -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "option" >
<!-- # -->
< th class = "formset-form-index text-center" scope = row >
1
< / th >
<!-- Option Label -->
< td >
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control dialogO" placeholder = "Example: Candidate 1" id = "option-name-input" name = "option-name-input" maxlength = "200" >
< / div >
< / td >
<!-- Delete Action -->
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
<!-- Option -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "option" >
<!-- # -->
< th class = "formset-form-index text-center" scope = row >
2
< / th >
<!-- Option Label -->
< td >
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control dialogO" placeholder = "Example: Candidate 2" id = "option-name-input" name = "option-name-input" maxlength = "200" >
< / div >
< / td >
<!-- Delete Action -->
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
<!-- Option: Hidden -->
< tr class = "formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix = "option" >
<!-- # -->
< th class = "formset-form-index text-center" scope = row >
X
< / th >
<!-- Option Label -->
< td >
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control dialogO" placeholder = "Example: Candidate X" id = "option-name-input" name = "option-name-input" maxlength = "200" >
< / div >
< / td >
<!-- Delete Action -->
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
< / tbody >
< / table >
< div class = "clearfix" >
< button type = "button" class = "btn btn-primary formset-add" data-formset-prefix = "options" >
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
Add Poll Option
< / button >
< / div >
< span id = "question-input-help-block" class = "help-block" >
Drag and drop to re-order options.
< / span >
< span id = "options-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
< / span >
< / div >
<!-- Number of option selections -->
< div class = "form-group dialogFormField" >
< label for = "selections-input" class = "control-label" > Number of Selections:< / label > <!-- This text can be a template variable -->
< div class = "row" >
< div class = "col-xs-6" >
< label class = "sr-only" for = "minimum-input" > Minimum< / label >
< input type = "number" class = "form-control min-input" id = "minimum-input" placeholder = "Minimum" value = "" name = "minimum-input" min = "0" max = "2" > <!-- Max is the default number of options initially displayed (2) -->
2018-06-18 16:09:44 +00:00
< / div >
2018-06-26 16:02:36 +00:00
< div class = "col-xs-6" >
< label class = "sr-only" for = "maximum-input" > Maximum< / label >
< input type = "number" class = "form-control max-input" id = "maximum-input" placeholder = "Maximum" value = "" name = "maximum-input" min = "1" max = "2" > <!-- Max is the default number of options initially displayed (2) -->
2018-06-18 16:09:44 +00:00
< / div >
2018-06-26 16:02:36 +00:00
< / div >
< span id = "question-input-help-block" class = "help-block" >
Minimum and maximum number of option selections that a voter can make for the specified question / statement.
< / span >
< span id = "selections-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
< / span >
2018-06-18 16:09:44 +00:00
< / div >
< / div >
2018-06-26 16:02:36 +00:00
< / td >
< / tr >
{% endif %}
2018-06-12 12:31:38 +00:00
< / tbody >
< / table >
< div class = "clearfix" >
2018-06-19 14:15:42 +00:00
< button type = "button" class = "btn btn-primary formset-add" data-formset-prefix = "polls" >
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
2018-06-18 16:09:44 +00:00
Add Poll
2018-06-12 12:31:38 +00:00
< / button >
< / div >
< span id = "question-input-help-block" class = "help-block" >
2018-06-18 16:09:44 +00:00
Drag and drop to re-order polls.
2018-06-12 12:31:38 +00:00
< / span >
2018-06-19 14:15:42 +00:00
< span id = "polls-input-error-block" class = "help-block errorText" >
2018-06-14 16:01:14 +00:00
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.polls_errors %}{{ invalid_fields.polls_errors.error }}{% endif %}
2018-06-14 16:01:14 +00:00
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
< / div >
2018-06-19 14:15:42 +00:00
<!-- { Hidden field: Number of Polls } -->
2018-06-18 16:09:44 +00:00
< input type = "number" id = "poll-count-input" name = "poll-count-input" class = "hidden" >
2018-06-12 12:31:38 +00:00
<!-- Organisers -->
< div class = "form-group" >
< label for = "organisers-input" class = "col-sm-3 col-md-2 control-label" > Organisers:< / label > <!-- This text can be a template variable -->
< div class = "col-sm-9 col-md-10" >
< div class = "form-group" >
< table id = "organisers-input-table" class = "table table-hover" >
< thead >
< tr >
< th class = "text-center" > #< / th >
< th > Email< / th >
< th class = "text-center" > Actions< / th >
< / tr >
< / thead >
< tbody class = "formset organiser-formset" data-formset-prefix = "organisers" data-formset-type = "inline" >
2018-06-26 16:02:36 +00:00
{% if invalid_fields %}
{% for organiser in invalid_fields.organiser_emails_data.val %}
<!-- Organiser -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "organiser" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
{{ forloop.counter }}
< / th >
< td >
<!-- Email -->
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: organiser@example.com" id = "organiser-email-input" name = "organiser-email-input" value = "{{ organiser }}" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
<!-- Action -->
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% endfor %}
<!-- Organiser: Hidden -->
< tr class = "formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix = "organiser" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
X
< / th >
< td >
<!-- Email -->
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: organiserX@example.com" id = "organiser-email-input" name = "organiser-email-input" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% else %}
<!-- Organiser -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "organiser" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
1
< / th >
< td >
<!-- Email -->
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: organiser@example.com" id = "organiser-email-input" name = "organiser-email-input" value = "{{ user_email }}" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
<!-- Action -->
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
<!-- Organiser -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "organiser" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
2
< / th >
< td >
<!-- Email -->
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: organiser@example.com" id = "organiser-email-input" name = "organiser-email-input" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
<!-- Organiser: Hidden -->
< tr class = "formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix = "organiser" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
X
< / th >
< td >
<!-- Email -->
< div >
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: organiserX@example.com" id = "organiser-email-input" name = "organiser-email-input" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% endif %}
2018-06-12 12:31:38 +00:00
< / tbody >
< / table >
< div class = "clearfix" >
< button type = "button" class = "btn btn-primary formset-add" data-formset-prefix = "organisers" >
2018-06-19 14:15:42 +00:00
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
2018-06-12 12:31:38 +00:00
Add Organiser Email
< / button >
< / div >
< span id = "question-input-help-block" class = "help-block" >
Drag and drop to re-order emails.
< / span >
2018-06-14 16:01:14 +00:00
< span id = "organisers-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.organiser_emails %}{{ invalid_fields.organiser_emails.error }}{% endif %}
2018-06-14 16:01:14 +00:00
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
< / div >
<!-- Trustees -->
< div class = "form-group" >
< label for = "trustees-input" class = "col-sm-3 col-md-2 control-label" > Trustees:< / label > <!-- This text can be a template variable -->
< div class = "col-sm-9 col-md-10" >
< div class = "form-group" >
< table id = "trustees-input-table" class = "table table-hover" >
< thead >
< tr >
< th class = "text-center" > #< / th >
< th > Email< / th >
< th class = "text-center" > Actions< / th >
< / tr >
< / thead >
< tbody class = "formset trustee-formset" data-formset-prefix = "trustees" data-formset-type = "inline" >
2018-06-26 16:02:36 +00:00
{% if invalid_fields %}
{% for trustee in invalid_fields.trustee_emails_data.val %}
<!-- Trustee -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "trustee" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
{{ forloop.counter }}
< / th >
< td >
<!-- Email -->
< div > <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: trustee@example.com" id = "trustee-email-input" name = "trustee-email-input" value = "{{ trustee }}" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
<!-- Action -->
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% endfor %}
<!-- Trustee: Hidden -->
< tr class = "formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix = "trustee" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
X
< / th >
< td >
<!-- Email -->
< div > <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: trusteeX@example.com" id = "trustee-email-input" name = "trustee-email-input" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% else %}
<!-- Trustee -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "trustee" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
1
< / th >
< td >
<!-- Email -->
< div > <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: trustee@example.com" id = "trustee-email-input" name = "trustee-email-input" value = "{{ user_email }}" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
<!-- Action -->
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
<!-- Trustee -->
< tr class = "formset-form sorting-row" data-formset-form-prefix = "trustee" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
2
< / th >
< td >
<!-- Email -->
< div > <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: trustee@example.com" id = "trustee-email-input" name = "trustee-email-input" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
<!-- Trustee: Hidden -->
< tr class = "formset-form sorting-row formset-form-empty hidden" data-formset-form-prefix = "trustee" >
< th class = "formset-form-index text-center" scope = row >
<!-- # -->
X
< / th >
< td >
<!-- Email -->
< div > <!-- Has error conditional class removed -->
<!-- TODO: Add an invisible screen reader label to associate with this and other inputs -->
< input type = "text" class = "form-control input-sm input-control" placeholder = "Example: trusteeX@example.com" id = "trustee-email-input" name = "trustee-email-input" maxlength = "255" >
< / div >
< / td >
< td class = "formset-form-actions text-center" >
< button type = "button" class = "btn btn-sm btn-default formset-form-remove" aria-label = "Remove" >
< i class = "fa fa-trash-o" aria-hidden = "true" > < / i >
< / button >
< / td >
< / tr >
{% endif %}
2018-06-12 12:31:38 +00:00
< / tbody >
< / table >
< div class = "clearfix" >
< button type = "button" class = "btn btn-primary formset-add" data-formset-prefix = "trustees" >
2018-06-19 14:15:42 +00:00
< span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span >
2018-06-12 12:31:38 +00:00
Add Trustee Email
< / button >
< / div >
2018-06-14 16:01:14 +00:00
< span id = "trustees-input-help-block" class = "help-block" >
2018-06-12 12:31:38 +00:00
Drag and drop to re-order emails.
< / span >
2018-06-14 16:01:14 +00:00
< span id = "trustees-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.trustee_emails %}{{ invalid_fields.trustee_emails.error }}{% endif %}
2018-06-14 16:01:14 +00:00
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
< / div >
<!-- Voters List -->
< div class = "form-group" >
< label for = "voters-list-input" class = "col-sm-3 col-md-2 control-label" > Voters List:< / label > <!-- This text can be a template variable -->
< div class = "col-sm-9 col-md-10" >
2018-06-26 16:02:36 +00:00
< textarea class = "form-control input-control" id = "voters-list-input" placeholder = "alice@example.com, bob@example.com..." name = "voters-list-input" rows = "4" > {% if invalid_fields %}{{ invalid_fields.voters_emails_data.val }}{% endif %}< / textarea >
2018-06-12 12:31:38 +00:00
< span id = "voters-list-input-help-block" class = "help-block" >
Manually enter email addresses separated with commas. Alternatively, you can also upload a CSV file:
< / span >
< label for = "files" class = "btn btn-primary" >
2018-06-19 14:15:42 +00:00
< span class = "glyphicon glyphicon-cloud-upload" > < / span >
Upload CSV
2018-06-12 12:31:38 +00:00
< / label >
< input type = "file" id = "files" name = "file" class = "btn-info" >
2018-06-19 14:15:42 +00:00
< h4 id = "result" class = "hidden successText" > < / h4 >
2018-06-14 16:01:14 +00:00
< span id = "voters-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
2018-06-26 16:02:36 +00:00
{% if invalid_fields.voters_emails %}{{ invalid_fields.voters_emails.error }}{% endif %}
2018-06-14 16:01:14 +00:00
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
<!-- reCAPTCHA -->
< div class = "form-group" >
< label for = "recaptcha-input" class = "col-sm-3 col-md-2 control-label" > reCAPTCHA:< / label > <!-- This text can be a template variable -->
< div class = "col-sm-9 col-md-10" >
2018-06-12 13:30:23 +00:00
< div class = "g-recaptcha"
data-callback="reCVerificationCallback"
data-expired-callback="reCExpiredCallback"
data-sitekey="{{ G_R_SITE_KEY }}">< / div > <!-- Need to finish server implementation and import key from settings -->
2018-06-12 12:31:38 +00:00
< span id = "recaptcha-input-help-block" class = "help-block" >
Tick the box to prove that you're not a robot.
< / span >
2018-06-26 16:02:36 +00:00
< span id = "recaptcha-input-error-block" class = "help-block errorText" >
<!-- Errors flagged here -->
{% if invalid_fields.recaptcha %}{{ invalid_fields.recaptcha.error }}{% endif %}
< / span >
2018-06-12 12:31:38 +00:00
< / div >
< / div >
< hr >
< input class = "btn btn-success" type = "submit" value = "Create Event" id = "submit-event-create" disabled / >
2018-06-13 12:01:55 +00:00
< input class = "btn btn-danger" type = "button" value = "Cancel" id = "cancel-event-create" onclick = "location.href='{% url 'polls:index' %}'" / >
2018-06-14 16:01:14 +00:00
< span id = "all-errors-help-block" class = "help-block errorText" >
<!-- Place a summary of all errors here -->
< / span >
2018-06-12 12:31:38 +00:00
< / form >
< / div >
< / div >
< / div >
2018-06-18 16:09:44 +00:00
<!-- This dialog has been imported from DEMOS1 -->
< div class = "modal fade" id = "formset-modal" tabindex = "-1" role = "dialog" data-backdrop = "static" data-keyboard = "false" aria-labelledby = "formset-modal-label" >
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h4 class = "modal-title" id = "formset-modal-label" > < / h4 >
< / div >
< div class = "modal-body" >
< div class = "row" >
< div class = "col-xs-12" >
< / div >
< / div >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-danger" data-dismiss = "modal" > Cancel< / button >
< button type = "button" class = "btn btn-success formset-form-save" > Save< / button >
< / div >
< / div >
< / div >
< / div >
2018-06-12 12:31:38 +00:00
{% endblock %}