OpenSlides/openslides/motion/templates/motion/motion_detail.html
2013-03-14 23:04:32 +01:00

295 lines
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Motion" %} {{ motion.identifier }}{% endblock %}
{% block content %}
<h1>
{{ motion.title }} {{ motion.category }}
<br>
<small>
{% if motion.identifier %}
{% trans "Motion" %} {{ motion.identifier }},
{% else %}
<i>[{% trans "no number" %}]</i>,
{% endif %}
{# TODO: show only for complex workflow #}
{% trans "Version" %} {{ motion.version.version_number }}
</small>
<small class="pull-right">
<div class="btn-toolbar">
<a href="{% url 'motion_list' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
<a href="{% url 'motion_detail_pdf' motion.id %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Print this motion as PDF' %}"><i class="icon-print"></i> PDF</a>
<!-- activate projector -->
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' motion.sid %}" class="activate_link btn {% if motion.active %}btn-primary{% endif %} btn-mini" rel="tooltip" data-original-title="{% trans 'Show motion' %}">
<i class="icon-facetime-video {% if motion.active %}icon-white{% endif %}"></i>
</a>
{% endif %}
<div class="btn-group">
<a data-toggle="dropdown" href="#" class="btn btn-mini dropdown-toggle">
{% trans 'More actions' %}
<span class="caret"></span>
</a>
<ul class="dropdown-menu pull-right">
<!-- edit -->
{% if allowed_actions.edit %}
<li><a href="{% model_url motion 'edit' %}"><i class="icon-pencil"></i> {% trans 'Edit motion' %}</a></li>
{% endif %}
<!-- delete -->
{% if allowed_actions.delete %}
<li><a href="{% model_url motion 'delete' %}"><i class="icon-remove"></i> {% trans 'Delete motion' %}</a></li>
{% endif %}
<!-- create agenda item -->
{% if perms.agenda.can_manage_agenda %}
<li>
<a href="{% url 'motion_create_agenda' motion.id %}"><i class="icon-plus"></i> {% trans 'New agenda item' %}</a>
</li>
{% endif %}
</ul>
</div>
</div>
</small>
</h1>
<div class="row-fluid">
<div class="span8">
{# TODO: show only for complex workflow #}
{% if motion.version.version_number < motion.last_version.version_number %}
<span class="label label-warning">
<i class="icon-warning-sign icon-white"></i> {% trans "This is not the newest version." %}
</span>
<a href="{% model_url motion.last_version %}" class="btn btn-small">{% trans "Go to last version" %}
(#{{ motion.last_version.version_number }})</a>
{% endif %}
{% if motion.version.version_number > motion.active_version.version_number %}
<span class="label label-warning">
<i class="icon-warning-sign icon-white"></i> {% trans "This version is not yet authorized." %}
</span>
<a href="{% model_url motion.active_version %}" class="btn btn-small">{% trans "Go to last authorized version" %}
(#{{ motion.active_version.version_number }})</a>
{% endif %}
<!-- Text -->
<h4>{% trans "Motion text" %}:</h4>
{{ motion.version.text|linebreaks }}
<br>
<!-- Reason -->
<h4>{% trans "Reason" %}:</h4>
{% if motion.version.reason %}
{{ motion.version.reason|linebreaks }}
{% else %}
{% endif %}
<br>
<!-- Version history -->
{% with versions=motion.versions.all %}
{% if versions|length > 1 %}
{% for version in versions %}
{% if forloop.first %}
<h4>{% trans "Version history" %}:</h4>
<form action="{% url 'motion_version_diff' motion.pk %}" method="get">
<table class="table table-striped table-bordered">
<tr>
<th></th>
<th>#</th>
<th>{% trans "Time" %}</th>
<th><button class="btn btn-small" type="submit">{% trans 'Difference' %}</button></th>
<th>{% trans "Actions" %}</th>
</tr>
{% endif %}
<tr {% if version == motion.version %}class="offline"{%endif %}>
<td class="nobr">
{% if version == motion.active_version %}
<span class="badge badge-success" title="{% trans 'This version is authorized' %}"><i class="icon-ok icon-white"></i></span>
{% else %}
{% if perms.motion.can_manage_motion %}
<a class="btn btn-mini" href="{% url 'motion_version_permit' motion.id version.version_number %}" title="{% trans 'Permit this version' %}"><i class="icon-ok"></i></a>
{% endif %}
{% if not version.rejected and version.id > motion.active_version.id and perms.motion.can_manage_motion %}
<a class="btn btn-mini" href="{% url 'motion_version_reject' motion.id version.version_number %}" title="{% trans 'Reject this version' %}"><i class="icon-ban-circle"></i></a>
{% endif %}
{% endif %}
{% if version.rejected %}
<span class="badge badge-important" title="{% trans 'This version is rejected' %}"><i class="icon-ban-circle icon-white"></i></span>
{% endif %}
</td>
<td>{{ version.version_number }}</td>
<td><i>{{ version.creation_time }}</i></td>
<td>
<input type="radio" value="{{ version.version_number }}" name="rev1">
<input type="radio" value="{{ version.version_number }}" name="rev2">
</td>
<td>
<a href="{% model_url version %}" title="{% trans 'Show version number' %} {{ version.version_number }}" class="btn btn-mini">
<i class="icon-search"></i>
</a>
{# TODO: add delete version function #}
<a href="{% model_url version 'delete' %}" title="{% trans 'Delete version number' %} {{ version.version_number }}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
</td>
</tr>
{% if forloop.last %}
</table>
</form>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}
<!-- Log -->
{% if perms.motion.can_manage_motion %}
<button type="button" class="btn" data-toggle="collapse" data-target="#log">
{% trans "Show log" %}
</button>
<div id="log" class="collapse out">
<ul class="unstyled">
{% for message in motion.log_messages.all %}
<li><small>{{ message }}</small></li>
{% endfor %}
</ul>
</div>
{% endif %}
</div> <!--/span-->
<!-- Box with meta information -->
<div class="span4">
<div class="well">
<!-- Submitter -->
<h5>{% trans "Submitter" %}:</h5>
{% for submitter in motion.submitter.all %}
{{ submitter.person }}{% if not forloop.last %}, {% endif %}
{% endfor %}
<!-- Supporters -->
{% if min_supporters > 0 %}
<h5>{% trans "Supporters" %}: *</h5>
{% if not motion.supporters %}
-
{% else %}
<ol>
{% for supporter in motion.supporter.all %}
<li>{{ supporter }}</li>
{% endfor %}
</ol>
{% endif %}
{% endif %}
<!-- Status -->
<h5>{% trans "Status" %}:</h5>
{% if motion.state_id != "pub" %}
{# TODO: trans motion.state #}
<span class="label label-info">{{ motion.state }}</span>
<br>
{% endif %}
{% for note in motion.notes %}
{{ note }}
{% if not forloop.last %}<br>{% endif %}
{% endfor %}
<!-- Vote results -->
<h5>{% trans "Vote results" %}:</h5>
{% with motion.polls.all as polls %}
<ol>
{% for poll in polls %}
{% if perms.motion.can_manage_motion or poll.has_votes %}
<li>{% trans "Vote" %}
{% if perms.motion.can_manage_motion %}
<a class="btn btn-mini" href="{% url 'motion_poll_edit' motion.id poll.id %}" title="{% trans 'Edit Vote' %}"><i class="icon-edit"></i></a>
<a class="btn btn-mini" href="{% url 'motion_poll_delete' motion.id poll.id %}" title="{% trans 'Delete Vote' %}"><i class="icon-remove"></i></a>
{% endif %}
<br>
{% if poll.has_votes %}
{% with poll.get_options.0 as option %}
<img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ option.Yes }}<br>
<img src="{% static 'img/voting-no.png' %}" title="{% trans 'No' %}"> {{ option.No }}<br>
<img src="{% static 'img/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ option.Abstain }}<br>
<img src="{% static 'img/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> {{ poll.print_votesinvalid }}<br>
<div style="border-top: 1px solid; padding-top: 5px; margin: 5px 0; width: 10em;">
<img src="{% static 'img/voting-total.png' %}" title="{% trans 'Votes cast' %}"> {{ poll.print_votescast }}
</div>
{% endwith %}
{% else %}
{% if perms.motion.can_manage_motion %}
<span class="label label-info">{% trans 'No results' %}</span>
{% endif %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ol>
{% if allowed_actions.create_poll %}
<a href="{% url 'motion_poll_create' motion.id %}" class="btn btn-mini">
<i class="icon-assignment"></i> {% trans 'New vote' %}
</a>
{% endif %}
{% endwith %}
<!-- Category -->
<h5>{% trans "Category" %}:</h5>
{{ motion.category }}
<!-- Creation Time -->
<h5>{% trans "Creation Time" %}:</h5>
{# TODO: use creation time of _first_ version #}
{{ motion.version.creation_time }}
<!-- Widthdraw button -->
{% if allowed_actions.wit and user in motion.submitters %}
<br><br>
<a href="{% url 'motion_set_state' motion.id 'wit' %}" class="btn">
<span class="icon revert">{% trans 'Withdraw motion' %}</span>
</a>
{% endif %}
<!-- Support/Unsupport button -->
{% if perms.motion.can_support_motion and min_supporters > 0 %}
{% if allowed_actions.unsupport %}
<br><br>
<a href="{% url 'motion_unsupport' motion.id %}" class="btn">
{% trans 'Unsupport' %}
</a>
{% endif %}
{% if allowed_actions.support %}
<br><br>
<a href="{% url 'motion_support' motion.id %}" class="btn">
{% trans 'Support' %}
</a>
{% endif %}
{% endif %}
<!-- Footnote: requried supporters -->
{% if min_supporters > 0 %}
<br><br>
<small>* {% trans "minimum required supporters" %}: {{ min_supporters }}</small>
{% endif %}
</div> <!--/well-->
{% if perms.motion.can_manage_motion %}
<!-- Manage motion box -->
<div class="well">
<h4>{% trans "Manage motion" %}</h4>
<div class="btn-group btn-group-vertical">
{% for state in motion.state.next_states.all %}
<a href="{% url 'motion_set_state' motion.pk state.pk %}" class="btn btn-small">{{ state }}</a>
{% endfor %}
</div>
<p></p>
<hr>
<h5>{% trans "For administration only:" %}</h5>
<a href="{% url 'motion_reset_state' motion.id %}" class="btn btn-danger">
<i class="icon-exclamation-sign icon-white"></i> {% trans 'Reset state' %}
</a>
</div> <!--/well-->
{% endif %}
</div> <!--/span-->
</div> <!--/row-->
{% endblock %}