2017-11-23 21:07:16 +11:00
{#
Eos - Verifiable elections
2021-10-16 20:13:28 +11:00
Copyright © 2017-2021 RunasSudo (Yingtong Li)
2017-11-23 21:07:16 +11:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see < http: / / www . gnu . org / licenses / > .
#}
2017-12-05 20:10:26 +11:00
< h1 > {{ election.name }}< / h1 >
2017-11-23 21:07:16 +11:00
2019-01-14 17:54:31 +11:00
< p > < small > < b > {{ election.kind|title }} fingerprint:< / b > < span class = "hash" > {{ eosjs.eos.core.hashing.SHA256().update_obj(election).hash_as_b64() }}< / span > < / small > < / p >
2017-11-23 21:07:16 +11:00
{# Convert the template name to a numerical index for comparison #}
{% if template == 'booth/welcome.html' %}
{% set menuindex = 1 %}
2018-01-07 23:59:38 +11:00
{% elif template == 'booth/selections.html' %}
2017-11-23 21:07:16 +11:00
{% set menuindex = 2 %}
2018-01-07 23:59:38 +11:00
{% elif template == 'booth/encrypt.html' %}
{% set menuindex = 2.5 %}
2017-11-23 21:07:16 +11:00
{% elif template == 'booth/review.html' %}
{% set menuindex = 3 %}
{% elif template == 'booth/audit.html' %}
{% set menuindex = 4 %}
2017-11-23 23:10:57 +11:00
{% elif template == 'booth/cast.html' %}
2021-10-16 20:13:28 +11:00
{% if election.can_audit() %}
{% set menuindex = 5 %}
{% else %}
{% set menuindex = 4 %}
{% endif %}
2017-11-23 23:10:57 +11:00
{% elif template == 'booth/complete.html' %}
2021-10-16 20:13:28 +11:00
{% if election.can_audit() %}
{% set menuindex = 6 %}
{% else %}
{% set menuindex = 5 %}
{% endif %}
2017-11-23 21:07:16 +11:00
{% endif %}
2018-01-07 23:54:07 +11:00
{% macro menuitem(index, text) %}
< li class = "progress-step{% if menuindex > index %} is-complete{% elif menuindex == index %} is-active{% endif %}" >
< span class = "progress-marker" > {% if menuindex > index or menuindex == 6 %}< span style = "font-family: Icons;" >  < / span > {% else %}{{ index }}{% endif %}< / span >
< span class = "progress-text" >
{{ text }}
< / span >
< / li >
{% endmacro %}
< ul class = "progress-tracker progress-tracker--word progress-tracker--word-center" id = "election-tab-menu" style = "margin-bottom: 20px;" >
{{ menuitem(1, "Welcome") }}
{{ menuitem(2, "Select") }}
{{ menuitem(3, "Review") }}
2021-10-16 20:13:28 +11:00
{% if election.can_audit() %}
{{ menuitem(4, "Audit") }}
{{ menuitem(5, "Cast") }}
{{ menuitem(6, "Finish") }}
{% else %}
{{ menuitem(4, "Cast") }}
{{ menuitem(5, "Finish") }}
{% endif %}
2018-01-07 23:54:07 +11:00
< / ul >
2017-11-23 21:07:16 +11:00
< div class = "ui container" >
2018-01-08 16:38:28 +11:00
{% block helpbtn %}
2018-01-20 22:07:06 +11:00
< button class = "tiny ui right floated labeled icon teal button" onclick = "$('#modal-help').modal('show');" style = "margin-bottom: 1em;" > < i class = "help circle icon" > < / i > Help< / button >
2018-01-08 16:38:28 +11:00
{% endblock %}
2017-11-23 21:07:16 +11:00
{% block content %}{% endblock %}
< / div >
< div class = "ui container" style = "margin-top: 1em;" >
2018-01-08 16:38:28 +11:00
< div style = "clear: both;" > < / div >
2017-11-23 21:07:16 +11:00
{% block buttons %}{% endblock %}
2017-11-28 00:26:13 +11:00
< div style = "clear: both;" > < / div >
2017-11-23 21:07:16 +11:00
< / div >
2018-01-08 16:38:28 +11:00
< div class = "ui modal" id = "modal-help" >
< i class = "close icon" > < / i >
< div class = "header" >
Help
< / div >
< div class = "content" >
{% block help %}{% endblock %}
< / div >
< div class = "actions" >
< button class = "ui approve button" > OK< / button >
< / div >
< / div >
2017-11-23 21:07:16 +11:00
{% block after %}{% endblock %}