Eos/eosweb/core/templates/election/base.html

64 lines
2.3 KiB
HTML
Raw Normal View History

2017-11-22 23:23:24 +11:00
{% extends 'base.html' %}
{#
Eos - Verifiable elections
Copyright © 2017 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
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/>.
#}
{% block title %}{{ election.name }}{% endblock %}
2017-11-23 18:18:01 +11:00
{% macro tab(name, view) %}
<a href="{{ url_for(view, election_id=election._id) }}" class="election-tab-ajax item{% if request.endpoint == view %} active{% endif %}">{{ name }}</a>
{% endmacro %}
2017-11-22 23:23:24 +11:00
{% block content %}
<h1>{{ election.name }}</h1>
<p><small><b>{{ election.kind|title }} fingerprint:</b> <span class="hash">{{ SHA256().update_obj(election).hash_as_b64() }}</span></small></p>
2017-11-22 23:23:24 +11:00
<div class="ui secondary pointing menu" id="election-tab-menu">
2017-11-23 18:18:01 +11:00
{% include eosweb.core.main.model_view_map[election.__class__]['tabs'] %}
2017-12-07 15:33:11 +11:00
{% if session.user and session.user.is_admin() %}
2017-12-07 16:04:24 +11:00
<a href="{{ url_for('election_admin_summary', election_id=election._id) }}" class="election-tab-ajax item{% if request.endpoint == 'election_admin_summary' %} active{% endif %} right"><i class="configure icon"></i> Administrate this election</a>
2017-12-07 15:33:11 +11:00
{% endif %}
2017-11-22 23:23:24 +11:00
</div>
<div class="ui container" id="election-tab-content">
{% block electioncontent %}
{% endblock %}
</div>
{% endblock %}
{% block basecontent %}
{{ super() }}
<script>
$(".election-tab-ajax").click(function() {
var linkEl = $(this);
history.pushState({}, "", linkEl.attr("href"));
$("#election-tab-menu .item").removeClass("active");
linkEl.addClass("active");
$("#election-tab-content").html('<div class="ui active text loader">Loading. Please wait.</div>');
$("#election-tab-content").load(linkEl.attr("href") + " #election-tab-content", function() {
linkEl.find(".loader").removeClass("active");
});
return false;
});
</script>
{% endblock %}