Custom nomenclature for election, referendum, poll, etc.
This commit is contained in:
parent
41c588d0bf
commit
d22f402cdc
@ -140,9 +140,12 @@ class RawResult(Result):
|
|||||||
return combined
|
return combined
|
||||||
|
|
||||||
class Election(TopLevelObject):
|
class Election(TopLevelObject):
|
||||||
|
_ver = StringField(default='0.2')
|
||||||
|
|
||||||
_id = UUIDField()
|
_id = UUIDField()
|
||||||
workflow = EmbeddedObjectField(Workflow) # Once saved, we don't care what kind of workflow it is
|
workflow = EmbeddedObjectField(Workflow) # Once saved, we don't care what kind of workflow it is
|
||||||
name = StringField()
|
name = StringField()
|
||||||
|
kind = StringField(default='election')
|
||||||
voters = EmbeddedObjectListField(is_hashed=False)
|
voters = EmbeddedObjectListField(is_hashed=False)
|
||||||
questions = EmbeddedObjectListField()
|
questions = EmbeddedObjectListField()
|
||||||
results = EmbeddedObjectListField(is_hashed=False)
|
results = EmbeddedObjectListField(is_hashed=False)
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ election.name }}</h1>
|
<h1>{{ election.name }}</h1>
|
||||||
|
|
||||||
<p><small><b>Election fingerprint:</b> <span class="hash">{{ SHA256().update_obj(election).hash_as_b64() }}</span></small></p>
|
<p><small><b>{{ election.kind|title }} fingerprint:</b> <span class="hash">{{ SHA256().update_obj(election).hash_as_b64() }}</span></small></p>
|
||||||
|
|
||||||
<div class="ui secondary pointing menu" id="election-tab-menu">
|
<div class="ui secondary pointing menu" id="election-tab-menu">
|
||||||
{% include eosweb.core.main.model_view_map[election.__class__]['tabs'] %}
|
{% include eosweb.core.main.model_view_map[election.__class__]['tabs'] %}
|
||||||
|
@ -126,7 +126,7 @@
|
|||||||
if (err) {
|
if (err) {
|
||||||
techDetails = '<p>Technical details: ' + err + '</p>';
|
techDetails = '<p>Technical details: ' + err + '</p>';
|
||||||
}
|
}
|
||||||
$("#booth-content").html('<div class="ui error message"><p>We were unable to load the voting booth for this election. Please try again. If this problem persists, contact the election administrator.</p>' + techDetails + '</div>');
|
$("#booth-content").html('<div class="ui error message"><p>We were unable to load the voting booth for this {{ election.kind }}. Please try again. If this problem persists, contact the {{ election.kind }} administrator.</p>' + techDetails + '</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
function boothError(err) {
|
function boothError(err) {
|
||||||
@ -135,7 +135,7 @@
|
|||||||
if (err) {
|
if (err) {
|
||||||
techDetails = '<p>Technical details: ' + err + '</p>';
|
techDetails = '<p>Technical details: ' + err + '</p>';
|
||||||
}
|
}
|
||||||
$("#booth-content").html('<div class="ui error message"><p>We were unable to display the next page of the voting booth. For your security, your ballot selections have been cleared. Please try again. If this problem persists, contact the election administrator.</p>' + techDetails + '</div>');
|
$("#booth-content").html('<div class="ui error message"><p>We were unable to display the next page of the voting booth. For your security, your ballot selections have been cleared. Please try again. If this problem persists, contact the {{ election.kind }} administrator.</p>' + techDetails + '</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showTemplate(template, opts, destination) {
|
function showTemplate(template, opts, destination) {
|
||||||
|
@ -25,17 +25,17 @@
|
|||||||
{% if election.workflow.get_task('eos.base.workflow.TaskOpenVoting').status == Status.EXITED %}
|
{% if election.workflow.get_task('eos.base.workflow.TaskOpenVoting').status == Status.EXITED %}
|
||||||
{% if election.workflow.get_task('eos.base.workflow.TaskCloseVoting').status == Status.EXITED %}
|
{% if election.workflow.get_task('eos.base.workflow.TaskCloseVoting').status == Status.EXITED %}
|
||||||
{% if election.workflow.get_task('eos.base.workflow.TaskReleaseResults').status < Status.EXITED %}
|
{% if election.workflow.get_task('eos.base.workflow.TaskReleaseResults').status < Status.EXITED %}
|
||||||
<p><button class="ui huge button">Voting in this election has closed</button></p>
|
<p><button class="ui huge button">Voting in this {{ election.kind }} has closed</button></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p><a href="{{ url_for('election_booth', election_id=election._id) }}" class="ui huge primary button">Click here to vote in this election</a></p>
|
<p><a href="{{ url_for('election_booth', election_id=election._id) }}" class="ui huge primary button">Click here to vote in this {{ election.kind }}</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p><button class="ui huge button">Voting in this election has not yet opened</button></p>
|
<p><button class="ui huge button">Voting in this {{ election.kind }} has not yet opened</button></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Voting in this election
|
Voting in this {{ election.kind }}
|
||||||
{% if election.workflow.get_task('eos.base.workflow.TaskOpenVoting').status == Status.EXITED %}
|
{% if election.workflow.get_task('eos.base.workflow.TaskOpenVoting').status == Status.EXITED %}
|
||||||
opened at {{ election.workflow.get_task('eos.base.workflow.TaskOpenVoting').exited_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC
|
opened at {{ election.workflow.get_task('eos.base.workflow.TaskOpenVoting').exited_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC
|
||||||
{% else %}
|
{% else %}
|
||||||
@ -50,9 +50,9 @@
|
|||||||
at the administrators' discretion.
|
at the administrators' discretion.
|
||||||
</p>
|
</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p><button class="ui huge button">This election is not yet ready for voting</button></p>
|
<p><button class="ui huge button">This {{ election.kind }} is not yet ready for voting</button></p>
|
||||||
|
|
||||||
<p>The administrator of this election has not yet finished setting the election parameters. The details of the election may change at any time.</p>
|
<p>The administrator of this {{ election.kind }} has not yet finished setting the election parameters. The details of the {{ election.kind }} may change at any time.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if election.workflow.get_task('eos.base.workflow.TaskReleaseResults').status == Status.EXITED %}
|
{% if election.workflow.get_task('eos.base.workflow.TaskReleaseResults').status == Status.EXITED %}
|
||||||
@ -69,10 +69,10 @@
|
|||||||
{% if election.workflow.get_task('eos.base.workflow.TaskOpenVoting').status < Status.EXITED %}
|
{% if election.workflow.get_task('eos.base.workflow.TaskOpenVoting').status < Status.EXITED %}
|
||||||
<h2>Voting booth</h2>
|
<h2>Voting booth</h2>
|
||||||
|
|
||||||
<p>Voting in this election has not yet begun. If you would like to preview the voting booth, <a href="{{ url_for('election_booth', election_id=election._id) }}">click here</a>. Note that you will not be able to cast any ballots until voting opens.</p>
|
<p>Voting in this {{ election.kind }} has not yet begun. If you would like to preview the voting booth, <a href="{{ url_for('election_booth', election_id=election._id) }}">click here</a>. Note that you will not be able to cast any ballots until voting opens.</p>
|
||||||
{% elif election.workflow.get_task('eos.base.workflow.TaskCloseVoting').status == Status.EXITED %}
|
{% elif election.workflow.get_task('eos.base.workflow.TaskCloseVoting').status == Status.EXITED %}
|
||||||
<h2>Voting booth</h2>
|
<h2>Voting booth</h2>
|
||||||
|
|
||||||
<p>Voting in this election has concluded. If you would like to review the voting booth, <a href="{{ url_for('election_booth', election_id=election._id) }}">click here</a>. Note that you will no longer be able to cast any ballots.</p>
|
<p>Voting in this {{ election.kind }} has concluded. If you would like to review the voting booth, <a href="{{ url_for('election_booth', election_id=election._id) }}">click here</a>. Note that you will no longer be able to cast any ballots.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user