a383a4305b
- Fixed #737 (Motion edit link is missing for normal delegate users) - Fixed motion pdf filename errors (now use motion-<identifier>.pdf or if no identifier: motion-<title>.pdf with using djangos slugify for special chars in title) - Fixed motion pdf build error if there is an unauthorized version - Enlarge max_length of event name field to 50 chars. - Align participant import instruction with motion import page. - Added title field to particpants-demo_en.csv. - participant overview: Show comma after last_name only if first_name and last_name are given. - Changed all page titles to "<specific action page> - <event-name>" (moved event-name to the end of the string) - Updated EN tranlation string. - Updated DE translations.
301 lines
14 KiB
HTML
301 lines
14 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% load i18n %}
|
||
{% load staticfiles %}
|
||
{% load tags %}
|
||
{% load humanize %}
|
||
|
||
{% block title %}{% trans "Election" %} "{{ assignment }}" – {{ block.super }}{% endblock %}
|
||
|
||
{% block header %}
|
||
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/assignment.css' %}" />
|
||
{% endblock %}
|
||
|
||
{% block javascript %}
|
||
<script type="text/javascript" src="{% static 'javascript/assignment.js' %}"></script>
|
||
{% endblock %}
|
||
|
||
{% block content %}
|
||
<h1>
|
||
{{ assignment }}
|
||
<small class="pull-right">
|
||
<a href="{% url 'assignment_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
|
||
<a href="{% url 'print_assignment' assignment.id %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Print election as PDF' %}" target="_blank"><i class="icon-print"></i> PDF</a>
|
||
<!-- activate projector -->
|
||
{% if perms.projector.can_manage_projector %}
|
||
<a href="{% url 'projector_activate_slide' assignment.sid %}" class="activate_link btn {% if assignment.active %}btn-primary{% endif %} btn-mini" rel="tooltip" data-original-title="{% trans 'Show election' %}">
|
||
<i class="icon-facetime-video {% if assignment.active %}icon-white{% endif %}"></i>
|
||
</a>
|
||
{% endif %}
|
||
{% if perms.assignment.can_manage_assignment or perms.agenda.can_manage_agenda %}
|
||
<div class="btn-group">
|
||
<a data-toggle="dropdown" class="btn btn-mini dropdown-toggle">
|
||
{% trans 'More actions' %} <span class="caret"></span>
|
||
</a>
|
||
<ul class="dropdown-menu pull-right">
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
<!-- edit -->
|
||
<li><a href="{% url 'assignment_edit' assignment.id %}"><i class="icon-pencil"></i> {% trans 'Edit election' %}</a></li>
|
||
<!-- delete -->
|
||
<li><a href="{% url 'assignment_delete' assignment.id %}"><i class="icon-remove"></i> {% trans 'Delete election' %}</a></li>
|
||
{% endif %}
|
||
<!-- create agenda item -->
|
||
{% if perms.agenda.can_manage_agenda %}
|
||
<li><a href="{% url 'assignment_create_agenda' assignment.id %}"><i class="icon-plus"></i> {% trans 'New agenda item' %}</a></li>
|
||
{% endif %}
|
||
</ul>
|
||
</div>
|
||
{% endif %}
|
||
</small>
|
||
</h1>
|
||
|
||
<div class="row-fluid">
|
||
<div class="span9">
|
||
<!-- Description -->
|
||
<h4>{% trans "Description" %}</h4>
|
||
{% if assignment.description %}
|
||
{{ assignment.description|linebreaks }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
<br>
|
||
<!-- Candidates -->
|
||
{% if assignment.status != "fin" %}
|
||
<h4>{% trans "Candidates" %}</h4>
|
||
<ol>
|
||
{% for person in assignment.get_participants %}
|
||
<li>
|
||
<a href="{% model_url person 'view' %}">{{ person }}</a>
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
{% if assignment.status == "sea" or assignment.status == "vot" %}
|
||
<a href="{% url 'assignment_delother' assignment.id person.person_id %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Remove candidate' %}"><i class="icon-remove"></i></a>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% if person in assignment.elected %}
|
||
| <b>{% trans "elected" %}</b>
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
{% if assignment.status == "sea" or assignment.status == "vot" %}
|
||
<a class="btn btn-mini" href="{% url 'assignment_user_not_elected' assignment.id person.person_id %}" rel="tooltip" data-original-title="{% trans 'Mark candidate as not elected' %}">
|
||
<i class="icon-ban-circle"></i>
|
||
</a>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
</li>
|
||
{% empty %}
|
||
<li style="list-style: none outside none; margin-left: -25px;"><i>{% trans "No candidates available." %}</i></li>
|
||
{% endfor %}
|
||
</ol>
|
||
{% if assignment.status == "sea" or perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||
{% if perms.assignment.can_nominate_self or perms.assignment.can_nominate_other %}
|
||
<form action="" method="post">{% csrf_token %}
|
||
{% if perms.assignment.can_nominate_self %}
|
||
<p>
|
||
{% if user_is_candidate %}
|
||
<a href='{% url 'assignment_delrun' assignment.id %}' class="btn btn-mini">
|
||
<i class="icon-remove"></i> {% trans 'Withdraw self candidature' %}
|
||
</a>
|
||
{% else %}
|
||
<a href='{% url 'assignment_run' assignment.id %}' class="btn btn-mini">
|
||
<i class="icon-plus"></i> {% trans 'Self candidature' %}
|
||
</a>
|
||
{% endif %}
|
||
</p>
|
||
{% endif %}
|
||
{% if perms.assignment.can_nominate_other %}
|
||
{% for field in form %}
|
||
<label>{{ field.label }}:</label>
|
||
<div class="input-append">
|
||
{{ field }}
|
||
<button class="btn btn-primary tooltip-bottom" type="submit"
|
||
data-original-title="{% trans 'Apply' %}"><i class="icon-ok icon-white"></i></button>
|
||
{% if perms.participant.can_see_participant and perms.participant.can_manage_participant %}
|
||
<a href="{% url 'user_new' %}" target="_blank" class="btn"
|
||
rel="tooltip" data-original-title="{% trans 'Add new participant' %}"><i class="icon-add-user"></i></a>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
{% endif %}
|
||
</form>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
{% if perms.assignment.can_manage_assignments and blocked_candidates and assignment.status != "fin" %}
|
||
<h4>{% trans "Blocked Candidates" %}</h4>
|
||
<ul>
|
||
{% for person in blocked_candidates %}
|
||
<li>
|
||
<a href="{% model_url person 'view' %}">{{ person }}</a>
|
||
<a class="btn btn-mini" href="{% url 'assignment_delother' assignment.id person.person_id %}"
|
||
rel="tooltip" data-original-title="{% trans 'Remove candidate' %}">
|
||
<i class="icon-ban-circle"></i>
|
||
</a>
|
||
</li>
|
||
{% empty %}
|
||
<li>{% trans "No blocked candidates available." %}</li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% endif %}
|
||
|
||
|
||
<!-- Results -->
|
||
{% if assignment.status != "sea" or polls.exists %}
|
||
<h4>{% trans "Election results" %}</h4>
|
||
{% if polls.exists %}
|
||
<table class="table table-striped table-bordered">
|
||
<tr>
|
||
<th></th>
|
||
{% with ballotnumber=polls.count %}
|
||
<th colspan="{{ ballotnumber|add:'1' }}" style="text-align: center;">
|
||
{% trans "Ballot" %}
|
||
</th>
|
||
{% endwith %}
|
||
</tr>
|
||
<tr>
|
||
<th>{% trans "Candidates" %}</th>
|
||
{% for poll in polls %}
|
||
<th style="white-space:nowrap;" class="span1">
|
||
{{ poll.get_ballot|ordinal|safe }} {% trans 'ballot' %}
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
<br>
|
||
<a class="publish_link btn btn-mini btn-danger {% if poll.published %}btn-primary{% endif %}"
|
||
href="{% url 'assignment_poll_publish_status' poll.id %}"
|
||
rel="tooltip" data-original-title="{% trans 'Publish results' %}">
|
||
{% if poll.published %}
|
||
<i class="icon-checked-new_white"></i>
|
||
{% else %}
|
||
<i class="icon-unchecked-new"></i>
|
||
{% endif %}
|
||
</a>
|
||
<a href="{% url 'assignment_poll_view' poll.id %}" class="btn btn-mini"
|
||
rel="tooltip" data-original-title="{% trans 'Edit' %}"><i class="icon-pencil"></i></a>
|
||
<a href="{% url 'assignment_poll_delete' poll.id %}" class="btn btn-mini"
|
||
rel="tooltip" data-original-title="{% trans 'Delete' %}"><i class="icon-remove"></i></a>
|
||
{% endif %}
|
||
</th>
|
||
{% endfor %}
|
||
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||
<th class="span1 nobr">
|
||
<a href="{% url 'assignment_gen_poll' assignment.id %}" class="btn btn-mini">
|
||
<i class="icon-plus"></i> {% trans 'New ballot' %}
|
||
</a>
|
||
</th>
|
||
{% endif %}
|
||
</tr>
|
||
{% for candidate, poll_list in vote_results.items %}
|
||
<tr>
|
||
<td>
|
||
{% if candidate in assignment.elected %}
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
<a class="election_link elected" href="{% url 'assignment_user_not_elected' assignment.id candidate.person_id %}"
|
||
rel="tooltip" data-original-title="{% trans 'Mark candidate as elected' %}"></a>
|
||
{% else %}
|
||
<a class="elected">
|
||
<img src="{% static 'img/voting-yes.png' %}" class="tooltip-bottom" data-original-title="{% trans 'Candidate is elected' %}">
|
||
</a>
|
||
{% endif %}
|
||
{% else %}
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
<a class="election_link" href="{% url 'assignment_user_elected' assignment.id candidate.person_id %}"></a>
|
||
{% endif %}
|
||
{% endif %}
|
||
<a href="{% model_url candidate 'view' %}">{{ candidate }}</a>
|
||
</td>
|
||
{% for vote in poll_list %}
|
||
<td style="white-space:nowrap;">
|
||
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
|
||
<img src="{% static 'img/voting-yes.png' %}" class="tooltip-left" data-original-title="{% trans 'Yes' %}"> {{ vote.Yes }}<br>
|
||
<img src="{% static 'img/voting-no.png' %}" class="tooltip-left" data-original-title="{% trans 'No' %}"> {{ vote.No }}<br>
|
||
<img src="{% static 'img/voting-abstention.png' %}" class="tooltip-left" data-original-title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br>
|
||
{% elif 'Votes' in vote %}
|
||
<img src="{% static 'img/voting-yes.png' %}" class="tooltip-left" data-original-title="{% trans 'Yes' %}"> {{ vote.Votes }}
|
||
{% elif vote == None %}
|
||
{% trans 'was not a <br> candidate'%}
|
||
{% else %}
|
||
|
||
{% endif %}
|
||
</td>
|
||
{% endfor %}
|
||
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||
<td></td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
<tr>
|
||
<td>{% trans 'Invalid votes' %}</td>
|
||
{% for poll in polls %}
|
||
{% if poll.published or perms.assignment.can_manage_assignment %}
|
||
<td style="white-space:nowrap;">
|
||
{% if poll.has_votes %}
|
||
<img src="{% static 'img/voting-invalid.png' %}" class="tooltip-left" data-original-title="{% trans 'Invalid' %}">
|
||
{{ poll.print_votesinvalid }}
|
||
{% endif %}
|
||
</td>
|
||
{% endif %}
|
||
{% endfor %}
|
||
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||
<td></td>
|
||
{% endif %}
|
||
</tr>
|
||
<tr class="info total">
|
||
<td><strong>{% trans 'Votes cast' %}</strong></td>
|
||
{% for poll in polls %}
|
||
{% if poll.published or perms.assignment.can_manage_assignment %}
|
||
<td style="white-space:nowrap;">
|
||
{% if poll.has_votes %}
|
||
<img src="{% static 'img/voting-total.png' %}" class="tooltip-left" data-original-title="{% trans 'Votes cast' %}">
|
||
<strong>{{ poll.print_votescast }}</strong>
|
||
{% endif %}
|
||
</td>
|
||
{% endif %}
|
||
{% endfor %}
|
||
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||
<td></td>
|
||
{% endif %}
|
||
</tr>
|
||
</table>
|
||
{% else %}
|
||
<i>{% trans "No ballots available." %}</i>
|
||
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
|
||
<p>
|
||
<a href='{% url 'assignment_gen_poll' assignment.id %}' class="btn">
|
||
<i class="icon-plus"></i> {% trans 'New ballot' %}
|
||
</a>
|
||
</p>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
</div> <!--/span-->
|
||
|
||
<div class="span3">
|
||
<div class="well">
|
||
<!-- Text -->
|
||
<h5>{% trans "Status" %}:</h5>
|
||
{% trans assignment.get_status_display %}
|
||
<!-- Posts -->
|
||
<h5>{% trans "Number of available posts" %}:</h5>
|
||
{{ assignment.posts }}
|
||
</div> <!--/well-->
|
||
|
||
{% if perms.assignment.can_manage_assignment %}
|
||
<div class="well">
|
||
<h4>{% trans "Change status" %}:</h4>
|
||
<label class="radio">
|
||
<input type="radio" name="status" onclick="window.location.href='{% url 'assignment_set_status' assignment.id 'sea' %}';"
|
||
{% if 'sea' in assignment.status %}checked{% endif %}>{% trans 'Searching for candidates' %}
|
||
</label>
|
||
<label class="radio">
|
||
<input type="radio" name="status" onclick="window.location.href='{% url 'assignment_set_status' assignment.id 'vot' %}';"
|
||
{% if 'vot' in assignment.status %}checked{% endif %}>{% trans 'Voting' %}<br>
|
||
</label>
|
||
<label class="radio">
|
||
<input type="radio" name="status" onclick="window.location.href='{% url 'assignment_set_status' assignment.id 'fin' %}';"
|
||
{% if 'fin' in assignment.status %}checked{% endif %}>{% trans 'Finished' %}
|
||
</label>
|
||
</div> <!--/well-->
|
||
{% endif %}
|
||
</div> <!--/span-->
|
||
</div> <!--/row-->
|
||
{% endblock %}
|