2012-09-06 23:58:20 +02:00
{% extends "base.html" %}
2012-02-09 16:57:10 +01:00
{% load i18n %}
2013-05-14 20:20:41 +02:00
{% load staticfiles %}
2013-09-08 14:33:43 +02:00
{% load tags %}
2012-02-09 16:57:10 +01:00
2013-06-14 20:24:48 +02:00
{% block title %}{% trans "Elections" %} – {{ block.super }}{% endblock %}
2011-07-31 10:46:29 +02:00
2013-05-14 20:20:41 +02:00
{% block header %}
2014-01-14 23:22:29 +01:00
< link href = "{% static 'css/dataTables/dataTables.bootstrap.css' %}" type = "text/css" rel = "stylesheet" >
2013-05-14 20:20:41 +02:00
{% endblock %}
{% block javascript %}
2014-01-14 23:22:29 +01:00
< script src = "{% static 'js/jquery/jquery.dataTables.min.js' %}" type = "text/javascript" > < / script >
< script src = "{% static 'js/jquery/dataTables.bootstrap.js' %}" type = "text/javascript" > < / script >
2013-05-14 20:20:41 +02:00
{% endblock %}
2012-09-06 23:58:20 +02:00
2011-07-31 10:46:29 +02:00
{% block content %}
2012-09-06 23:58:20 +02:00
< h1 > {% trans "Elections" %}
< small class = "pull-right" >
{% if perms.assignment.can_manage_assignment %}
2013-09-08 14:33:43 +02:00
< a href = "{% url 'assignment_create' %}" class = "btn btn-mini btn-primary" rel = "tooltip" data-original-title = "{% trans 'New election' %}" > < i class = "icon-plus icon-white" > < / i > {% trans "New" %}< / a >
2012-09-06 23:58:20 +02:00
{% endif %}
{% if perms.assignment.can_see_assignment %}
2014-05-18 22:14:53 +02:00
< a href = "{% url 'assignment_list_pdf' %}" class = "btn btn-mini" rel = "tooltip" data-original-title = "{% trans 'Print all elections as PDF' %}" target = "_blank" > < i class = "icon-print" > < / i > < span class = "optional-small" > PDF< / span > < / a >
2012-09-06 23:58:20 +02:00
{% endif %}
< / small >
< / h1 >
2011-07-31 10:46:29 +02:00
2013-05-14 20:20:41 +02:00
< table id = "dataTable" class = "table table-striped table-bordered" >
< thead >
2011-07-31 10:46:29 +02:00
< tr >
2013-05-14 20:20:41 +02:00
< th > {% trans "Election" %}< / th >
< th class = "optional" > {% trans "Candidates" %}< / th >
< th > {% trans "Status" %}< / th >
2013-02-05 22:03:43 +01:00
< th class = "mini_width" > {% trans "Actions" %}< / th >
2011-07-31 10:46:29 +02:00
< / tr >
2013-05-14 20:20:41 +02:00
< / thead >
2013-09-08 14:33:43 +02:00
{% for object in object_list %}
2013-09-07 10:14:54 +02:00
< tr class = "{% if object.is_active_slide %}activeline{% endif %}" >
2013-09-08 14:33:43 +02:00
< td > < a href = "{{ object|absolute_url:'detail' }}" > {{ object }}< / a > < / td >
2013-05-14 20:20:41 +02:00
< td class = "optional" >
<!-- posts -->
{% trans "Posts" context "Number of searched candidates for an election" %}:
2013-09-08 14:33:43 +02:00
< span class = "badge badge-info" > {{ object.posts }}< / span >
2013-05-14 20:20:41 +02:00
<!-- candidates -->
2013-09-08 14:33:43 +02:00
{% if object.status != 'fin' %}
| {% trans "Candidates" %}: < span class = "badge badge-warning" > {{ object.get_participants|length }}< / span >
2012-10-25 21:08:29 +02:00
{% endif %}
2013-05-14 20:20:41 +02:00
<!-- elected candidates -->
2013-09-08 14:33:43 +02:00
| {% trans "Elected" %}: < span class = "badge badge-success" > {{ object.elected|length }}< / span >
2012-10-25 21:08:29 +02:00
< / td >
2013-09-08 14:33:43 +02:00
< td > < span class = "label label-info" > {{ object.get_status_display }}< / status > < / td >
2012-04-20 22:58:34 +02:00
< td >
< span style = "width: 1px; white-space: nowrap;" >
2014-01-28 08:32:26 +01:00
{% if perms.core.can_manage_projector %}
2013-09-07 10:14:54 +02:00
< a href = "{{ object|absolute_url:'projector' }}"
class="activate_link btn {% if object.is_active_slide %}btn-primary{% endif %} btn-mini"
2013-06-03 21:54:52 +02:00
rel="tooltip" data-original-title="{% trans 'Show election' %}">
2013-09-07 10:14:54 +02:00
< i class = "icon-facetime-video {% if object.is_active_slide %}icon-white{% endif %}" > < / i >
2012-04-20 22:58:34 +02:00
< / a >
{% endif %}
{% if perms.assignment.can_manage_assignment %}
2013-09-08 14:33:43 +02:00
< a href = "{{ object|absolute_url:'update' }}"
2013-06-03 21:54:52 +02:00
rel="tooltip" data-original-title="{% trans 'Edit' %}"
class="btn btn-mini">< i class = "icon-pencil" > < / i >
2013-01-31 10:19:56 +01:00
< / a >
2013-09-08 14:33:43 +02:00
< a href = "{% url 'assignment_delete' object.id %}"
2013-06-03 21:54:52 +02:00
rel="tooltip" data-original-title="{% trans 'Delete' %}"
class="btn btn-mini">< i class = "icon-remove" > < / i >
2013-01-31 10:19:56 +01:00
< / a >
2012-04-20 22:58:34 +02:00
{% endif %}
2013-09-08 14:33:43 +02:00
< a href = "{% url 'assignment_pdf' object.id %}"
2013-06-03 21:54:52 +02:00
data-original-title="{% trans 'Print election as PDF' %}" target="_blank"
class="btn btn-mini tooltip-left">< i class = "icon-print" > < / i > PDF
2013-01-31 10:19:56 +01:00
< / a >
2012-04-20 22:58:34 +02:00
< / span >
< / td >
2011-07-31 10:46:29 +02:00
< / tr >
{% endfor %}
< / table >
{% endblock %}