Much better progress tracker in voting booth #9
This commit is contained in:
parent
7bbffb47af
commit
4ebdd8450c
@ -19,6 +19,7 @@
|
||||
"semantic": "semantic-ui#^2.2.13",
|
||||
"nunjucks": "^3.0.1",
|
||||
"dragula.js": "dragula#^3.7.2",
|
||||
"fingerprintjs2": "^1.5.1"
|
||||
"fingerprintjs2": "^1.5.1",
|
||||
"progress-tracker": "^1.4.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{#
|
||||
Eos - Verifiable elections
|
||||
Copyright © 2017 RunasSudo (Yingtong Li)
|
||||
Copyright © 2017-18 RunasSudo (Yingtong Li)
|
||||
|
||||
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
|
||||
@ -23,7 +23,7 @@
|
||||
{# Convert the template name to a numerical index for comparison #}
|
||||
{% if template == 'booth/welcome.html' %}
|
||||
{% set menuindex = 1 %}
|
||||
{% elif template == 'booth/selections.html' %}
|
||||
{% elif template == 'booth/selections.html' or template == 'booth/encrypt.html' %}
|
||||
{% set menuindex = 2 %}
|
||||
{% elif template == 'booth/review.html' %}
|
||||
{% set menuindex = 3 %}
|
||||
@ -35,14 +35,23 @@
|
||||
{% set menuindex = 6 %}
|
||||
{% endif %}
|
||||
|
||||
<div class="ui secondary pointing menu" id="election-tab-menu">
|
||||
{# oh dear god #}
|
||||
<span class="ui{% if menuindex >= 1 %} active{% endif %} item"{% if menuindex != 1 %} style="color: #767676;{% if menuindex > 1 %} font-weight: 400;{% endif %}"{% endif %}>1. Welcome</span>
|
||||
<span class="ui{% if menuindex >= 2 %} active{% endif %} item"{% if menuindex != 2 %} style="color: #767676;{% if menuindex > 2 %} font-weight: 400;{% endif %}"{% endif %}>2. Make selections</span>
|
||||
<span class="ui{% if menuindex >= 3 %} active{% endif %} item"{% if menuindex != 3 %} style="color: #767676;{% if menuindex > 3 %} font-weight: 400;{% endif %}"{% endif %}>3. Review selections</span>
|
||||
<span class="ui{% if menuindex >= 4 %} active{% endif %} item"{% if menuindex != 4 %} style="color: #767676;{% if menuindex > 4 %} font-weight: 400;{% endif %}"{% endif %}>4. Audit ballot</span>
|
||||
<span class="ui{% if menuindex >= 5 %} active{% endif %} item"{% if menuindex != 5 %} style="color: #767676;{% if menuindex > 5 %} font-weight: 400;{% endif %}"{% endif %}>5. Cast ballot</span>
|
||||
</div>
|
||||
{% 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") }}
|
||||
{{ menuitem(4, "Audit") }}
|
||||
{{ menuitem(5, "Cast") }}
|
||||
{{ menuitem(6, "Finish") }}
|
||||
</ul>
|
||||
|
||||
<div class="ui container">
|
||||
{% block content %}{% endblock %}
|
||||
|
@ -1,6 +1,8 @@
|
||||
{% extends templates['booth/base.html'] %}
|
||||
|
||||
{#
|
||||
Eos - Verifiable elections
|
||||
Copyright © 2017 RunasSudo (Yingtong Li)
|
||||
Copyright © 2017-18 RunasSudo (Yingtong Li)
|
||||
|
||||
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
|
||||
@ -16,8 +18,13 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
|
||||
{% block content %}
|
||||
<div class="ui basic segment" style="min-height: 4em;">
|
||||
<div class="ui active text loader">Preparing your ballot. Please wait.</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block after %}
|
||||
<script>
|
||||
boothWorker.onmessage = function(msg) {
|
||||
try {
|
||||
@ -75,3 +82,4 @@
|
||||
throw err;
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{#
|
||||
Eos - Verifiable elections
|
||||
Copyright © 2017 RunasSudo (Yingtong Li)
|
||||
Copyright © 2017-18 RunasSudo (Yingtong Li)
|
||||
|
||||
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
|
||||
@ -23,6 +23,7 @@
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='bower_components/dragula.js/dist/dragula.min.css') }}" type="text/css">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='bower_components/progress-tracker/app/styles/progress-tracker.css') }}" type="text/css">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
Loading…
Reference in New Issue
Block a user