OpenSlides/openslides/assignment/templates/assignment/assignment_list.html

83 lines
3.9 KiB
HTML
Raw Normal View History

2012-09-06 23:58:20 +02:00
{% extends "base.html" %}
2012-02-09 16:57:10 +01:00
{% load i18n %}
{% load staticfiles %}
{% load tags %}
2012-02-09 16:57:10 +01:00
{% block title %}{% trans "Elections" %} {{ block.super }}{% endblock %}
2011-07-31 10:46:29 +02:00
{% block header %}
<link href="{% static 'css/dataTables/dataTables.bootstrap.css' %}" type="text/css" rel="stylesheet">
{% endblock %}
{% block javascript %}
<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>
{% 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 %}
<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 %}
<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
<table id="dataTable" class="table table-striped table-bordered">
<thead>
2011-07-31 10:46:29 +02:00
<tr>
<th>{% trans "Election" %}</th>
<th class="optional">{% trans "Candidates" %}</th>
<th>{% trans "Status" %}</th>
<th class="mini_width">{% trans "Actions" %}</th>
2011-07-31 10:46:29 +02:00
</tr>
</thead>
{% for object in object_list %}
<tr class="{% if object.is_active_slide %}activeline{% endif %}">
<td><a href="{{ object|absolute_url:'detail' }}">{{ object }}</a></td>
<td class="optional">
<!-- posts -->
{% trans "Posts" context "Number of searched candidates for an election" %}:
<span class="badge badge-info">{{ object.posts }}</span>
<!-- candidates -->
{% if object.status != 'fin' %}
| {% trans "Candidates" %}: <span class="badge badge-warning">{{ object.get_participants|length }}</span>
{% endif %}
<!-- elected candidates -->
| {% trans "Elected" %}: <span class="badge badge-success">{{ object.elected|length }}</span>
</td>
<td><span class="label label-info">{{ object.get_status_display }}</status></td>
<td>
<span style="width: 1px; white-space: nowrap;">
{% if perms.core.can_manage_projector %}
<a href="{{ object|absolute_url:'projector' }}"
class="activate_link btn {% if object.is_active_slide %}btn-primary{% endif %} btn-mini"
rel="tooltip" data-original-title="{% trans 'Show election' %}">
<i class="icon-facetime-video {% if object.is_active_slide %}icon-white{% endif %}"></i>
</a>
{% endif %}
{% if perms.assignment.can_manage_assignment %}
<a href="{{ object|absolute_url:'update' }}"
rel="tooltip" data-original-title="{% trans 'Edit' %}"
class="btn btn-mini"><i class="icon-pencil"></i>
</a>
<a href="{% url 'assignment_delete' object.id %}"
rel="tooltip" data-original-title="{% trans 'Delete' %}"
class="btn btn-mini"><i class="icon-remove"></i>
</a>
{% endif %}
<a href="{% url 'assignment_pdf' object.id %}"
data-original-title="{% trans 'Print election as PDF' %}" target="_blank"
class="btn btn-mini tooltip-left"><i class="icon-print"></i> PDF
</a>
</span>
</td>
2011-07-31 10:46:29 +02:00
</tr>
{% endfor %}
</table>
{% endblock %}