Merge pull request #90 from ostcar/new_motion

New motion and new template
This commit is contained in:
Oskar Hahn 2013-02-06 00:38:30 -08:00
commit 44ea7c835d
213 changed files with 5551 additions and 6283 deletions

View File

@ -8,4 +8,4 @@ install:
- python extras/scripts/create_local_settings.py - python extras/scripts/create_local_settings.py
script: script:
- coverage run ./manage.py test tests && coverage report -m - coverage run ./manage.py test tests && coverage report -m
- pep8 --max-line-length=150 --exclude="urls.py,motion/" --statistics openslides - pep8 --max-line-length=150 --exclude="urls.py," --statistics openslides

6
THANKS
View File

@ -12,14 +12,14 @@ OpenSlides uses parts of the following projects:
* jQuery UI * jQuery UI
<http://jqueryui.com/> <http://jqueryui.com/>
* Twitter Bootstrap
<http://twitter.github.com/bootstrap/>
* ReportLab * ReportLab
<http://www.reportlab.com/software/opensource/rl-toolkit/> <http://www.reportlab.com/software/opensource/rl-toolkit/>
* Drupal (tabledrag function) * Drupal (tabledrag function)
<http://www.drupal.org/> <http://www.drupal.org/>
* Oxygen-Icons
<http://www.oxygen-icons.org/>
* Ubuntu TrueType Font * Ubuntu TrueType Font
<http://font.ubuntu.com/> <http://font.ubuntu.com/>

View File

@ -31,12 +31,8 @@ URL_SETS = {
"/jsi18n/", "/jsi18n/",
"/static/styles/base.css", "/static/styles/base.css",
"/static/javascript/utils.js", "/static/javascript/utils.js",
"/static/javascript/jquery.js", "/static/javascript/jquery.min.js",
"/static/images/bg-submenu.gif", "/static/img/logo.png",
"/static/images/bg-header.gif",
"/static/images/logo.png",
"/static/images/icons/dialog-information.png",
"/static/images/icons/cross.png",
], ],
"agenda": [ "agenda": [
"/agenda/", "/agenda/",
@ -44,25 +40,15 @@ URL_SETS = {
"/static/styles/tabledrag.css", "/static/styles/tabledrag.css",
"/static/javascript/utils.js", "/static/javascript/utils.js",
"/static/styles/agenda.css", "/static/styles/agenda.css",
"/static/javascript/jquery.js", "/static/javascript/jquery.min.js",
"/jsi18n/", "/jsi18n/",
"/static/images/bg-header.gif",
"/static/images/bg-submenu.gif",
"/static/images/logo.png",
"/static/images/icons/application-pdf.png",
"/static/images/icons/cross.png",
], ],
"application": [ "application": [
"/application/", "/application/",
"/static/styles/base.css", "/static/styles/base.css",
"/static/javascript/utils.js", "/static/javascript/utils.js",
"/static/javascript/jquery.js", "/static/javascript/jquery.min.js",
"/jsi18n/", "/jsi18n/",
"/static/images/bg-header.gif",
"/static/images/bg-submenu.gif",
"/static/images/icons/cross.png",
"/static/images/logo.png",
"/static/images/icons/application-pdf.png",
] ]
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

View File

@ -20,7 +20,7 @@ function hideClosedSlides(hide) {
if (hide) { if (hide) {
$('#hidelink').attr('title', 'show'); $('#hidelink').attr('title', 'show');
$('#hidelink').removeClass('hide').addClass('show'); $('#hidelink').removeClass('hide').addClass('show');
$('.close_link.closed').parent().parent().each(function() { $('.close_link .icon-checked-new').parent().parent().parent().each(function() {
hideLine($(this)); hideLine($(this));
}); });
hidden = $('#menu-overview tr:hidden').size(); hidden = $('#menu-overview tr:hidden').size();
@ -35,21 +35,26 @@ function hideClosedSlides(hide) {
} }
$(function() { $(function() {
$('.close_link a').click(function(event) { // change participant status (on/off)
$('.close_link').click(function(event) {
event.preventDefault(); event.preventDefault();
slide = $(this); var link = $(this);
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: slide.attr('href'), url: $(this).attr('href'),
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if (data.closed) { if (data.closed) {
newclass = 'closed'; newclass = 'icon-checked-new';
link.parent().parent().addClass('offline');
link.addClass('btn-success');
} else { } else {
newclass = 'open'; newclass = 'icon-unchecked-new';
link.parent().parent().removeClass('offline');
link.removeClass('btn-success');
} }
slide.parent().removeClass('closed open').addClass(newclass); link.children('i').removeClass('icon-checked-new icon-unchecked-new').addClass(newclass);
slide.attr('href', data.link); link.attr('href', data.link);
} }
}); });
}); });

View File

@ -5,20 +5,7 @@
* :license: GNU GPL, see LICENSE for more details. * :license: GNU GPL, see LICENSE for more details.
*/ */
/* agenda item open/closed */ tr.topline td {
.close_link span { border-bottom: 1px solid #333333;
background-image: url(../images/icons/close-grey.png); background-color: #CDCDCD;
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
display: inline-block;
}
.close_link.closed span {
background-image: url(../images/icons/close.png);
}
table#menu-overview {
white-space: nowrap;
} }

View File

@ -1,43 +0,0 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block submenu %}
{% url 'item_overview' as url_itemoverview %}
{% url 'item_new' as url_itemnew %}
<h4 class="sectiontitle">{% trans "Agenda" %}</h4>
<ul>
<li class="{% if request.path == url_itemoverview %}selected{% endif %}"><a href="{% url 'item_overview' %}">{% trans "All items" %}</a></li>
{% if perms.agenda.can_manage_agenda %}
<li class="{% active request '/agenda/new/' %}"><a href="{% url 'item_new' %}">{% trans "New item" %}</a></li>
{% endif %}
<li><a href="{% url 'print_agenda' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Agenda as PDF' %}</a></li>
</ul>
{# second submenu #}
{% if item %}
<br>
<h3>{{ item.title }}</h3>
<ul>
{# view item #}
{% url 'item_view' item.id as url_itemview %}
<li class="{% if request.path == url_itemview %}selected{% endif %}"><a href="{% url 'item_view' item.id %}">{% trans 'View item' %}</a></li>
{% if perms.agenda.can_manage_agenda %}
{# edit item #}
{% url 'item_edit' item.id as url_itemedit %}
<li class="{% if request.path == url_itemedit %}selected{% endif %}"><a href="{% url 'item_edit' item.id %}"><img src="{% static 'images/icons/edit.png' %}"> {% trans 'Edit item' %}</a></li>
{# delete item #}
<li><a href="{% url 'item_delete' item.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete item' %}</a></li>
{% endif %}
{# activate item #}
{% if perms.projector.can_manage_projector %}
<li><a href="{% url 'projector_activate_slide' item.sid %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Show item' %}</a></li>
{% endif %}
</ul>
{% endif %}
{% endblock %}

View File

@ -5,7 +5,9 @@
{% block title %}{{ block.super }} {% trans "Agenda settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Agenda settings" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Agenda settings" %}</h1> <h1>{% trans "Configuration" %}: {% trans "Agenda" %}
{% block config_submenu %}{{ block.super }}{% endblock %}
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<p> <p>

View File

@ -1,4 +1,4 @@
{% extends "agenda/base_agenda.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
@ -12,24 +12,22 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if item %} <h1>
<h1>{% trans "Edit item" %}</h1> {% if item %}
{% else %} {% trans "Edit item" %}
<h1>{% trans "New item" %}</h1> {% else %}
{% endif %} {% trans "New item" %}
{% endif %}
<small class="pull-right">
<a href="{% url 'item_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_saveapply.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href='{% url 'item_overview' %}' class="btn">
</button> {% trans 'Cancel' %}
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href="{% url 'item_overview' %}">
<button class="button" type="button" onclick="window.location='{% url 'item_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a> </a>
</p> </p>
<small>* {% trans "required" %}</small> <small>* {% trans "required" %}</small>

View File

@ -1,17 +1,17 @@
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% load tags %} {% load tags %}
<td> <td>
<span class="close_link{% if item.closed %} closed{% endif %}"> {% if perms.agenda.can_manage_agenda %}
{% if perms.agenda.can_manage_agenda %} <a href="{% if item.closed %}{% url 'item_open' item.id %}{% else %}{% url 'item_close' item.id %}{% endif %}"
<a href="{% if item.closed %}{% url 'item_open' item.id %}{% else %}{% url 'item_close' item.id %}{% endif %}" title="{% trans 'Mark item as done' %}"> class="close_link btn btn-mini {% if item.closed %}btn-success{% endif %}" title="{% trans 'Change status (open/closed)' %}">
<span></span> <i class="{% if item.closed %}icon-checked-new{% else %}icon-unchecked-new{% endif %}"></i>
</a> </a>
{% elif item.closed %} {% else %}
<img src="{% static 'images/icons/close.png' %}" title="{% trans 'Item closed' %}"> <span class="close_link">
{% endif %} <i class="{% if item.closed %}icon-checked-new{% else %}icon-unchecked-new{% endif %}"></i>
</span> </span>
{% endif %}
</td> </td>
<td> <td>
{% for p in item.get_ancestors %} {% for p in item.get_ancestors %}
@ -24,7 +24,7 @@
{{ item.get_title_supplement|safe }} {{ item.get_title_supplement|safe }}
</td> </td>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<td> <td class="optional">
{{ item.comment|first_line }} {{ item.comment|first_line }}
</td> </td>
{% endif %} {% endif %}
@ -32,28 +32,32 @@
<td> <td>
<span style="width: 1px; white-space: nowrap;"> <span style="width: 1px; white-space: nowrap;">
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<a class="activate_link {% if item.active %}active{% endif %}" href="{% url 'projector_activate_slide' item.sid %}" title="{% trans 'Activate item' %}"> <a href="{% url 'projector_activate_slide' item.sid %}" class="activate_link btn {% if item.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<span></span> <i class="icon-facetime-video {% if item.active %}icon-white{% endif %}"></i>
</a> </a>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<a href="{% model_url item 'edit' %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit item' %}"></a> <a href="{% model_url item 'edit' %}" title="{% trans 'Edit' %}" class="btn btn-mini">
<a href="{% model_url item 'delete' %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete item' %}"></a> <i class="icon-pencil"></i>
</a>
<a href="{% model_url item 'delete' %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
{% if not item.is_leaf_node %} {% if not item.is_leaf_node %}
<a class="activate_link" href="{% url 'projector_activate_slide' item.sid 'summary' %}"> <a href="{% url 'projector_activate_slide' item.sid 'summary' %}" class="activate_link btn btn-mini" title="{% trans 'Show summary for this item' %}">
<img src="{% static 'images/icons/summary.png' %}" title="{% trans 'Activate summary for this item' %}"> <i class="icon-summary"></i>
</a> </a>
{% endif %} {% endif %}
{% endif %} {% endif %}
</span> </span>
</td> </td>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda %} <td class="tabledrag-hide" style="display: none;">
<td class="tabledrag-hide">
{% with form=item.weight_form %} {% with form=item.weight_form %}
{{ form.weight }} {{ form.weight }}
{{ form.self }} {{ form.self }}
{{ form.parent }} {{ form.parent }}
{% endwith %} {% endwith %}
</td> </td>
{% endif %}

View File

@ -1,4 +1,4 @@
{% extends "agenda/base_agenda.html" %} {% extends "base.html" %}
{% load tags %} {% load tags %}
{% load i18n %} {% load i18n %}
@ -10,11 +10,13 @@
{% block header %} {% block header %}
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/tabledrag.css' %}" /> <link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/tabledrag.css' %}" />
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/agenda.css' %}" /> <link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/agenda.css' %}" />
{% endblock %}
{% block javascript %}
<script type="text/javascript" src="{% static 'javascript/agenda.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/agenda.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/jquery.cookie.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/jquery.cookie.js' %}"></script>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<script type="text/javascript" src="{% static 'javascript/jquery.once.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/jquery.once.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/jquery.tmpl.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/jquery.tmpl.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/tabledrag.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/tabledrag.js' %}"></script>
<script type="text/javascript"> <script type="text/javascript">
@ -37,63 +39,72 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<div id="changed-order-message" style="display:none" class="notification warning"> <div id="changed-order-message" style="display:none" class="alert alert-warning">
<em>{% trans "Do you want to save the changed order of agenda items?" %}<br> <button type="button" class="close" data-dismiss="alert">×</button>
<input type="submit" value="{% trans 'Yes' %}"> <p>{% trans "Do you want to save the changed order of agenda items?" %}</p>
<input type="button" onclick="window.location.href='{% url 'item_overview' %}';" value="{% trans 'No' %}"> <p>
</em> <button class="btn" type="submit">{% trans 'Yes' %}</button>
<a href="{% url 'item_overview' %}" class="btn">{% trans 'No' %}</a>
</p>
</div> </div>
{% endif %} {% endif %}
<h1>{% trans "Agenda" %}</h1> <h1>{% trans "Agenda" %}
<small class="pull-right">
{% if perms.agenda.can_manage_agenda %}
<a href="{% url 'item_new' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'New item' %}"><i class="icon-plus"></i> {% trans "New" %}</a>
{% endif %}
<a href="{% url 'print_agenda' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Print agenda as PDF' %}"><i class="icon-print"></i> PDF</a>
</small>
</h1>
<p> <label class="checkbox">
{% trans "Filter" %}: <input type="checkbox" id="hide_closed_items"> {% trans "Hide closed items" %}
<input type="checkbox" id="hide_closed_items"> {% trans "Hide closed items" %} </label>
</p>
{{ items|length }} <small><i>{{ items|length }}
{% blocktrans count counter=items|length %}item{% plural %}items{% endblocktrans %}<span id="hiddencount"></span> {% blocktrans count counter=items|length %}item{% plural %}items{% endblocktrans %}<span id="hiddencount"></span>
<table id="menu-overview" class="agendatable"> </i></small>
<table id="menu-overview" class="table table-striped table-bordered">
<tr> <tr>
<th width="50">{% trans "Done" %}</th> <th class="mini_width"></th>
<th>{% trans "Item" %}</th> <th>{% trans "Item" %}</th>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<th width="200">{% trans "Comment" %}</th> <th width="200" class="optional">{% trans "Comment" %}</th>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %}
<th width="50">{% trans "Actions" %}</th> <th class="mini_width">{% trans "Actions" %}</th>
{% endif %}
{% if perms.agenda.can_manage_agenda %}
<th class="tabledrag-hide">{% trans "Weight" %}</th>
{% endif %} {% endif %}
<th class="tabledrag-hide" style="display: none;">
{% trans "Weight" %}
</th>
</tr> </tr>
<tr class="topline{% if active_sid == 'agenda' %} activeline{% endif %}"> <tr class="topline{% if active_sid == 'agenda' %} activeline{% endif %}">
<td></td> <td></td>
<td> <td>
<strong>{% trans "Agenda" %}</strong> {% trans "Agenda" %}
</td> </td>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<td></td> <td class="optional"></td>
{% endif %} {% endif %}
{% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %}
<td> <td>
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<span> <span>
<a class="activate_link{% if active_sid == 'agenda' %} active{% endif %}" href="{% url 'projector_activate_slide' 'agenda' %}" title="{% trans 'Activate item' %}"> <a href="{% url 'projector_activate_slide' 'agenda' %}" class="activate_link btn {% if active_sid == 'agenda' %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<span></span> <i class="icon-facetime-video {% if active_sid == 'agenda' %}icon-white{% endif %}"></i>
</a> </a>
</span> <span>
{% endif %} {% endif %}
</td> </td>
{% endif %} {% endif %}
</tr> </tr>
{% if items %} {% if items %}
{% for item in items %} {% for item in items %}
<tr class="itemline draggable{% cycle ' odd' '' %}{% if item.active %} activeline{% endif %}"> <tr class="draggable{% if item.active %} activeline{% endif %}{% if item.closed %} offline{% endif %}">
{% include "agenda/item_row.html" %} {% include "agenda/item_row.html" %}
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -1,11 +1,35 @@
{% extends "agenda/base_agenda.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{{ block.super }} {{ item.title }}{% endblock %} {% block title %}{{ block.super }} {{ item.title }}{% endblock %}
{% block content %} {% block content %}
<h1>{{ item }}</h1> <h1>
{{ item }}
<small class="pull-right">
<div class="btn-toolbar">
<a href="{% url 'item_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
<div class="btn-group">
<a data-toggle="dropdown" href="#" class="btn btn-mini dropdown-toggle">
{% trans 'More actions' %}
<span class="caret"></span>
</a>
{% if perms.agenda.can_manage_agenda %}
<ul class="dropdown-menu pull-right">
<li><a href="{% url 'item_edit' item.id %}"><i class="icon-edit"></i> {% trans 'Edit item' %}</a></li>
<li><a href="{% url 'item_delete' item.id %}"><i class="icon-remove"></i> {% trans 'Delete item' %}</a></li>
</ul>
{% endif %}
</div>
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' item.sid %}" class="activate_link btn btn-mini {% if item.active %}btn-primary{% endif %}" rel="tooltip" data-original-title="{% trans 'Show' %}">
<i class="icon icon-facetime-video {% if item.active %}icon-white{% endif %}"></i>
</a>
{% endif %}
</div>
</small>
</h1>
<p>{{ item.text|safe|linebreaks }}</p> <p>{{ item.text|safe|linebreaks }}</p>
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}

View File

@ -1,12 +1,11 @@
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load tags %} {% load tags %}
<ul style="line-height: 180%"> <ul style="line-height: 180%">
<li class="{% if agenda.active %}activeline{% endif %}"> <li class="{% if agenda.active %}activeline{% endif %}">
<a href="{% url 'projector_activate_slide' agenda.key %}" class="activate_link {% if agenda.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' agenda.key %}" class="activate_link btn {% if agenda.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<div></div> <i class="icon-facetime-video {% if agenda.active %}icon-white{% endif %}"></i>
</a> </a>&nbsp;
<a href="{% url 'projctor_preview_slide' agenda.key %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' agenda.key %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
@ -17,27 +16,22 @@
<ul style="line-height: 180%"> <ul style="line-height: 180%">
{% for item in items %} {% for item in items %}
<li class="{% if item.active %}activeline{% endif %}"> <li class="{% if item.active %}activeline{% endif %}">
<a href="{% url 'projector_activate_slide' item.sid %}" class="activate_link {% if item.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' item.sid %}" class="activate_link btn {% if item.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<div></div> <i class="icon-facetime-video {% if item.active %}icon-white{% endif %}"></i>
</a>&nbsp;
<a href="{% model_url item 'edit' %}" title="{% trans 'Edit' %}" class="btn btn-mini right">
<i class="icon-pencil"></i>
</a> </a>
<a href="{% model_url item 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% url 'projctor_preview_slide' item.sid %}" title="{% trans 'Preview' %}" class="btn btn-mini right">
<span></span> <i class="icon-search"></i>
</a>
<a href="{% model_url item 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url 'projctor_preview_slide' item.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a> </a>
{% if not item.is_leaf_node %} {% if not item.is_leaf_node %}
<a class="activate_link right" href="{% url 'projector_activate_slide' item.sid 'summary' %}"> <a class="activate_link btn btn-mini {% if item.active %}btn-primary{% endif %} right" href="{% url 'projector_activate_slide' item.sid 'summary' %}" title="{% trans 'Show summary for this item' %}">
<img src="{% static 'images/icons/summary.png' %}" <i class="icon-summary {% if item.active %}icon-white{% endif %}"></i>
title="{% trans 'Activate summary for this item' %}"
style="padding-right: 2px;">
</a> </a>
{% endif %} {% endif %}
{% for p in item.get_ancestors %} {% for p in item.get_ancestors %}
<span class="indentation">&nbsp;</span> <span class="indentation"></span>
{% endfor %} {% endfor %}
<a href="{% model_url item 'view' %}">{{ item }}</a> <a href="{% model_url item 'view' %}">{{ item }}</a>
{{ item.get_title_supplement|safe }} {{ item.get_title_supplement|safe }}

View File

@ -91,7 +91,7 @@ class SetClosed(RedirectView, SingleObjectMixin):
""" """
permission_required = 'agenda.can_manage_agenda' permission_required = 'agenda.can_manage_agenda'
allow_ajax = True allow_ajax = True
url = 'item_overview' url_name = 'item_overview'
model = Item model = Item
def get_ajax_context(self, **kwargs): def get_ajax_context(self, **kwargs):
@ -123,16 +123,7 @@ class ItemUpdate(UpdateView):
model = Item model = Item
context_object_name = 'item' context_object_name = 'item'
form_class = ItemForm form_class = ItemForm
success_url = 'item_overview' success_url_name = 'item_overview'
apply_url = 'item_edit'
def get_success_url(self):
messages.success(
self.request, _("Item %s was successfully modified.")
% html_strong(self.request.POST['title']))
if 'apply' in self.request.POST:
return ''
return reverse(super(UpdateView, self).get_success_url())
class ItemCreate(CreateView): class ItemCreate(CreateView):
@ -144,16 +135,7 @@ class ItemCreate(CreateView):
model = Item model = Item
context_object_name = 'item' context_object_name = 'item'
form_class = ItemForm form_class = ItemForm
success_url = 'item_overview' success_url_name = 'item_overview'
apply_url = 'item_edit'
def get_success_url(self):
messages.success(
self.request, _("Item %s was successfully created.")
% html_strong(self.request.POST['title']))
if 'apply' in self.request.POST:
return reverse(self.get_apply_url(), args=[self.object.id])
return reverse(super(CreateView, self).get_success_url())
class ItemDelete(DeleteView): class ItemDelete(DeleteView):
@ -162,7 +144,8 @@ class ItemDelete(DeleteView):
""" """
permission_required = 'agenda.can_manage_agenda' permission_required = 'agenda.can_manage_agenda'
model = Item model = Item
url = 'item_overview' question_url_name = 'item_overview'
success_url_name = 'item_overview'
def get_answer_options(self): def get_answer_options(self):
if self.object.children.exists(): if self.object.children.exists():
@ -210,6 +193,7 @@ def register_tab(request):
selected = request.path.startswith('/agenda/') selected = request.path.startswith('/agenda/')
return Tab( return Tab(
title=_('Agenda'), title=_('Agenda'),
app='agenda',
url=reverse('item_overview'), url=reverse('item_overview'),
permission=(request.user.has_perm('agenda.can_see_agenda') or permission=(request.user.has_perm('agenda.can_see_agenda') or
request.user.has_perm('agenda.can_manage_agenda')), request.user.has_perm('agenda.can_manage_agenda')),
@ -220,12 +204,11 @@ def get_widgets(request):
""" """
return the agenda widget for the projector-tab. return the agenda widget for the projector-tab.
""" """
return [ return [Widget(
Widget( name='agenda',
name='agenda', display_name=_('Agenda'),
display_name=_('Agenda'), template='agenda/widget.html',
template='agenda/widget.html', context={
context={ 'agenda': SLIDE['agenda'],
'agenda': SLIDE['agenda'], 'items': Item.objects.all()},
'items': Item.objects.all()}, permission_required='projector.can_manage_projector')]
permission_required='projector.can_manage_projector')]

View File

@ -24,9 +24,6 @@ $(function() {
line.parent().parent().children('td').addClass('elected') line.parent().parent().children('td').addClass('elected')
} }
line.attr('href', data.link); line.attr('href', data.link);
},
error: function () {
alert("Ajax Error");
} }
}); });
}); });
@ -48,22 +45,24 @@ $(function() {
} }
}); });
}); });
// change publish status of ballot
$('.publish_link').click(function(event) { $('.publish_link').click(function(event) {
event.preventDefault(); event.preventDefault();
link = $(this); var link = $(this);
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: link.attr('href'), url: $(this).attr('href'),
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if (data.published) { if (data.published) {
link.addClass('published'); newclass = 'icon-checked-new_white';
//link.attr('title', gettext('Unpublish ballot')) link.addClass('btn-primary');
} else { } else {
link.removeClass('published'); newclass = 'icon-unchecked-new';
//link.attr('title', 'Publish ballot') link.removeClass('btn-primary');
} }
link.children('i').removeClass('icon-checked-new_white icon-unchecked-new').addClass(newclass);
link.attr('href', data.link);
} }
}); });
}); });});
});

View File

@ -10,7 +10,7 @@ td.elected {
} }
td.elected a.election_link { td.elected a.election_link {
background-image: url(../images/icons/voting-yes.png); background-image: url(../img/voting-yes.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
width: 16px; width: 16px;
@ -21,7 +21,7 @@ td.elected a.election_link {
} }
td a.election_link { td a.election_link {
background-image: url(../images/icons/voting-yes-grey.png); background-image: url(../img/voting-yes-grey.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
width: 16px; width: 16px;
@ -30,15 +30,3 @@ td a.election_link {
margin-right: 5px; margin-right: 5px;
float: left; float: left;
} }
a.publish_link span {
background-image: url(../images/icons/off.png);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
display: inline-block;
}
a.publish_link.published span {
background-image: url(../images/icons/on.png);
}

View File

@ -1,76 +0,0 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block header %}
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/assignment.css' %}" />
<script type="text/javascript" src="{% static 'javascript/assignment.js' %}"></script>
{% endblock %}
{% block submenu %}
{% url 'assignment_overview' as url_assignment_overview %}
<h4 class="sectiontitle">{% trans "Elections" %}</h4>
<ul>
<li class="{% if request.path == url_assignment_overview %}selected{% endif %}"><a href="{% url 'assignment_overview' %}">{% trans "All elections" %}</a></li>
{% if perms.assignment.can_manage_assignment %}
<li class="{% active request '/assignment/new' %}"><a href="{% url 'assignment_new' %}">{% trans "New election" %}</a></li>
{% endif %}
<li><a href="{% url 'print_assignment' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'All elections as PDF' %}</a></li>
</ul>
{# second submenu #}
{% if assignment %}
<br>
<h3>{{assignment}}</h3>
<ul>
{# view assignemnt #}
{% url 'assignment_view' assignment.id as url_assignmentview %}
<li class="{% if request.path == url_assignmentview %}selected{% endif %}">
<a href="{% url 'assignment_view' assignment.id %}">{% trans 'View election' %}</a>
</li>
{% if perms.assignment.can_manage_assignment %}
{# edit assignemnt #}
{% url 'assignment_edit' assignment.id as url_assignmentedit %}
<li class="{% if request.path == url_assignmentedit %}selected{% endif %}">
<a href="{% url 'assignment_edit' assignment.id %}"><img src="{% static 'images/icons/edit.png' %}"> {% trans 'Edit election' %}</a>
</li>
{# delete assignment #}
<li>
<a href="{% url 'assignment_delete' assignment.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete election' %}</a>
</li>
{% endif %}
{# PDF #}
<li>
<a href="{% url 'print_assignment' assignment.id %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Election as PDF' %}</a>
</li>
{# activate #}
{% if perms.projector.can_manage_projector %}
<li>
<a class="activate_link {% if item.active %}active{% endif %}" href="{% url 'projector_activate_slide' assignment.sid %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Show election' %}</a>
</li>
{% endif %}
{# agenda #}
{% if perms.agenda.can_manage_agenda %}
<li>
<a href="{% url 'assignment_create_agenda' assignment.id %}">{% trans 'New agenda item' %}</a>
</li>
{% endif %}
{# polls #}
{% if perms.assignment.can_manage_assignment %}
{% for poll in polls %}
{% url 'assignment_poll_view' poll.id as url_assignmentpollview %}
<li class="{% if request.path == url_assignmentpollview %}selected{% endif %}"><a href="{% url 'assignment_poll_view' poll.id %}"><img src="{% static 'images/icons/edit.png' %}"> {{ forloop.counter }}. {% trans "ballot" %}</a></li>
{% endfor %}
{% endif %}
</ul>
{% endif %}
{% endblock %}

View File

@ -5,18 +5,19 @@
{% block title %}{{ block.super }} {% trans "Election settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Election settings" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Election settings" %}</h1> <h1>
{% trans "Configuration" %}
<small>{% trans "Elections" %}</small>
{% block config_submenu %}{{ block.super }}{% endblock %}
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_save.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href="{% url 'config_assignment' %}" class="btn">
</button> {% trans 'Cancel' %}
<a href="{% url 'config_assignment' %}"> </a>
<button class="button" type="button" onclick="window.location='{% url 'config_assignment' %}'"> </p>
<span class="icon cancel">{% trans 'Cancel' %}</span> <small>* {% trans "required" %}</small>
</button>
</a>
</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "assignment/base_assignment.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
@ -11,27 +11,24 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if assignment %} <h1>
<h1>{% trans "Edit election" %}</h1> {% if assignment %}
{% else %} {% trans "Edit election" %}
<h1>{% trans "New election" %}</h1> {% else %}
{% endif %} {% trans "New election" %}
{% endif %}
<small class="pull-right">
<a href="{% url 'assignment_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_saveapply.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href='{% url 'assignment_overview' %}' class="btn">
</button> {% trans 'Cancel' %}
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href="{% url 'assignment_overview' %}">
<button class="button" type="button" onclick="window.location='{% url 'assignment_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a> </a>
</p> </p>
<small>* {% trans "required" %}</small> <small>* {% trans "required" %}</small>

View File

@ -1,35 +1,44 @@
{% extends "assignment/base_assignment.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Elections" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Elections" %}{% endblock %}
{% block content %}
<h1>{% trans "Elections" %}</h1>
<p><form action="{{request.url}}" name="filter" method="get"> {% block content %}
<h1>{% trans "Elections" %}
<small class="pull-right">
{% if perms.assignment.can_manage_assignment %}
<a href="{% url 'assignment_new' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'New election' %}"><i class="icon-plus"></i> {% trans "New" %}</a>
{% endif %}
{% if perms.assignment.can_see_assignment %}
<a href="{% url 'print_assignment' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Print all elections as PDF' %}"><i class="icon-print"></i> PDF</a>
{% endif %}
</small>
</h1>
<form action="{{request.url}}" name="filter" method="get">
{% trans "Filter" %}: {% trans "Filter" %}:
<select class="default-input" name="status" onchange="document.forms['filter'].submit()"> <select class="span3" name="status" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Status" %}--</option> <option value="---">-- {% trans "Status" %}--</option>
<option value="sea" {% if 'sea' in request.GET.status %}selected{% endif %}>{% trans "Searching for candidates" %}</option> <option value="sea" {% if 'sea' in request.GET.status %}selected{% endif %}>{% trans "Searching for candidates" %}</option>
<option value="vot" {% if 'vot' in request.GET.status %}selected{% endif %}>{% trans "Voting" %}</option> <option value="vot" {% if 'vot' in request.GET.status %}selected{% endif %}>{% trans "Voting" %}</option>
<option value="fin" {% if 'fin' in request.GET.status %}selected{% endif %}>{% trans "Finished" %}</option> <option value="fin" {% if 'fin' in request.GET.status %}selected{% endif %}>{% trans "Finished" %}</option>
</select> </select>
</form> </form>
</p>
{{ assignments|length }} <small><i>{{ assignments|length }}
{% blocktrans count counter=assignments|length %}election{% plural %}elections{% endblocktrans %} {% blocktrans count counter=assignments|length %}election{% plural %}elections{% endblocktrans %}
<table> </i></small>
<table class="table table-striped table-bordered">
<tr> <tr>
<th><a href="?sort=name{% if 'name' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Election" %}</a></th> <th><a href="?sort=name{% if 'name' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Election" %}</a></th>
<th>{% trans "Candidates" %}</th> <th>{% trans "Candidates" %}</th>
<th><a href="?sort=status{% if 'status' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Status" %}</a></th> <th class="optional"><a href="?sort=status{% if 'status' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Status" %}</a></th>
<th style="width: 1px;">{% trans "Actions" %}</th> <th class="mini_width">{% trans "Actions" %}</th>
</tr> </tr>
{% for assignment in assignments %} {% for assignment in assignments %}
<tr class="{% cycle '' 'odd' %} <tr {% if assignment.active %}activeline{% endif %}">
{% if assignment.active %}activeline{% endif %}">
<td><a href="{% url 'assignment_view' assignment.id %}">{{ assignment }}</a></td> <td><a href="{% url 'assignment_view' assignment.id %}">{{ assignment }}</a></td>
<td> <td>
{% blocktrans with posts=assignment.posts context "Number of searched candidates for an election"%}posts: {{ posts }}{% endblocktrans %} {% blocktrans with posts=assignment.posts context "Number of searched candidates for an election"%}posts: {{ posts }}{% endblocktrans %}
@ -38,19 +47,25 @@
{% endif %} {% endif %}
| {% blocktrans with elected=assignment.elected|length %}elected: {{ elected }}{% endblocktrans %} | {% blocktrans with elected=assignment.elected|length %}elected: {{ elected }}{% endblocktrans %}
</td> </td>
<td>{{ assignment.get_status_display }}</td> <td class="optional">{{ assignment.get_status_display }}</td>
<td> <td>
<span style="width: 1px; white-space: nowrap;"> <span style="width: 1px; white-space: nowrap;">
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<a class="activate_link {% if assignment.active %}active{% endif %}" href="{% url 'projector_activate_slide' assignment.sid %}" title="{% trans 'Activate election' %}"> <a href="{% url 'projector_activate_slide' assignment.sid %}" class="activate_link btn {% if assignment.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<span></span> <i class="icon-facetime-video {% if assignment.active %}icon-white{% endif %}"></i>
</a> </a>
{% endif %} {% endif %}
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
<a href="{% url 'assignment_edit' assignment.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit election' %}"></a> <a href="{% url 'assignment_edit' assignment.id %}" title="{% trans 'Edit' %}" class="btn btn-mini">
<a href="{% url 'assignment_delete' assignment.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete election' %}"></a> <i class="icon-pencil"></i>
</a>
<a href="{% url 'assignment_delete' assignment.id %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
{% endif %} {% endif %}
<a href="{% url 'print_assignment' assignment.id %}" title="{% trans 'Election as PDF' %}"><img src="{% static 'images/icons/pdf.png' %}"></a> <a href="{% url 'print_assignment' assignment.id %}" class="btn btn-mini" title="{% trans 'Print election as PDF' %}">
<i class="icon-print"></i>
</a>
</span> </span>
</td> </td>
</tr> </tr>

View File

@ -1,19 +1,35 @@
{% extends 'assignment/base_assignment.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{{ block.super }} {% trans "Election" %} "{{ assignment }}" {{ ballotnumber }}. {% trans "ballot" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Election" %} "{{ assignment }}" {{ ballotnumber }}. {% trans "ballot" %}{% endblock %}
{% block content %} {% block content %}
<h1>{{ assignment }} {{ ballotnumber }}. {% trans "ballot" %}</h1> <h1>
{% if assignment.polldescription %} {{ assignment }}
<p><b>{% trans "Short description (for ballot paper)" %}:</b> {{ assignment.polldescription }}</p> <small>
{{ ballotnumber }}. {% trans "ballot" %}
</small>
<small class="pull-right">
<a href="{% url 'assignment_view' assignment.id %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to election" %}</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 %} {% endif %}
<i class="helptext">{% trans "Special values" %}: -1 = {% trans 'majority' %}; -2 = {% trans 'undocumented' %}</i> </small>
</h1>
<form action="" method="post" class="small-form">{% csrf_token %} {% if assignment.polldescription %}
<p><b>{% trans "Short description (for ballot paper)" %}:</b> {{ assignment.polldescription }}</p>
{% endif %}
<table style="width:auto"> <p>
{% trans "Special values" %}: <span class="badge badge-success">-1</span> = {% trans 'majority' %} | <span class="badge">-2</span> = {% trans 'undocumented' %}
</p>
<form action="" method="post" class="small-form">{% csrf_token %}
<table class="table table-striped table-bordered" style="width: auto;">
<tr> <tr>
<th>{% trans "Candidates" %}</th> <th>{% trans "Candidates" %}</th>
{% for value in poll.get_vote_values %} {% for value in poll.get_vote_values %}
@ -31,7 +47,7 @@
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
<tr class="total"> <tr>
<td>{% trans "Invalid votes" %}</td> <td>{% trans "Invalid votes" %}</td>
{% for value in poll.get_vote_values %} {% for value in poll.get_vote_values %}
{% if forloop.first %} {% if forloop.first %}
@ -41,7 +57,7 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</tr> </tr>
<tr class="total"> <tr class="total warning">
<td>{% trans "Votes cast" %}</td> <td>{% trans "Votes cast" %}</td>
{% for value in poll.get_vote_values %} {% for value in poll.get_vote_values %}
{% if forloop.first %} {% if forloop.first %}
@ -54,26 +70,21 @@
</table> </table>
<p> <p>
<a href="{% url 'print_assignment_poll' poll.id %}"> <a href="{% url 'print_assignment_poll' poll.id %}" class="btn">
<button class="button" type="button" onclick="window.location='{% url 'print_assignment_poll' poll.id %}'"> <i class="icon-print"></i> {% trans 'Ballot paper as PDF' %}
<span class="icon pdf">{% trans 'Ballot paper as PDF' %}</span>
</button>
</a> </a>
</p> </p>
<!-- Control buttons -->
<p> <div class="control-group">
<button class="button" type="submit"> <button type="submit" class="btn btn-primary">
<span class="icon ok">{% trans 'Save' %}</span> {% trans 'Save' %}
</button> </button>
<button class="button" type="submit" name="apply"> <button type="submit" name="apply" class="btn">
<span class="icon apply">{% trans 'Apply' %}</span> {% trans 'Apply' %}
</button> </button>
<a href="{% url 'assignment_view' poll.assignment.id %}"> <a href="{% url 'assignment_view' poll.assignment.id %}" class="btn">
<button class="button" type="button" onclick="window.location='{% url 'assignment_view' poll.assignment.id %}'"> {% trans 'Cancel' %}
<span class="icon cancel">{% trans 'Cancel' %}</span> </a>
</button> </div>
</a> </form>
</p>
</form>
{% endblock %} {% endblock %}

View File

@ -1,96 +1,121 @@
{% extends "assignment/base_assignment.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Election" %} "{{ assignment }}"{% endblock %} {% block title %}{{ block.super }} {% trans "Election" %} "{{ assignment }}"{% 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 %} {% block content %}
<div id="sidebar"> <h1>
<div class="box"> {{ assignment }}
<h4>{% trans "Status" %}:</h4> <small class="pull-right">
{% trans assignment.get_status_display %} <a href="{% url 'assignment_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
<h4>{% trans "Number of available posts" %}:</h4> <!-- activate projector -->
{{ assignment.posts }} {% if perms.projector.can_manage_projector %}
</div> <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>
<br><br> </a>
{% if perms.assignment.can_manage_assignment %}
<div class="box">
<h4>{% trans "Change status" %}:</h4>
<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' %}<br>
<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>
<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' %}
</div>
{% endif %} {% endif %}
</div> <div class="btn-group">
<a data-toggle="dropdown" href="#" class="btn btn-mini dropdown-toggle">
<div style="margin-right: 250px; min-width: 400px;"> {% trans 'More actions' %}
<h1>{{ assignment }}</h1> <span class="caret"></span>
<p>{{ assignment.description|linebreaks }}</p> </a>
<ul class="dropdown-menu pull-right">
<!-- 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>
<!-- edit poll -->
{% if perms.assignment.can_manage_assignment %}
{% for poll in motion.polls %}
<li><a href="{% url 'assignment_poll_view' poll.id %}"><i class="icon-edit"></i> {{ forloop.counter }}. {% trans "Ballot" %}</a></li>
{% endfor %}
{% 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>
</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" %} {% if assignment.status != "fin" %}
<h3>{% trans "Candidates" %}</h3> <h4>{% trans "Candidates" %}</h4>
<ol> <ol>
{% for person in assignment.get_participants %} {% for person in assignment.get_participants %}
<li> <li>
{{ person }} {{ person }}
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
{% if assignment.status == "sea" or assignment.status == "vot" %} {% if assignment.status == "sea" or assignment.status == "vot" %}
<a href="{% url 'assignment_delother' assignment.id person.person_id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Remove candidate' %}"></a> <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 %}
{% endif %} {% endif %}
{% if person in assignment.elected %} {% if person in assignment.elected %}
| <b>{% trans "elected" %}</b> | <b>{% trans "elected" %}</b>
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
{% if assignment.status == "sea" or assignment.status == "vot" %} {% if assignment.status == "sea" or assignment.status == "vot" %}
<a href="{% url 'assignment_user_not_elected' assignment.id person.person_id %}"><img src="{% static 'images/icons/dialog-cancel.png' %}" title="{% trans 'Mark candidate as not elected' %}"></a> <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 %} {% endif %}
{% endif %} {% endif %}
</li> </li>
{% empty %} {% empty %}
<li style="list-style: none outside none;"><i>{% trans "No candidates available." %}</i></li> <li style="list-style: none outside none; margin-left: -25px;"><i>{% trans "No candidates available." %}</i></li>
{% endfor %} {% endfor %}
</ol> </ol>
{% if assignment.status == "sea" or perms.assignment.can_manage_assignment and assignment.status == "vot" %} {% 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 %} {% if perms.assignment.can_nominate_self or perms.assignment.can_nominate_other %}
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{% if perms.assignment.can_nominate_self %} {% if perms.assignment.can_nominate_self %}
<p> <p>
{% if user_is_candidate %} {% if user_is_candidate %}
<a href="{% url 'assignment_delrun' assignment.id %}"> <a href='{% url 'assignment_delrun' assignment.id %}' class="btn btn-mini">
<span class="button"> <i class="icon-remove"></i> {% trans 'Withdraw self candidature' %}
<span class="icon removeuser">{% trans 'Withdraw self candidature' %}</span>
</span>
</a> </a>
{% else %} {% else %}
<a href="{% url 'assignment_run' assignment.id %}"> <a href='{% url 'assignment_run' assignment.id %}' class="btn btn-mini">
<span class="button"> <i class="icon-plus"></i> {% trans 'Self candidature' %}
<span class="icon adduser">{% trans 'Self candidature' %}</span>
</span>
</a> </a>
{% endif %} {% endif %}
</p> </p>
{% endif %} {% endif %}
{% if perms.assignment.can_nominate_other %} {% if perms.assignment.can_nominate_other %}
{% for field in form %} {% for field in form %}
<label>{{ field.label }}:</label> <label>{{ field.label }}:</label>
<nobr>{{ field }} <div class="input-append">
{% if perms.participant.can_see_participant and perms.participant.can_manage_participant %} {{ field }}
<a href="{% url 'user_new' %}" target="_blank"><img src="{% static 'images/icons/add-user.png' %}" title="{% trans 'Add new participant' %}"></a> <button class="btn btn-primary" type="submit" title="{% trans 'Apply' %}"><i class="icon-ok icon-white"></i></button>
{% endif %} {% if perms.participant.can_see_participant and perms.participant.can_manage_participant %}
</nobr> <a href="{% url 'user_new' %}" target="_blank" class="btn" title="{% trans 'Add new participant' %}"><i class="icon-add-user"></i></a>
{% endif %}
</div>
{% endfor %} {% endfor %}
<p> <p>
<button class="button" type="submit">
<span class="icon ok">{% trans 'Apply' %}</span>
</button>
</p> </p>
{% endif %} {% endif %}
</form> </form>
@ -99,11 +124,14 @@
{% endif %} {% endif %}
{% if perms.assignment.can_manage_assignments and blocked_candidates and assignment.status != "fin" %} {% if perms.assignment.can_manage_assignments and blocked_candidates and assignment.status != "fin" %}
<h3>{% trans "Blocked Candidates" %}</h3> <h4>{% trans "Blocked Candidates" %}</h4>
<ul> <ul>
{% for person in blocked_candidates %} {% for person in blocked_candidates %}
<li> <li>
{{ person }}<a href="{% url 'assignment_delother' assignment.id person.person_id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Remove candidate' %}"></a> {{ person }}
<a class="btn btn-mini" href="{% url 'assignment_delother' assignment.id person.person_id %}" title="{% trans 'Remove candidate' %}">
<i class="icon-ban-circle"></i>
</a>
</li> </li>
{% empty %} {% empty %}
<li>{% trans "No blocked candidates available." %}</li> <li>{% trans "No blocked candidates available." %}</li>
@ -111,120 +139,160 @@
</ul> </ul>
{% endif %} {% endif %}
<!-- Results -->
{% if assignment.status != "sea" or polls.exists %} {% if assignment.status != "sea" or polls.exists %}
<h3>{% trans "Election results" %}</h3> <h4>{% trans "Election results" %}</h4>
{% if polls.exists %} {% if polls.exists %}
<table id="election_table" style="width: auto;"> <table class="table table-striped table-bordered">
<tr> <tr>
<th>{% trans "Candidates" %}</th> <th></th>
{% for poll in polls %} {% with ballotnumber=polls.count %}
<th style="vertical-align: top; white-space:nowrap;"> <th colspan="{{ ballotnumber|add:'1' }}" style="text-align: center;">
{{ poll.get_ballot }}. {% trans 'ballot' %} {% trans "ballot" %}
{% if perms.assignment.can_manage_assignment %}
<br>
<a class="publish_link {% if poll.published %}published{% endif %}"
href="{% url 'assignment_poll_publish_status' poll.id %}"
title="{% trans 'Publish/unpublish results' %}">
<span></span>
</a>
<a href="{% url 'assignment_poll_view' poll.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit' %}"></a>
<a href="{% url 'assignment_poll_delete' poll.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete' %}"></a>
{% endif %}
</th> </th>
{% endfor %} {% endwith %}
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %} </tr>
<th> <tr>
<a href="{% url 'assignment_gen_poll' assignment.id %}"> <th>{% trans "Candidates" %}</th>
<span class="button"> {% for poll in polls %}
<span class="icon statistics">{% trans 'New ballot' %}</span> <th style="white-space:nowrap;" class="span1">
</span> {{ poll.get_ballot }}. {% trans 'ballot' %}
</a> {% if perms.assignment.can_manage_assignment %}
</th> <br>
{% endif %} <a class="publish_link btn btn-mini {% if poll.published %}btn-primary{% endif %}"
</tr> href="{% url 'assignment_poll_publish_status' poll.id %}"
rel="tooltip" data-original-title="{% trans 'Publish/unpublish results' %}">
{% for candidate, poll_list in vote_results.items %} {% if poll.published %}
<tr class="{% cycle 'odd' '' as rowcolors %}"> <i class="icon-checked-new_white"></i>
<td class="candidate"> {% else %}
{% if candidate in assignment.elected %} <i class="icon-unchecked-new"></i>
{% if perms.assignment.can_manage_assignment %} {% endif %}
<a class="election_link elected" href="{% url 'assignment_user_not_elected' assignment.id candidate.person_id %}"></a> </a>
{% else %} <a href="{% url 'assignment_poll_view' poll.id %}" class="btn btn-mini" title="{% trans 'Edit' %}"><i class="icon-pencil"></i></a>
<a class="elected"> <a href="{% url 'assignment_poll_delete' poll.id %}" class="btn btn-mini" title="{% trans 'Delete' %}"><i class="icon-remove"></i></a>
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}"> {% 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> </a>
{% endif %} </th>
{% else %}
{% if perms.assignment.can_manage_assignment %}
<a class="election_link" href="{% url 'assignment_user_elected' assignment.id candidate.person_id %}"></a>
{% endif %}
{% endif %} {% endif %}
{{ candidate }} </tr>
</td> {% for candidate, poll_list in vote_results.items %}
{% for vote in poll_list %} <tr>
<td style="white-space:nowrap;"> <td>
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %} {% if candidate in assignment.elected %}
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br> {% if perms.assignment.can_manage_assignment %}
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br> <a class="election_link elected" href="{% url 'assignment_user_not_elected' assignment.id candidate.person_id %}"></a>
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br> {% else %}
{% elif 'Votes' in vote %} <a class="elected">
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }} <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
{% elif vote == None %} </a>
{% trans 'was not a <br> candidate'%} {% endif %}
{% else %} {% else %}
&nbsp; {% if perms.assignment.can_manage_assignment %}
<a class="election_link" href="{% url 'assignment_user_elected' assignment.id candidate.person_id %}"></a>
{% endif %}
{% endif %} {% endif %}
{{ candidate }}
</td> </td>
{% endfor %} {% for vote in poll_list %}
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
<td></td>
{% endif %}
</tr>
{% endfor %}
<tr class="{% cycle rowcolors %}">
<td>{% trans 'Invalid votes' %}</td>
{% for poll in polls %}
{% if poll.published or perms.assignment.can_manage_assignment %}
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
{% if poll.has_votes %} {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
<img src="{% static 'images/icons/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br>
{{ poll.print_votesinvalid }} <img src="{% static 'img/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br>
<img src="{% static 'img/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br>
{% elif 'Votes' in vote %}
<img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }}
{% elif vote == None %}
{% trans 'was not a <br> candidate'%}
{% else %}
&nbsp;
{% endif %} {% endif %}
</td> </td>
{% endfor %}
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
<td></td>
{% endif %} {% endif %}
</tr>
{% endfor %} {% endfor %}
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %} <tr>
<td></td> <td>{% trans 'Invalid votes' %}</td>
{% endif %} {% for poll in polls %}
</tr> {% if poll.published or perms.assignment.can_manage_assignment %}
<tr class="total"> <td style="white-space:nowrap;">
<td><strong>{% trans 'Votes cast' %}</strong></td> {% if poll.has_votes %}
{% for poll in polls %} <img src="{% static 'img/voting-invalid.png' %}" title="{% trans 'Invalid' %}">
{% if poll.published or perms.assignment.can_manage_assignment %} {{ poll.print_votesinvalid }}
<td style="white-space:nowrap;"> {% endif %}
{% if poll.has_votes %} </td>
<img src="{% static 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> {% endif %}
<strong>{{ poll.print_votescast }}</strong> {% endfor %}
{% endif %} {% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
</td> <td></td>
{% endif %} {% endif %}
{% endfor %} </tr>
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %} <tr class="info total">
<td></td> <td><strong>{% trans 'Votes cast' %}</strong></td>
{% endif %} {% for poll in polls %}
</tr> {% if poll.published or perms.assignment.can_manage_assignment %}
</table> <td style="white-space:nowrap;">
{% if poll.has_votes %}
<img src="{% static 'img/voting-total.png' %}" 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 %} {% else %}
<i>{% trans "No results available." %}</i> <i>{% trans "No ballots available." %}</i>
{% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %} {% if assignment.candidates and perms.assignment.can_manage_assignment and assignment.status == "vot" %}
<p><a href="{% url 'assignment_gen_poll' assignment.id %}"> <p>
<span class="button"> <a href='{% url 'assignment_gen_poll' assignment.id %}' class="btn">
<span class="icon statistics">{% trans 'New ballot' %}</span> <i class="icon-plus"></i> {% trans 'New ballot' %}
</span> </a>
</a></p> </p>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </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 %} {% endblock %}

View File

@ -1,21 +1,17 @@
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load tags %} {% load tags %}
<ul style="line-height: 180%"> <ul style="line-height: 180%">
{% for assignment in assignments %} {% for assignment in assignments %}
<li class="{% if assignment.active %}activeline{% endif %}"> <li class="{% if assignment.active %}activeline{% endif %}">
<a href="{% url 'projector_activate_slide' assignment.sid %}" class="activate_link {% if assignment.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' assignment.sid %}" class="activate_link btn {% if assignment.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<div></div> <i class="icon-facetime-video {% if assignment.active %}icon-white{% endif %}"></i>
</a>&nbsp;
<a href="{% model_url assignment 'edit' %}" title="{% trans 'Edit' %}" class="btn btn-mini right">
<i class="icon-pencil"></i>
</a> </a>
<a href="{% model_url assignment 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% url 'projctor_preview_slide' assignment.sid %}" title="{% trans 'Preview' %}" class="btn btn-mini right">
<span></span> <i class="icon-search"></i>
</a>
<a href="{% model_url assignment 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url 'projctor_preview_slide' assignment.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a> </a>
<a href="{% model_url assignment 'view' %}">{{ assignment }}</a> <a href="{% model_url assignment 'view' %}">{{ assignment }}</a>
</li> </li>

View File

@ -66,7 +66,7 @@
<td class="candidate{% if candidate in assignment.elected %} elected{% endif %}"> <td class="candidate{% if candidate in assignment.elected %} elected{% endif %}">
{% if candidate in assignment.elected %} {% if candidate in assignment.elected %}
<a class="elected"> <a class="elected">
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}"> <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
</a> </a>
{% endif %} {% endif %}
{{ candidate }} {{ candidate }}
@ -75,11 +75,11 @@
<td style="white-space:nowrap;"{% if candidate in assignment.elected %} class="elected"{% endif %}> <td style="white-space:nowrap;"{% if candidate in assignment.elected %} class="elected"{% endif %}>
{% if not assignment_publish_winner_results_only or candidate in assignment.elected %} {% if not assignment_publish_winner_results_only or candidate in assignment.elected %}
{% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %} {% if 'Yes' in vote and 'No' in vote and 'Abstain' in vote %}
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br> <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Yes }}<br>
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br> <img src="{% static 'img/voting-no.png' %}" title="{% trans 'No' %}"> {{ vote.No }}<br>
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br> <img src="{% static 'img/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ vote.Abstain }}<br>
{% elif 'Votes' in vote %} {% elif 'Votes' in vote %}
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }} <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ vote.Votes }}
{% elif vote == None %} {% elif vote == None %}
{% trans 'was not a <br> candidate'%} {% trans 'was not a <br> candidate'%}
{% else %} {% else %}
@ -97,7 +97,7 @@
{% for poll in polls %} {% for poll in polls %}
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
{% if poll.has_votes %} {% if poll.has_votes %}
<img src="{% static 'images/icons/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> <img src="{% static 'img/voting-invalid.png' %}" title="{% trans 'Invalid' %}">
{{ poll.print_votesinvalid }} {{ poll.print_votesinvalid }}
{% endif %} {% endif %}
</td> </td>
@ -112,7 +112,7 @@
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
{% if poll.has_votes %} {% if poll.has_votes %}
<img src="{% static 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> <img src="{% static 'img/voting-total.png' %}" title="{% trans 'Votes cast' %}">
<strong>{{ poll.print_votescast }}</strong> <strong>{{ poll.print_votescast }}</strong>
{% endif %} {% endif %}
</td> </td>

View File

@ -145,8 +145,9 @@ def edit(request, assignment_id=None):
def delete(request, assignment_id): def delete(request, assignment_id):
assignment = Assignment.objects.get(pk=assignment_id) assignment = Assignment.objects.get(pk=assignment_id)
if request.method == 'POST': if request.method == 'POST':
assignment.delete() if 'submit' in request.POST:
messages.success(request, _('Election <b>%s</b> was successfully deleted.') % assignment) assignment.delete()
messages.success(request, _('Election <b>%s</b> was successfully deleted.') % assignment)
else: else:
del_confirm_form(request, assignment) del_confirm_form(request, assignment)
return redirect(reverse('assignment_overview')) return redirect(reverse('assignment_overview'))
@ -204,16 +205,17 @@ def delother(request, assignment_id, user_id):
is_blocked = assignment.is_blocked(person) is_blocked = assignment.is_blocked(person)
if request.method == 'POST': if request.method == 'POST':
try: if 'submit' in request.POST:
assignment.delrun(person, blocked=False) try:
except Exception, e: assignment.delrun(person, blocked=False)
messages.error(request, e) except Exception, e:
else: messages.error(request, e)
if not is_blocked:
message = _("Candidate <b>%s</b> was withdrawn successfully.") % person
else: else:
message = _("<b>%s</b> was unblocked successfully.") % person if not is_blocked:
messages.success(request, message) message = _("Candidate <b>%s</b> was withdrawn successfully.") % person
else:
message = _("<b>%s</b> was unblocked successfully.") % person
messages.success(request, message)
else: else:
if not is_blocked: if not is_blocked:
message = _("Do you really want to withdraw <b>%s</b> from the election?") % person message = _("Do you really want to withdraw <b>%s</b> from the election?") % person
@ -533,7 +535,7 @@ class AssignmentPollPDF(PDFView):
pdf_document.build(story) pdf_document.build(story)
def append_to_pdf(self, story): def append_to_pdf(self, story):
imgpath = os.path.join(settings.SITE_ROOT, 'static/images/circle.png') imgpath = os.path.join(settings.SITE_ROOT, 'static/img/circle.png')
circle = "<img src='%s' width='15' height='15'/>&nbsp;&nbsp;" % imgpath circle = "<img src='%s' width='15' height='15'/>&nbsp;&nbsp;" % imgpath
cell = [] cell = []
cell.append(Spacer(0, 0.8 * cm)) cell.append(Spacer(0, 0.8 * cm))
@ -635,6 +637,7 @@ class Config(FormView):
permission_required = 'config.can_manage_config' permission_required = 'config.can_manage_config'
form_class = ConfigForm form_class = ConfigForm
template_name = 'assignment/config.html' template_name = 'assignment/config.html'
success_url_name = 'config_assignment'
def get_initial(self): def get_initial(self):
return { return {
@ -673,6 +676,7 @@ def register_tab(request):
selected = request.path.startswith('/assignment/') selected = request.path.startswith('/assignment/')
return Tab( return Tab(
title=_('Elections'), title=_('Elections'),
app='assignment',
url=reverse('assignment_overview'), url=reverse('assignment_overview'),
permission=( permission=(
request.user.has_perm('assignment.can_see_assignment') or request.user.has_perm('assignment.can_see_assignment') or
@ -684,10 +688,9 @@ def register_tab(request):
def get_widgets(request): def get_widgets(request):
return [ return [Widget(
Widget( name='assignments',
name='assignments', display_name=_('Elections'),
display_name=_('Elections'), template='assignment/widget.html',
template='assignment/widget.html', context={'assignments': Assignment.objects.all()},
context={'assignments': Assignment.objects.all()}, permission_required='projector.can_manage_projector')]
permission_required='projector.can_manage_projector')]

View File

@ -1,13 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load tags %}
{% load i18n %} {% load i18n %}
{% block submenu %} {% block config_submenu %}
<h4 class="sectiontitle">{% trans "Configuration" %}</h4> <small class="pull-right">
<ul> <div class="btn-toolbar">
{% for menu_link in menu_links %} <div class="btn-group">
<li{% if menu_link.2 %} class="selected"{% endif %}><a href="{{ menu_link.0 }}">{{ menu_link.1 }}</a></li> {% for menu_link in menu_links %}
{% endfor %} <a href="{{ menu_link.0 }}" class="btn btn-mini {% if menu_link.2 %}active{% endif %}">{{ menu_link.1 }}</a>
</ul> {% endfor %}
</div>
</div>
</small>
{% endblock %} {% endblock %}

View File

@ -5,19 +5,26 @@
{% block title %}{{ block.super }} {% trans "General settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "General settings" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "General settings" %}</h1> <h1>
{% trans "Configuration" %}
<small>{% trans "General" %}</small>
{% block config_submenu %}{{ block.super }}{% endblock %}
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
<fieldset> <fieldset>
<legend>{% trans "Event" %}</legend> <legend>{% trans "Event" %}</legend>
{% for field in form %} {% for field in form %}
{% if "id_event" in field.label_tag %} {% if "id_event" in field.label_tag %}
<p> <div class="control-group{% if field.errors %} error{% endif%}">
{{ field.errors }} <label for="id_{{ field.name }}">{{ field.label }}{% if field.field.required %}<span class="required">*</span>{% endif %}:</label>
{{ field.required }} {{ field }}
{{ field.label_tag }} {% if field.errors %}
{{ field }} <span class="help-inline">{{ field.errors }}</span>
{{ field.help_text }} {% endif %}
</p> {% if field.help_text %}
<span class="help-inline">{{ field.help_text }}</span>
{% endif %}
</div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</fieldset> </fieldset>
@ -26,13 +33,16 @@
<legend>{% trans "Welcome Widget" %}</legend> <legend>{% trans "Welcome Widget" %}</legend>
{% for field in form %} {% for field in form %}
{% if "id_welcome" in field.label_tag %} {% if "id_welcome" in field.label_tag %}
<p> <div class="control-group{% if field.errors %} error{% endif%}">
{{ field.errors }} <label for="id_{{ field.name }}">{{ field.label }}{% if field.field.required %}<span class="required">*</span>{% endif %}:</label>
{{ field.required }} {{ field }}
{{ field.label_tag }} {% if field.errors %}
{{ field }} <span class="help-inline">{{ field.errors }}</span>
{{ field.help_text }} {% endif %}
</p> {% if field.help_text %}
<span class="help-inline">{{ field.help_text }}</span>
{% endif %}
</div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</fieldset> </fieldset>
@ -41,25 +51,25 @@
<legend>{% trans "System" %}</legend> <legend>{% trans "System" %}</legend>
{% for field in form %} {% for field in form %}
{% if "id_system" in field.label_tag %} {% if "id_system" in field.label_tag %}
<p> <div class="control-group{% if field.errors %} error{% endif%}">
{{ field.errors }} <label for="id_{{ field.name }}">{{ field.label }}{% if field.field.required %}<span class="required">*</span>{% endif %}:</label>
{{ field.required }} {{ field }}
{{ field.label_tag }} {% if field.errors %}
{{ field }} <span class="help-inline">{{ field.errors }}</span>
{{ field.help_text }} {% endif %}
</p> {% if field.help_text %}
<span class="help-inline">{{ field.help_text }}</span>
{% endif %}
</div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</fieldset> </fieldset>
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_save.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href='{% url 'config_general' %}' class="btn">
</button> {% trans 'Cancel' %}
<a href="{% url 'config_general' %}">
<button class="button" type="button" onclick="window.location='{% url 'config_general' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a> </a>
</p> </p>
<small>* {% trans "required" %}</small>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -5,7 +5,9 @@
{% block title %}{{ block.super }} {% trans "Version" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Version" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Version" %}</h1> <h1>{% trans "Version" %}
{% block config_submenu %}{{ block.super }}{% endblock %}
</h1>
{% for version in versions %} {% for version in versions %}
<p>{{ version.0 }} {% trans "Version" %}: {{ version.1 }}</p> <p>{{ version.0 }} {% trans "Version" %}: {{ version.1 }}</p>

View File

@ -33,6 +33,7 @@ class GeneralConfig(FormView):
permission_required = 'config.can_manage_config' permission_required = 'config.can_manage_config'
form_class = GeneralConfigForm form_class = GeneralConfigForm
template_name = 'config/general.html' template_name = 'config/general.html'
success_url_name = 'config_general'
def get_initial(self): def get_initial(self):
return { return {
@ -108,6 +109,7 @@ def register_tab(request):
selected = request.path.startswith('/config/') selected = request.path.startswith('/config/')
return Tab( return Tab(
title=_('Configuration'), title=_('Configuration'),
app='config',
url=reverse('config_general'), url=reverse('config_general'),
permission=request.user.has_perm('config.can_manage_config'), permission=request.user.has_perm('config.can_manage_config'),
selected=selected, selected=selected,

View File

@ -26,9 +26,12 @@ LOGIN_REDIRECT_URL = '/'
SESSION_COOKIE_NAME = 'OpenSlidesSessionID' SESSION_COOKIE_NAME = 'OpenSlidesSessionID'
ugettext = lambda s: s ugettext = lambda s: s
MOTION_WORKFLOW = (
('default', ugettext('default'), 'openslides.motion.workflow.default_workflow'),
)
LANGUAGES = ( LANGUAGES = (
('de', ugettext('German')), ('de', ugettext('German')),
('en', ugettext('English')), ('en', ugettext('English')),

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
"""
openslides.motion
~~~~~~~~~~~~~~~~~
The OpenSlides motion app appends the functionality to OpenSlides, to
manage motions.
:copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
import openslides.motion.signals
import openslides.motion.slides

View File

@ -2,68 +2,101 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
openslides.motion.forms openslides.motion.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Forms for the motion app. Defines the DjangoForms for the motion app.
:copyright: 2011, 2012 by OpenSlides team, see AUTHORS. :copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext as _
from openslides.utils.forms import CssClassMixin from openslides.utils.forms import CssClassMixin
from openslides.utils.person import PersonFormField, MultiplePersonFormField from openslides.utils.person import PersonFormField, MultiplePersonFormField
from openslides.motion.models import Motion from .models import Motion
from .workflow import motion_workflow_choices
class MotionForm(forms.Form, CssClassMixin): class BaseMotionForm(forms.ModelForm, CssClassMixin):
"""Base FormClass for a Motion.
For it's own, it append the version data es fields.
The Class can be mixed with the following Mixins to add fields for the
submitter, supporters etc.
"""
title = forms.CharField(widget=forms.TextInput(), label=_("Title")) title = forms.CharField(widget=forms.TextInput(), label=_("Title"))
"""Title of the Motion. Will be saved in a MotionVersion object."""
text = forms.CharField(widget=forms.Textarea(), label=_("Text")) text = forms.CharField(widget=forms.Textarea(), label=_("Text"))
"""Text of the Motion. Will be saved in a MotionVersion object."""
reason = forms.CharField( reason = forms.CharField(
widget=forms.Textarea(), required=False, label=_("Reason")) widget=forms.Textarea(), required=False, label=_("Reason"))
"""Reason of the Motion. will be saved in a MotionVersion object."""
class MotionFormTrivialChanges(MotionForm):
trivial_change = forms.BooleanField(
required=False, label=_("Trivial change"),
help_text=_("Trivial changes don't create a new version."))
class MotionManagerForm(forms.ModelForm, CssClassMixin):
submitter = PersonFormField(label=_("Submitter"))
class Meta: class Meta:
model = Motion model = Motion
exclude = ('number', 'status', 'permitted', 'log', 'supporter') fields = ()
def __init__(self, *args, **kwargs):
"""Fill the FormFields releated to the version data with initial data."""
self.motion = kwargs.get('instance', None)
self.initial = kwargs.setdefault('initial', {})
if self.motion is not None:
self.initial['title'] = self.motion.title
self.initial['text'] = self.motion.text
self.initial['reason'] = self.motion.reason
super(BaseMotionForm, self).__init__(*args, **kwargs)
class MotionManagerFormSupporter(MotionManagerForm): class MotionSubmitterMixin(forms.ModelForm):
# TODO: Do not show the submitter in the user-list """Mixin to append the submitter field to a MotionForm."""
submitter = MultiplePersonFormField(label=_("Submitter"))
"""Submitter of the Motion. Can be one or more persons."""
def __init__(self, *args, **kwargs):
"""Fill in the submitter of the motion as default value."""
if self.motion is not None:
submitter = [submitter.person.person_id for submitter in self.motion.submitter.all()]
self.initial['submitter'] = submitter
super(MotionSubmitterMixin, self).__init__(*args, **kwargs)
class MotionSupporterMixin(forms.ModelForm):
"""Mixin to append the supporter field to a Motionform."""
supporter = MultiplePersonFormField(required=False, label=_("Supporters")) supporter = MultiplePersonFormField(required=False, label=_("Supporters"))
"""Supporter of the Motion. Can be one or more persons."""
def __init__(self, *args, **kwargs):
"""Fill in the supporter of the motions as default value."""
if self.motion is not None:
supporter = [supporter.person.person_id for supporter in self.motion.supporter.all()]
self.initial['supporter'] = supporter
super(MotionSupporterMixin, self).__init__(*args, **kwargs)
class MotionImportForm(forms.Form, CssClassMixin): class MotionCreateNewVersionMixin(forms.ModelForm):
csvfile = forms.FileField( """Mixin to add the option to the form, to choose, to create a new version."""
widget=forms.FileInput(attrs={'size': '50'}),
label=_("CSV File"), new_version = forms.BooleanField(
) required=False, label=_("Create new version"), initial=True,
import_permitted = forms.BooleanField( help_text=_("Trivial changes don't create a new version."))
required=False, """BooleanField to decide, if a new version will be created, or the
label=_("Import motions with status \"authorized\""), last_version will be used."""
help_text=_('Set the initial status for each motion to '
'"authorized"'),
)
class ConfigForm(forms.Form, CssClassMixin): class ConfigForm(CssClassMixin, forms.Form):
"""Form for the configuration tab of OpenSlides."""
motion_min_supporters = forms.IntegerField( motion_min_supporters = forms.IntegerField(
widget=forms.TextInput(attrs={'class': 'small-input'}), widget=forms.TextInput(attrs={'class': 'small-input'}),
label=_("Number of (minimum) required supporters for a motion"), label=_("Number of (minimum) required supporters for a motion"),
initial=4, initial=4, min_value=0, max_value=8,
min_value=0,
max_value=8,
help_text=_("Choose 0 to disable the supporting system"), help_text=_("Choose 0 to disable the supporting system"),
) )
motion_preamble = forms.CharField( motion_preamble = forms.CharField(
@ -98,9 +131,18 @@ class ConfigForm(forms.Form, CssClassMixin):
label=_("Preamble text for PDF document (all motions)") label=_("Preamble text for PDF document (all motions)")
) )
motion_allow_trivial_change = forms.BooleanField( motion_create_new_version = forms.ChoiceField(
label=_("Allow trivial changes"), widget=forms.Select(),
help_text=_('Warning: Trivial changes undermine the motions ' label=_("Create new versions"),
'autorisation system.'),
required=False, required=False,
choices=(
('ALLWASY_CREATE_NEW_VERSION', _('create allways a new versions')),
('NEVER_CREATE_NEW_VERSION', _('create never a new version')),
('ASK_USER', _('Let the user choose if he wants to create a new version')))
) )
motion_workflow = forms.ChoiceField(
widget=forms.Select(),
label=_("Workflow for the motions"),
required=True,
choices=motion_workflow_choices())

File diff suppressed because it is too large Load Diff

170
openslides/motion/pdf.py Normal file
View File

@ -0,0 +1,170 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.motion.pdf
~~~~~~~~~~~~~~~~~~~~~
Functions to generate the PDFs for the motion app.
"""
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.platypus import (
SimpleDocTemplate, PageBreak, Paragraph, Spacer, Table, TableStyle)
from django.utils.translation import ugettext as _
from openslides.config.models import config
from openslides.utils.pdf import stylesheet
from .models import Motion
def motions_to_pdf(pdf):
"""Create a PDF with all motions."""
motions = Motion.objects.all()
all_motion_cover(pdf, motions)
for motion in motions:
pdf.append(PageBreak())
motion_to_pdf(pdf, motion)
def motion_to_pdf(pdf, motion):
"""Create a PDF for one motion."""
pdf.append(Paragraph(_("Motion: %s") % motion.title, stylesheet['Heading1']))
motion_data = []
# submitter
cell1a = []
cell1a.append(Spacer(0, 0.2 * cm))
cell1a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Submitter"),
stylesheet['Heading4']))
cell1b = []
cell1b.append(Spacer(0, 0.2 * cm))
cell1b.append(Paragraph(unicode(motion.submitter), stylesheet['Normal']))
motion_data.append([cell1a, cell1b])
# TODO: choose this in workflow
if motion.state.edit_as_submitter:
# Cell for the signature
cell2a = []
cell2b = []
cell2a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" %
_("Signature"), stylesheet['Heading4']))
cell2b.append(Paragraph(42 * "_", stylesheet['Signaturefield']))
cell2b.append(Spacer(0, 0.1 * cm))
cell2b.append(Spacer(0, 0.2 * cm))
motion_data.append([cell2a, cell2b])
# supporters
if config['motion_min_supporters']:
cell3a = []
cell3b = []
cell3a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font><seqreset id='counter'>"
% _("Supporters"), stylesheet['Heading4']))
supporters = motion.supporter.all()
for supporter in supporters:
cell3b.append(Paragraph("<seq id='counter'/>.&nbsp; %s" % unicode(supporter),
stylesheet['Signaturefield']))
if motion.state.support:
for count in range(config['motion_min_supporters'] - supporters.count()):
cell3b.append(Paragraph("<seq id='counter'/>.&nbsp;" + 42 * "_",
stylesheet['Signaturefield']))
cell3b.append(Spacer(0, 0.2 * cm))
motion_data.append([cell3a, cell3b])
## # status
## cell4a = []
## cell4b = []
## note = " ".join(motion.notes)
## cell4a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Status"), stylesheet['Heading4']))
## if note != "":
## if motion.status == "pub":
## cell4b.append(Paragraph(note, stylesheet['Normal']))
## else:
## cell4b.append(Paragraph("%s | %s" % (motion.get_status_display(), note), stylesheet['Normal']))
## else:
## cell4b.append(Paragraph("%s" % motion.get_status_display(), stylesheet['Normal']))
## data.append([cell4a, cell4b])
# Motion state
cell4a = []
cell4b = []
cell4a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("State"),
stylesheet['Heading4']))
cell4b.append(Paragraph(motion.state.name, stylesheet['Normal']))
motion_data.append([cell4a, cell4b])
# Version number (aid)
if motion.versions.count() > 1:
cell5a = []
cell5b = []
cell5a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Version"),
stylesheet['Heading4']))
cell5b.append(Paragraph("%s" % motion.version.version_number, stylesheet['Normal']))
motion_data.append([cell5a, cell5b])
# voting results
polls = []
for poll in motion.polls.all():
if not poll.has_votes():
continue
polls.append(poll)
if polls:
cell6a = []
cell6b = []
cell6a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" %
_("Vote results"), stylesheet['Heading4']))
ballotcounter = 0
for poll in polls:
ballotcounter += 1
option = poll.get_options()[0]
yes, no, abstain, invalid, votecast = (
option['Yes'], option['No'], option['Abstain'],
poll.print_voteinvalid(), poll.print_votecast())
if len(polls) > 1:
cell6b.append(Paragraph("%s. %s" % (ballotcounter, _("Vote")),
stylesheet['Bold']))
cell6b.append(Paragraph(
"%s: %s <br/> %s: %s <br/> %s: %s <br/> %s: %s <br/> %s: %s" %
(_("Yes"), yes, _("No"), no, _("Abstention"), abstain, _("Invalid"),
invalid, _("Votes cast"), votecast), stylesheet['Normal']))
cell6b.append(Spacer(0, 0.2 * cm))
motion_data.append([cell6a, cell6b])
# Creating Table
table = Table(motion_data)
table._argW[0] = 4.5 * cm
table._argW[1] = 11 * cm
table.setStyle(TableStyle([('BOX', (0, 0), (-1, -1), 1, colors.black),
('VALIGN', (0, 0), (-1, -1), 'TOP')]))
pdf.append(table)
pdf.append(Spacer(0, 1 * cm))
pdf.append(Paragraph(motion.title, stylesheet['Heading3']))
pdf.append(Paragraph(motion.text.replace('\r\n', '<br/>'), stylesheet['Paragraph']))
if motion.reason:
pdf.append(Paragraph(_("Reason:"), stylesheet['Heading3']))
pdf.append(Paragraph(motion.reason.replace('\r\n', '<br/>'), stylesheet['Paragraph']))
return pdf
def all_motion_cover(pdf, motions):
"""Create a coverpage for all motions."""
pdf.append(Paragraph(config["motion_pdf_title"], stylesheet['Heading1']))
preamble = config["motion_pdf_preamble"]
if preamble:
pdf.append(Paragraph("%s" % preamble.replace('\r\n', '<br/>'), stylesheet['Paragraph']))
pdf.append(Spacer(0, 0.75 * cm))
if not motions:
pdf.append(Paragraph(_("No motions available."), stylesheet['Heading3']))
else:
for motion in motions:
pdf.append(Paragraph(motion.title, stylesheet['Heading3']))

View File

@ -0,0 +1,30 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.motion.signales
~~~~~~~~~~~~~~~~~~~~~~~~~~
Signals for the motion app.
:copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from openslides.config.signals import default_config_value
@receiver(default_config_value, dispatch_uid="motion_default_config")
def default_config(sender, key, **kwargs):
"""Return the default config values for the motion app."""
return {
'motion_min_supporters': 0,
'motion_preamble': _('The assembly may decide,'),
'motion_pdf_ballot_papers_selection': 'CUSTOM_NUMBER',
'motion_pdf_ballot_papers_number': '8',
'motion_pdf_title': _('Motions'),
'motion_pdf_preamble': '',
'motion_create_new_version': 'ALLWASY_CREATE_NEW_VERSION',
'motion_workflow': 'default'}.get(key)

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.motion.slides
~~~~~~~~~~~~~~~~~~~~~~~~
Defines the Slides for the motion app.
:copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from openslides.projector.api import register_slidemodel
from .models import Motion
register_slidemodel(Motion)

View File

@ -1,66 +0,0 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block submenu %}
{% url 'motion_overview' as url_motionoverview %}
<h4>{% trans "Motions" %}</h4>
<ul>
<li class="{% if request.path == url_motionoverview %}selected{% endif %}"><a href="{% url 'motion_overview' %}">{% trans "All motions" %}</a></li>
{% if perms.motion.can_create_motion or perms.motion.can_manage_motion %}
<li class="{% active request '/motion/new' %}"><a href="{% url 'motion_new' %}">{% trans "New motion" %}</a></li>
{% endif %}
{% if perms.motion.can_manage_motion %}
<li class="{% active request '/motion/import' %}"><a href="{% url 'motion_import' %}">{% trans 'Import motions' %}</a></li>
{% endif %}
<li><a href="{% url 'print_motions' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'All motions as PDF' %}</a></li>
</ul>
{# second submenu #}
{% if motion %}
<br>
<h3>{% trans "Motion No." %}
{% if motion.number != None %}
{{ motion.number }}
{% else %}
<i>[-]</i>
{% endif %}
</h3>
<ul>
{# view motion #}
{% url 'motion_view' motion.id as url_motionview %}
<li class="{% if request.path == url_motionview %}selected{% endif %}"><a href="{% url 'motion_view' motion.id %}">{% trans 'View motion' %}</a></li>
{# edit motion #}
{% if "edit" in actions %}
{% url 'motion_edit' motion.id as url_motionedit %}
<li class="{% if request.path == url_motionedit %}selected{% endif %}"><a href="{% url 'motion_edit' motion.id %}"><img src="{% static 'images/icons/edit.png' %}"> {% trans 'Edit motion' %}</a></li>
{% endif %}
{# delete motion #}
{% if "delete" in actions %}
<li><a href="{% url 'motion_delete' motion.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete motion' %}</a></li>
{% endif %}
{# PDF #}
<li><a href="{% url 'print_motion' motion.id %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Motion as PDF' %}</a></li>
{# activate and polls #}
{% if perms.projector.can_manage_projector %}
<li>
<a class="activate_link {% if item.active %}active{% endif %}" href="{% url 'projector_activate_slide' motion.sid %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Show Motion' %}</a>
</li>
{% endif %}
{% if perms.motion.can_manage_motion %}
{% for poll in motion.polls %}
{% url 'motion_poll_view' poll.id as url_motionpollview %}
<li class="{% if request.path == url_motionpollview %}selected{% endif %}"><a href="{% url 'motion_poll_view' poll.id %}"><img src="{% static 'images/icons/edit.png' %}"> {{ forloop.counter }}. {% trans "Vote" %}</a></li>
{% endfor %}
{% endif %}
{# Agenda Item #}
{% if perms.agenda.can_manage_agenda %}
<li>
<a href="{% url 'motion_create_agenda' motion.id %}">{% trans 'New agenda item' %}</a>
</li>
{% endif %}
</ul>
{% endif %}
{% endblock %}

View File

@ -5,18 +5,19 @@
{% block title %}{{ block.super }} {% trans "Motion settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Motion settings" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Motion settings" %}</h1> <h1>
{% trans "Configuration" %}
<small>{% trans "Motions" %}</small>
{% block config_submenu %}{{ block.super }}{% endblock %}
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_save.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href="{% url 'config_motion' %}" class="btn">
</button> {% trans 'Cancel' %}
<a href="{% url 'config_motion' %}"> </a>
<button class="button" type="button" onclick="window.location='{% url 'config_motion' %}'"> </p>
<span class="icon cancel">{% trans 'Cancel' %}</span> <small>* {% trans "required" %}</small>
</button>
</a>
</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -1,40 +0,0 @@
{% extends "motion/base_motion.html" %}
{% load i18n %}
{% block title %}
{{ block.super }}
{% if motion %}
{% trans "Edit motion" %}
{% else %}
{% trans "New motion" %}
{% endif %}
{% endblock %}
{% block content %}
{% if motion %}
<h1>{% trans "Edit motion" %}</h1>
{% else %}
<h1>{% trans "New motion" %}</h1>
{% endif %}
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
{{ managerform.as_p }}
<p>
<button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span>
</button>
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href="{% url 'motion_overview' %}">
<button class="button" type="button" onclick="window.location='{% url 'motion_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
</p>
<small>* {% trans "required" %}</small>
</form>
{% endblock %}

View File

@ -1,36 +0,0 @@
{% extends "motion/base_motion.html" %}
{% load i18n %}
{% block title %}{{ block.super }} {% trans "Import motions" %} {% endblock %}
{% block content %}
<h1>{% trans "Import motions" %}</h1>
<p>{% trans 'Select a CSV file to import motions!' %}</p>
<p>{% trans 'Required comma separated values' %}:
<code>({% trans 'number, title, text, reason, first_name, last_name, is_group' %})</code>
<br>
{% trans '<code>number</code>, <code>reason</code> and <code>is_group</code> are optional and may be empty' %}.
<br>
{% trans 'Required CSV file encoding: UTF-8 (Unicode).' %}
</p>
<p><a href="http://dev.openslides.org/wiki/CSVImport" target="_blank">{% trans 'A CSV example file is available in OpenSlides Wiki.' %}</a>
</p>
<form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
{{ form.as_p }}
<p>
<button class="button" type="submit">
<span class="icon import">{% trans 'Import' %}</span>
</button>
<a href="{% url 'motion_overview' %}">
<button class="button" type="button" onclick="window.location='{% url 'motion_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
</p>
<small>* {% trans "required" %}</small>
</form>
{% endblock %}

View File

@ -0,0 +1,100 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Motion" %} "{{ motion.title }}"{% endblock %}
{% block content %}
<p>Titel: {{ motion.title }} </p>
<p>Text: {{ motion.text }}</p>
<p>Reason: {{ motion.reason }}</p>
<p>Submitter: {% for submitter in motion.submitter.all %}{{ submitter.person }} {% endfor %}</p>
<p>Supporter: {% for supporter in motion.supporter.all %}{{ supporter.person }} {% endfor %}</p>
<p>Active Version: {{ motion.active_version }}</p>
<p>State: {{ motion.state }}</p>
<h4>possible stats:</h4>
<ul>
{% for state in motion.state.next_states %}
<li><a href="{% url 'motion_set_state' motion.pk state.id %}">{{ state }}</a></li>
{% endfor %}
<li><a href="{% url 'motion_reset_state' motion.pk %}">Reset State</a></li>
</ul>
<h4>Versions</h4>
<ol>
{% for motion_version in motion.versions.all %}
<li>
{% if motion_version.id == motion.version.id %}
<strong><a href="{% model_url motion_version %}">{{ motion_version }}</a></strong>
{% else %}
<a href="{% model_url motion_version %}">{{ motion_version }}</a>
{% endif %}
{% if motion_version.active %}
(active)
{% endif %}
{% if motion_version.rejected %}
(rejected)
{% endif %}
</li>
{% endfor %}
</ol>
<h4>{% trans "Vote results" %}:</h4>
{% with motion.polls.all as polls %}
<ul class="results">
{% for poll in polls %}
{% if perms.motion.can_manage_motion or poll.has_votes %}
<li>
{% if perms.motion.can_manage_motion %}
<strong>{{ forloop.counter }}. {% trans "Vote" %} </strong>
<a class="icon edit" href="{% model_url poll 'edit' %}" title="{% trans 'Edit Vote' %}">
<span></span>
</a>
<a class="icon delete" href="{% model_url poll 'delete' %}" title="{% trans 'Delete Vote' %}">
<span></span>
</a>
{% elif poll.has_votes %}
<strong>{{ forloop.counter }}. {% trans "Vote" %}:</strong>
{% endif %}
<br>
{% if poll.has_votes %}
{% with poll.get_options.0 as option %}
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ option.Yes }}<br>
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ option.No }}<br>
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ option.Abstain }}<br>
<img src="{% static 'images/icons/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 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> {{ poll.print_votescast }}
</div>
{% endwith %}
{% else %}
{% if perms.motion.can_manage_motion %}
<a href="{% model_url poll %}">
<span class="button"><span class="icon statistics">{% trans 'Enter result' %}</span></span>
</a>
{% endif %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% if allowed_actions.create_poll %}
<a href="{% url 'motion_poll_create' motion.pk %}">
<span class="button"><span class="icon statistics">{% trans 'New vote' %}</span></span>
</a>
{% endif %}
{% endwith %}
<h4>log</h4>
<ul>
{% for message in motion.log_messages.all %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Motion Form" %}{% endblock %}
{% block content %}
<h1>{% trans "Motions Forms" %}</h1>
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
<button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span>
</button>
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href="{% url 'motion_list' %}">
<button class="button" type="button" onclick="window.location='{% url 'motion_list' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
<small>* {% trans "required" %}</small>
</form>
{% endblock %}

View File

@ -0,0 +1,16 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Motions" %}{% endblock %}
{% block content %}
<h1>{% trans "Motions" %}</h1>
<ol>
{% for motion in motion_list %}
<li><a href="{% model_url motion %}">{{ motion }}</a></li>
{% endfor %}
</ol>
{% endblock %}

View File

@ -1,88 +0,0 @@
{% extends "motion/base_motion.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Motions" %}{% endblock %}
{% block content %}
<h1>{% trans "Motions" %}</h1>
<p><form action="{{ request.url }}" name="filter" method="get">
{% trans "Filter" %}:
{% if min_supporters > 0 %}
<input type="checkbox" name="needsup" onchange="document.forms['filter'].submit()"
{% if 'on' in request.GET.needsup %}checked{% endif %}> {% trans "Need supporters" %} &nbsp;
{% endif %}
<input type="checkbox" name="number" onchange="document.forms['filter'].submit()"
{% if 'on' in request.GET.number %}checked{% endif %}> {% trans "Without number" %} &nbsp;
<input type="checkbox" name="status" onchange="document.forms['filter'].submit()"
{% if 'on' in request.GET.status %}checked{% endif %}> {% trans "Status" %}:
<select class="default-input" name="statusvalue" onchange="{% if 'on' in request.GET.status %}document.forms['filter'].submit(){% endif %}">
<option value="pub" {% if 'pub' in request.GET.statusvalue %}selected{% endif %}>{% trans "Not yet authorized" %}</option>
<option value="per" {% if 'on' in request.GET.status and 'per' in request.GET.statusvalue %}selected{% endif %}>{% trans "Authorized" %}</option>
<option value="acc" {% if 'on' in request.GET.status and 'acc' in request.GET.statusvalue %}selected{% endif %}>{% trans "Accepted" %}</option>
<option value="rej" {% if 'on' in request.GET.status and 'rej' in request.GET.statusvalue %}selected{% endif %}>{% trans "Rejected" %}</option>
<option value="wit" {% if 'on' in request.GET.status and 'wit' in request.GET.statusvalue %}selected{% endif %}>{% trans "Withdrawen (by submitter)" %}</option>
<option value="rev" {% if 'rev' in request.GET.statusvalue %}selected{% endif %}>{% trans "Needs Review" %}</option>
</select>
</form>
</p>
{{ motions|length }}
{% blocktrans count counter=motions|length context "number of motions"%}motion{% plural %}motions{% endblocktrans %}
<table>
<tr>
<th><a href="?sort=number{% if 'number' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Number" %}</a></th>
<th><a href="?sort=title{% if 'title' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Motion title" %}</a></th>
{% if min_supporters > 0 %}
<th><a href="?sort=supporter{% if 'supporter' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Number of supporters" %}</a></th>
{% endif %}
<th><a href="?sort=status{% if 'status' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Status" %}</a></th>
<th><a href="?sort=submitter{% if 'submitter' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Submitter" %}</a></th>
<th><a href="?sort=time{% if 'time' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{% trans "Creation Time" %}<a></th>
<th style="width: 1px;">{% trans "Actions" %}</th>
</tr>
{% for app_info in motions %}
{% with motion=app_info.motion useractions=app_info.actions %}
<tr class="{% cycle '' 'odd' %}
{% if motion.active %}activeline{% endif %}">
<td>{% if motion.number %}{{ motion.number }}{% else %}-{% endif %}</td>
<td><a href="{% url 'motion_view' motion.id %}">{{ motion.public_version.title }}</a></td>
{% if min_supporters > 0 %}
<td>{{ motion.count_supporters }}</td>
{% endif %}
<td>{% if motion.status != "pub" %}
{{ motion.get_status_display }}<br>
{% endif %}
{% for note in motion.notes %}
{{ note }}
{% if not forloop.last %}<br>{%endif%}
{% endfor %}
</td>
<td>{{ motion.submitter }}</td>
<td>{{ motion.creation_time }}</td>
<td>
<span style="width: 1px; white-space: nowrap;">
{% if perms.projector.can_manage_projector %}
<a class="activate_link {% if motion.active %}active{% endif %}" href="{% url 'projector_activate_slide' motion.sid %}" title="{% trans 'Activate motion' %}">
<span></span>
</a>
{% endif %}
{% if perms.motion.can_manage_motion %}
<a href="{% url 'motion_edit' motion.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit motion' %}"></a>
{% if "delete" in useractions %}
<a href="{% url 'motion_delete' motion.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete motion' %}"></a>
{% endif %}
{% endif %}
<a href="{% url 'print_motion' motion.id %}" title="{% trans 'Motion as PDF' %}"><img src="{% static 'images/icons/pdf.png' %}"></a>
</span>
</td>
</tr>
{% endwith %}
{% empty %}
<tr>
<td colspan="7"><i>{% trans "No motions available." %}</i></td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -0,0 +1,48 @@
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% load tags %}
{% block content %}
<h1>{{ motion }}</h1>
<i class="helptext">{% trans "Special values" %}: -1 = {% trans 'majority' %}; -2 = {% trans 'undocumented' %}</i>
<form action="" method="post" class="small-form">{% csrf_token %}
{{ pre_form }}
<span id="poll_id" style="display:none">{{ object.pk }}</span>
<table class="table" style="width: auto;">
<tr>
<th>{% trans "Option" %}</th>
<th>{% trans "Votes" %}</th>
</tr>
{% for value in forms.0 %}
<tr>
<td>{{ value.label }}</td>
<td>{{ value.errors }}{{ value }}</td>
</tr>
{% endfor %}
<tr class="total">
<td>{% trans "Invalid votes" %}</td>
<td>{{ pollform.votesinvalid.errors }}{{ pollform.votesinvalid }}</td>
</tr>
<tr class="total">
<td>{% trans "Votes cast" %}</td>
<td>{{ pollform.votescast.errors }}{{ pollform.votescast }}</td>
</tr>
</table>
{{ post_form }}
<p>
<button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span>
</button>
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href="{% model_url motion %}">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</a>
</p>
</form>
{% endblock %}

View File

@ -1,64 +0,0 @@
{% extends 'motion/base_motion.html' %}
{% load i18n %}
{% load staticfiles %}
{% block title %}
{{ block.super }} {% trans "Motion" %} "{{ motion.public_version.title }}"
{{ ballot }}. {% trans "Vote" %}
{% endblock %}
{% block content %}
<h1>{{ motion.public_version.title }} ({% trans "Motion" %}
{{ motion.number }}) {{ ballot }}. {% trans "Vote" %}</h1>
<i class="helptext">{% trans "Special values" %}: -1 = {% trans 'majority' %}; -2 = {% trans 'undocumented' %}</i>
<form action="" method="post" class="small-form">{% csrf_token %}
{{ pre_form }}
<span id="poll_id" style="display:none">{{ poll.id }}</span>
<table class="table" style="width: auto;">
<tr>
<th>{% trans "Option" %}</th>
<th>{% trans "Votes" %}</th>
</tr>
{% for value in forms.0 %}
<tr>
<td>{{ value.label }}</td>
<td>{{ value.errors }}{{ value }}</td>
</tr>
{% endfor %}
<tr class="total">
<td>{% trans "Invalid votes" %}</td>
<td>{{ pollform.votesinvalid.errors }}{{ pollform.votesinvalid }}</td>
</tr>
<tr class="total">
<td>{% trans "Votes cast" %}</td>
<td>{{ pollform.votescast.errors }}{{ pollform.votescast }}</td>
</tr>
</table>
{{ post_form }}
<p>
<a href="{% url 'print_motion_poll' poll.id %}">
<button class="button" type="button" onclick="window.location='{% url 'print_motion_poll' poll.id %}'">
<span class="icon pdf">{% trans 'Ballot paper as PDF' %}</span>
</button>
</a>
</p>
<p>
<button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span>
</button>
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href="{% url 'motion_view' motion.id %}">
<button class="button" type="button" onclick="window.location='{% url 'motion_view' motion.id %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
</p>
</form>
{% endblock %}

View File

@ -1,303 +0,0 @@
{% extends "motion/base_motion.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Motion" %} "{{ version.title }}"{% endblock %}
{% block submenu %}
{{ block.super }}
{% endblock %}
{% block content %}
<div id="sidebar">
<div class="box">
<h4>{% trans "Submitter" %}:</h4>
{{ motion.submitter }}
{% if min_supporters > 0 %}
<h4>{% trans "Supporters" %}: *</h4>
{% if not motion.supporters %}
-
{% else %}
<ol>
{% for supporter in motion.supporters %}
<li> {{ supporter }}</li>
{% endfor %}
</ol>
{% endif %}
{% endif %}
<h4>{% trans "Status" %}:</h4>
{% if motion.status != "pub" %}
{% trans motion.get_status_display %}
<br>
{% endif %}
{% for note in motion.notes %}
{{ note }}
{% if not forloop.last %}<br>{% endif %}
{% endfor %}
<h4>{% trans "Vote results" %}:</h4>
{% with motion.polls as polls %}
{% if not polls.exists %}
{% if perms.motion.can_manage_motion %}
{% if "genpoll" in actions %}
<a href="{% url 'motion_gen_poll' motion.id %}">
<span class="button">
<span class="icon statistics">{% trans 'New vote' %}</span>
</span>
</a>
{% else %}
-
{% endif %}
{% else %}
-
{% endif %}
{% endif %}
<ul class="results">
{% for poll in polls %}
{% if perms.motion.can_manage_motion or poll.has_votes %}
<li>
{% if perms.motion.can_manage_motion %}
<strong>{{ forloop.counter }}. {% trans "Vote" %} </strong>
<a class="icon edit" href="{% url 'motion_poll_view' poll.id %}" title="{% trans 'Edit Vote' %}">
<span></span>
</a>
<a class="icon delete" href="{% url 'motion_poll_delete' poll.id %}" title="{% trans 'Delete Vote' %}">
<span></span>
</a>
{% elif poll.has_votes %}
<strong>{{ forloop.counter }}. {% trans "Vote" %}:</strong>
{% endif %}
<br>
{% if poll.has_votes %}
{% with poll.get_options.0 as option %}
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ option.Yes }}<br>
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ option.No }}<br>
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ option.Abstain }}<br>
<img src="{% static 'images/icons/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 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> {{ poll.print_votescast }}
</div>
{% endwith %}
{% if perms.motion.can_manage_motion %}
{% if forloop.last %}
{% if "genpoll" in actions %}
<a href="{% url 'motion_gen_poll' motion.id %}">
<span class="button"><span class="icon statistics">{% trans 'New vote' %}</span></span>
</a>
{% endif %}
{% endif %}
{% endif %}
{% else %}
{% if perms.motion.can_manage_motion %}
<a href="{% url 'motion_poll_view' poll.id %}">
<span class="button"><span class="icon statistics">{% trans 'Enter result' %}</span></span>
</a>
{% endif %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endwith %}
<h4>{% trans "Creation Time" %}:</h4>
{{ motion.creation_time }}
<p></p>
{% if "wit" in actions and user == motion.submitter.user %}
<p></p>
<a href="{% url 'motion_set_status' motion.id 'wit' %}">
<span class="button"><span class="icon revert">{% trans 'Withdraw' %}</span></span>
</a>
{% endif %}
{% if perms.motion.can_support_motion and min_supporters > 0 %}
{% if "unsupport" in actions %}
<p></p>
<a href="{% url 'motion_unsupport' motion.id %}">
<span class="button"><span class="icon remove">{% trans 'Unsupport' %}</span></span>
</a>
{% endif %}
{% if "support" in actions %}
<p></p>
<a href="{% url 'motion_support' motion.id %}">
<span class="button"><span class="icon add">{% trans 'Support' %}</span></span>
</a>
{% endif %}
{% endif %}
</div>
{% if min_supporters > 0 %}
<small>* {% trans "minimum required supporters" %}: {{ min_supporters }}</small>
{% endif %}
<br><br>
{% if perms.motion.can_manage_motion %}
<div class="box">
<h4><b>{% trans "Manage motion" %}</b></h4>
{% if "pub" in actions or "per" in actions or "nop" in actions or "setnumber" in actions %}
<h4>{% trans "Formal validation" %}:</h4>
{% if "pub" in actions %}
<a href="{% url 'motion_set_status' motion.id 'pub' %}"><span class="button"><span class="icon ok-blue">{% trans 'Publish' %}</span></span></a>
{% endif %}
{% if "per" in actions %}
<a href="{% url 'motion_permit' motion.id %}"><span class="button"><span class="icon ok-blue">{% trans 'Permit' %}</span></span></a>
{% endif %}
{% if "nop" in actions %}
<a href="{% url 'motion_notpermit' motion.id %}"><span class="button"><span class="icon reject">{% trans 'Not permit (reject)' %}</span></span></a>
{% endif %}
{% if "setnumber" in actions %}
<a href="{% url 'motion_set_number' motion.id %}"><span class="button"><span class="icon number">{% trans 'Set number' %}</span></span></a>
{% endif %}
</p>
{% endif %}
<h4></h4>
{% if "acc" in actions or "rej" in actions %}
<h4>{% trans "Result after vote" %}:</h4>
{% if "acc" in actions %}
<a href="{% url 'motion_set_status' motion.id 'acc' %}">
<span class="button"><span class="icon done">{% trans 'Accepted' %}</span></span>
</a>
{% endif %}
{% if "rej" in actions %}
<a href="{% url 'motion_set_status' motion.id 'rej' %}">
<span class="button"><span class="icon reject">{% trans 'Rejected' %}</span></span>
</a>
{% endif %}
{% endif %}
{% if "adj" in actions or "noc" in actions or "com" in actions or "wit" in actions %}
<h4>{% trans 'Result after debate' %}:</h4>
{% if "adj" in actions %}
<a href="{% url 'motion_set_status' motion.id 'adj' %}"><span class="button">{% trans 'Adjourned' %}</span></a><br>
{% endif %}
{% if "noc" in actions %}
<a href="{% url 'motion_set_status' motion.id 'noc' %}"><span class="button">{% trans 'Not Concerned' %}</span></a><br>
{% endif %}
{% if "com" in actions %}
<a href="{% url 'motion_set_status' motion.id 'com' %}"><span class="button">{% trans 'Commited a bill' %}</span></a><br>
{% endif %}
{% if "wit" in actions %}
<a href="{% url 'motion_set_status' motion.id 'wit' %}"><span class="button">{% trans 'Withdrawed by submitter' %}</span></a>
{% endif %}
{% endif %}
<p></p>
<hr>
<h4>{% trans "For Administration only:" %}</h4>
<a href="{% url 'motion_reset' motion.id %}">
<span class="button"><span class="icon undo">{% trans 'Reset' %}</span></span>
</a>
</div>
{% endif %} {# end perms.motion.can_support_motion #}
</div> <!-- end sidebar -->
<div id="main">
<h1>
{{ version.title }}
({% trans "Motion" %}
{% if motion.number != None %}
{{ motion.number }})
{% else %}
<i>[{% trans "no number" %}]</i>)
{% endif %}
</h1>
{% trans "Version" %} {{ version.aid }}
{% if motion.public_version != motion.last_version %}
&#8901;
{% if version == motion.public_version %}
{% trans "This is not the newest version." %} <a href="{% url 'motion_view_newest' motion.id %}">{% trans "Go to version" %} {{ motion.last_version.aid }}.</a>
{% else %}
{% trans "This is not the authorized version." %} <a href="{% url 'motion_view' motion.id %}">{% trans "Go to version" %} {{ motion.public_version.aid }}.</a>
{% endif %}
{% endif %}
<h2>{% trans "Motion" %}:</h2>
{{ version.text|linebreaks }}
<h2>{% trans "Reason" %}:</h2>
{% if version.reason %}
{{ version.reason|linebreaks }}
{% else %}
{% endif %}
{% if motion.versions|length > 1 %}
<h2>{% trans "Version History" %}:</h2>
<table class="table valigntop" style="width: auto;">
<tr>
<th></th>
<th>{% trans "Version" %}</th>
<th>{% trans "Time" %}</th>
<th>{% trans "Title" %}</th>
<th>{% trans "Text" %}</th>
<th>{% trans "Reason" %}</th>
</tr>
{% for revision in motion.versions %}
<tr class="{% cycle 'odd' '' %}">
<td style="white-space:nowrap;">
{% if motion.status != "pub" %}
{% if revision == motion.permitted %}
<img title="{% trans 'Version authorized' %}" src="{% static 'images/icons/accept.png' %}">
{% else %}
{% if perms.motion.can_manage_motion %}
<a href="{% url 'motion_version_permit' revision.id %}"><img title="{% trans 'Permit Version' %}" src="{% static 'images/icons/accept-grey.png' %}"></a>
{% endif %}
{% if not revision.rejected and revision.id > motion.permitted.id and perms.motion.can_manage_motion %}
<a href="{% url 'motion_version_reject' revision.id %}"><img title="{% trans 'Reject Version' %}" src="{% static 'images/icons/reject-grey.png' %}"></a>
{% endif %}
{% endif %}
{% if revision.rejected %}
<img title="{% trans 'Version rejected' %}" src="{% static 'images/icons/reject.png' %}">
{% endif %}
{% endif %}
</td>
<td>{{ revision.aid }}</td>
<td><i>{{ revision.time }}</i></td>
<td>
{% ifchanged %}
<b>{{ revision.title }}</b>
{% else %}
<i>[{% trans "unchanged" %}]</i>
{% endifchanged %}
</td>
<td>
{% ifchanged %}
{{ revision.text|linebreaks }}
{% else %}
<i>[{% trans "unchanged" %}]</i>
{% endifchanged %}
</td>
<td>
{% ifchanged %}
{{ revision.reason|linebreaks }}
{% else %}
<i>[{% trans "unchanged" %}]</i>
{% endifchanged %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if perms.motion.can_manage_motion %}
<h2>{% trans "Log" %}:</h2>
{{ motion.log|linebreaks }}
{% endif %}
</div>
{% endblock %}

View File

@ -1,21 +1,17 @@
{% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load tags %} {% load tags %}
<ul style="line-height: 180%"> <ul style="line-height: 180%">
{% for motion in motions %} {% for motion in motions %}
<li class="{% if motion.active %}activeline{% endif %}"> <li class="{% if motion.active %}activeline{% endif %}">
<a href="{% url 'projector_activate_slide' motion.sid %}" class="activate_link {% if motion.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' motion.sid %}" class="activate_link btn {% if motion.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<div></div> <i class="icon-facetime-video {% if motion.active %}icon-white{% endif %}"></i>
</a>&nbsp;
<a href="{% model_url motion 'edit' %}" title="{% trans 'Edit' %}" class="btn btn-mini right">
<i class="icon-pencil"></i>
</a> </a>
<a href="{% model_url motion 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% url 'projctor_preview_slide' motion.sid %}" title="{% trans 'Preview' %}" class="btn btn-mini right">
<span></span> <i class="icon-search"></i>
</a>
<a href="{% model_url motion 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url 'projctor_preview_slide' motion.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a> </a>
<a href="{% model_url motion 'view' %}"> <a href="{% model_url motion 'view' %}">
{{ motion.public_version.title }} {{ motion.public_version.title }}

View File

@ -11,15 +11,15 @@
<p><b>{% trans "Status" %}:</b><br> <p><b>{% trans "Status" %}:</b><br>
{% if motion.status != "pub" %} {% if motion.status != "pub" %}
{% if motion.status == "acc" %} {% if motion.status == "acc" %}
<img src="{% static 'images/icons/voting-yes.png' %}"> <img src="{% static 'img/voting-yes.png' %}">
{% endif %} {% endif %}
{% if motion.status == "rej" %} {% if motion.status == "rej" %}
<img src="{% static 'images/icons/voting-no.png' %}"> <img src="{% static 'img/voting-no.png' %}">
{% endif %} {% endif %}
{% trans motion.get_status_display %} {% trans motion.status %}
{% else %} {% else %}
{% for note in motion.notes %} {% for note in motion.notes %}
{{ note }} {{ note }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</p> </p>
@ -34,12 +34,12 @@
{% endif %} {% endif %}
{% with poll.get_options.0 as option %} {% with poll.get_options.0 as option %}
<div class="results"> <div class="results">
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ option.Yes }} <br> <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Yes' %}"> {{ option.Yes }} <br>
<img src="{% static 'images/icons/voting-no.png' %}" title="{% trans 'No' %}"> {{ option.No }} <br> <img src="{% static 'img/voting-no.png' %}" title="{% trans 'No' %}"> {{ option.No }} <br>
<img src="{% static 'images/icons/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ option.Abstain }}<br> <img src="{% static 'img/voting-abstention.png' %}" title="{% trans 'Abstention' %}"> {{ option.Abstain }}<br>
<img src="{% static 'images/icons/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> {{ poll.print_votesinvalid }}<br> <img src="{% static 'img/voting-invalid.png' %}" title="{% trans 'Invalid' %}"> {{ poll.print_votesinvalid }}<br>
<hr> <hr>
<img src="{% static 'images/icons/voting-total.png' %}" title="{% trans 'Votes cast' %}"> {{ poll.print_votescast }} <img src="{% static 'img/voting-total.png' %}" title="{% trans 'Votes cast' %}"> {{ poll.print_votescast }}
</div> </div>
{% endwith %} {% endwith %}
{% else %} {% else %}
@ -53,7 +53,7 @@
{% endwith %} {% endwith %}
<p><b>{% trans "Submitter" %}:</b><br> <p><b>{% trans "Submitter" %}:</b><br>
{{ motion.submitter }} {{ motion.submitter.person }}
</p> </p>
</div> </div>
</div> </div>
@ -65,7 +65,7 @@
{% trans "Motion" %} <i>[{% trans "no number" %}]</i> {% trans "Motion" %} <i>[{% trans "no number" %}]</i>
{% endif %} {% endif %}
</h1> </h1>
<b>{{ motion.public_version.title }}</b> <b>{{ motion.title }}</b>
<hr> <hr>
{% endblock %} {% endblock %}

View File

@ -2,140 +2,104 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
openslides.motion.urls openslides.motion.urls
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
URL list for the motion app. Defines the URL patterns for the motion app.
:copyright: 2011, 2012 by OpenSlides team, see AUTHORS. :copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
from django.conf.urls import url, patterns from django.conf.urls import url, patterns
from openslides.motion.views import (MotionDelete, ViewPoll,
MotionPDF, MotionPollPDF, CreateAgendaItem, SupportView)
urlpatterns = patterns('openslides.motion.views', urlpatterns = patterns('openslides.motion.views',
url(r'^$', url(r'^$',
'overview', 'motion_list',
name='motion_overview', name='motion_list',
), ),
url(r'^(?P<motion_id>\d+)/$', url(r'^create/$',
'view', 'motion_create',
name='motion_view',
),
url(r'^(?P<motion_id>\d+)/agenda/$',
CreateAgendaItem.as_view(),
name='motion_create_agenda',
),
url(r'^(?P<motion_id>\d+)/newest/$',
'view',
{'newest': True},
name='motion_view_newest',
),
url(r'^new/$',
'edit',
name='motion_new', name='motion_new',
), ),
url(r'^import/$', url(r'^(?P<pk>\d+)/$',
'motion_import', 'motion_detail',
name='motion_import', name='motion_detail',
), ),
url(r'^(?P<motion_id>\d+)/edit/$', url(r'^(?P<pk>\d+)/edit/$',
'edit', 'motion_edit',
name='motion_edit', name='motion_edit',
), ),
url(r'^(?P<motion_id>\d+)/del/$', url(r'^(?P<pk>\d+)/del/$',
MotionDelete.as_view(), 'motion_delete',
name='motion_delete', name='motion_delete',
), ),
url(r'^del/$', url(r'^(?P<pk>\d+)/version/(?P<version_number>\d+)/$',
MotionDelete.as_view(), 'motion_detail',
{ 'motion_id' : None , 'motion_ids' : None }, name='motion_version_detail',
name='motion_delete',
), ),
url(r'^(?P<motion_id>\d+)/setnumber/$', url(r'^(?P<pk>\d+)/version/(?P<version_number>\d+)/permit/$',
'set_number', 'version_permit',
name='motion_set_number',
),
url(r'^(?P<motion_id>\d+)/setstatus/(?P<status>[a-z]{3})/$',
'set_status',
name='motion_set_status',
),
url(r'^(?P<motion_id>\d+)/permit/$',
'permit',
name='motion_permit',
),
url(r'^version/(?P<aversion_id>\d+)/permit/$',
'permit_version',
name='motion_version_permit', name='motion_version_permit',
), ),
url(r'^version/(?P<aversion_id>\d+)/reject/$', url(r'^(?P<pk>\d+)/version/(?P<version_number>\d+)/reject/$',
'reject_version', 'version_reject',
name='motion_version_reject', name='motion_version_reject',
), ),
url(r'^(?P<motion_id>\d+)/notpermit/$', url(r'^(?P<pk>\d+)/support/$',
'notpermit', 'motion_support',
name='motion_notpermit',
),
url(r'^(?P<motion_id>\d+)/reset/$',
'reset',
name='motion_reset',
),
url(r'^(?P<motion_id>\d+)/support/$',
SupportView.as_view(support=True),
name='motion_support', name='motion_support',
), ),
url(r'^(?P<motion_id>\d+)/unsupport/$', url(r'^(?P<pk>\d+)/unsupport/$',
SupportView.as_view(support=False), 'motion_unsupport',
name='motion_unsupport', name='motion_unsupport',
), ),
url(r'^(?P<motion_id>\d+)/gen_poll/$', url(r'^(?P<pk>\d+)/create_poll/$',
'gen_poll', 'poll_create',
name='motion_gen_poll', name='motion_poll_create',
), ),
url(r'^print/$', url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/edit/$',
MotionPDF.as_view(), 'poll_edit',
{'motion_id': None}, name='motion_poll_edit',
name='print_motions',
), ),
url(r'^(?P<motion_id>\d+)/print/$', url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/del/$',
MotionPDF.as_view(), 'poll_delete',
name='print_motion',
),
url(r'^poll/(?P<poll_id>\d+)/print/$',
MotionPollPDF.as_view(),
name='print_motion_poll',
),
url(r'^poll/(?P<poll_id>\d+)/$',
ViewPoll.as_view(),
name='motion_poll_view',
),
url(r'^poll/(?P<poll_id>\d+)/del/$',
'delete_poll',
name='motion_poll_delete', name='motion_poll_delete',
), ),
url(r'^(?P<pk>\d+)/set_state/(?P<state>[a-z]{3})/$',
'set_state',
name='motion_set_state',
),
url(r'^(?P<pk>\d+)/reset_state/$',
'reset_state',
name='motion_reset_state',
),
url(r'^(?P<pk>\d+)/agenda/$',
'create_agenda_item',
name='motion_create_agenda',
),
url(r'^pdf/$',
'motion_list_pdf',
name='motion_list_pdf',
),
url(r'^(?P<pk>\d+)/pdf/$',
'motion_detail_pdf',
name='motion_detail_pdf',
),
) )

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,144 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.utils.workflow
~~~~~~~~~~~~~~~~~~~~~~~~~
Defines the States for motions. All States are linked together with there
'next_state' attributes. Together there are a workflow.
:copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.conf import settings
from django.core import exceptions
from django.utils.importlib import import_module
from django.utils.translation import ugettext_noop
from openslides.config.models import config
_workflow = None
class State(object):
"""Define a state for a motion."""
def __init__(self, id, name, next_states=[], create_poll=False, support=False,
edit_as_submitter=False, version_permission=True):
"""Set attributes for the state.
The Arguments are:
- 'id' a unique id for the state.
- 'name' a string representing the state.
- 'next_states' a list with all states, that can be choosen from this state.
All the other arguments are boolean values. If True, the specific action for
motions in this state.
- 'create_poll': polls can be created in this state.
- 'support': persons can support the motion in this state.
- 'edit_as_submitter': the submitter can edit the motion in this state.
- 'version_permission': new versions are not permitted.
"""
self.id = id
self.name = name
self.next_states = next_states
self.create_poll = create_poll
self.support = support
self.edit_as_submitter = edit_as_submitter
self.version_permission = version_permission
def __unicode__(self):
"""Return the name of the state."""
return self.name
class WorkflowError(Exception):
"""Exception raised when errors in a state accure."""
pass
def motion_workflow_choices():
"""Return all possible workflows.
The possible workflows can be set in the settings with the setting
'MOTION_WORKFLOW'.
"""
for workflow in settings.MOTION_WORKFLOW:
yield workflow[0], workflow[1]
def get_state(state='default'):
"""Return a state object.
The argument 'state' has to be a state_id.
If the argument 'state' is 'default', the default state is returned.
The default state is the state object choosen in the config tab.
"""
global _workflow
if _workflow is not None:
try:
return _workflow[state]
except KeyError:
raise WorkflowError('Unknown state: %s' % state)
_workflow = {}
for workflow in settings.MOTION_WORKFLOW:
if workflow[0] == config['motion_workflow']:
try:
wf_module, wf_default_state_name = workflow[2].rsplit('.', 1)
except ValueError:
raise exceptions.ImproperlyConfigured(
'%s isn\'t a workflow module' % workflow[2])
try:
mod = import_module(wf_module)
except ImportError as e:
raise exceptions.ImproperlyConfigured(
'Error importing workflow %s: "%s"' % (wf_module, e))
try:
default_state = getattr(mod, wf_default_state_name)
except AttributeError:
raise exceptions.ImproperlyConfigured(
'Workflow module "%s" does not define a "%s" State'
% (wf_module, wf_default_state_name))
_workflow['default'] = default_state
break
else:
raise ImproperlyConfigured('Unknown workflow %s' % conf['motion_workflow'])
populate_workflow(default_state, _workflow)
return get_state(state)
def populate_workflow(state, workflow):
"""Append all 'next_states' from state to the workflow.
The argument state has to be a state object.
The argument workflow has to be a dictonary.
Calls this function recrusiv with all next_states from the next_states states.
"""
workflow[state.id] = state
for s in state.next_states:
if s.id not in workflow:
populate_workflow(s, workflow)
DUMMY_STATE = State('dummy', ugettext_noop('Unknwon state'))
"""A dummy state object. Returned, if the state_id is not known."""
default_workflow = State('pub', ugettext_noop('Published'), support=True,
edit_as_submitter=True, version_permission=False)
"""Default Workflow for OpenSlides."""
default_workflow.next_states = [
State('per', ugettext_noop('Permitted'), create_poll=True, edit_as_submitter=True, next_states=[
State('acc', ugettext_noop('Accepted')),
State('rej', ugettext_noop('Rejected')),
State('wit', ugettext_noop('Withdrawed')),
State('adj', ugettext_noop('Adjourned')),
State('noc', ugettext_noop('Not Concerned')),
State('com', ugettext_noop('Commited a bill')),
State('rev', ugettext_noop('Needs Review'))]),
State('nop', ugettext_noop('Rejected (not authorized)'))]

View File

@ -6,22 +6,24 @@
*/ */
$(function() { $(function() {
// change participant status (on/off)
$('.status_link').click(function(event) { $('.status_link').click(function(event) {
event.preventDefault(); event.preventDefault();
link = $(this); var link = $(this);
group = $(this).parent();
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: link.attr('href'), url: $(this).attr('href'),
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if (data.active) { if (data.active) {
group.children('.status_link.deactivate').show(); newclass = 'icon-on';
group.children('.status_link.activate').hide(); link.addClass('btn-success');
} else { } else {
group.children('.status_link.deactivate').hide(); newclass = 'icon-off';
group.children('.status_link.activate').show(); link.removeClass('btn-success');
} }
link.children('i').removeClass('icon-off icon-on').addClass(newclass);
link.attr('href', data.link);
} }
}); });
}); });

View File

@ -1,22 +0,0 @@
/**
* OpenSlides participants style
*
* :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
* :license: GNU GPL, see LICENSE for more details.
*/
a.status_link span {
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
display: inline-block;
}
a.status_link.deactivate span {
background-image: url(../images/icons/on.png);
}
a.status_link.activate span {
background-image: url(../images/icons/off.png);
}

View File

@ -1,77 +0,0 @@
{% extends "base.html" %}
{% load tags %}
{% load i18n %}
{% load staticfiles %}
{% block submenu %}
{% url 'user_overview' as url_users %}
{% url 'user_new' as url_usernew %}
{% url 'user_group_overview' as url_usergroups %}
{% url 'user_import' as url_userimport %}
<h4 class="sectiontitle">{% trans "Participants" %}</h4>
<ul>
{% if perms.participant.can_see_participant %}
<li class="{% if request.path == url_users %}selected{% endif %}"><a href="{% url 'user_overview' %}">{% trans "All participants" %}</a></li>
{% endif %}
{% if perms.participant.can_manage_participant %}
<li class="{% active request url_usernew %}"><a href="{% url 'user_new' %}">{% trans "New participant" %}</a></li>
<li class="{% if request.path == url_usergroups %}selected{% endif %}"><a href="{% url 'user_group_overview' %}">{% trans "All groups" %}</a></li>
<li class="{% active request '/participant/group/new' %}"><a href="{% url 'user_group_new' %}">{% trans "New group" %}</a></li>
<li class="{% if request.path == url_userimport %}selected{% endif %}"><a href="{% url 'user_import' %}"> {% trans 'Import participants' %}</a></li>
{% endif %}
{% if perms.participant.can_see_participant %}
<li><a href="{% url 'user_print' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'List of participants as PDF' %}</a></li>
{% endif %}
{% if perms.participant.can_manage_participant %}
<li><a href="{% url 'print_passwords' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'First time passwords as PDF' %}</a></li>
{% endif %}
</ul>
{# second submenu #}
{% if shown_user %}
<br>
<h3>{{ shown_user.clean_name }}</h3>
<ul>
{# view shown_user #}
<li class="{% if request.path == 'foo' %}selected{% endif %}">
<a href="{% model_url shown_user 'view' %}">{% trans 'View participant' %}</a>
</li>
{% if perms.participant.can_manage_participant %}
{# edit shown_user #}
<li class="{% if request.path == 'foo' %}selected{% endif %}">
<a href="{% model_url shown_user 'edit' %}"><img src="{% static 'images/icons/edit.png' %}"> {% trans 'Edit participant' %}</a>
</li>
{# delete shown_user #}
<li>
<a href="{% model_url shown_user 'delete' %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete participant' %}</a>
</li>
{% endif %}
</ul>
{% elif group %}
<br>
<h3>{{ group.name }}</h3>
<ul>
{# view group #}
<li class="{% if request.path == 'foo' %}selected{% endif %}">
<a href="{% model_url group 'view' %}">{% trans 'View group' %}</a>
</li>
{# edit group #}
<li class="{% if request.path == 'foo' %}selected{% endif %}">
<a href="{% model_url group 'edit' %}"><img src="{% static 'images/icons/edit.png' %}"> {% trans 'Edit group' %}</a>
</li>
{# delete group #}
{% if group.name|lower != 'anonymous' and group.name|lower != 'registered' %}
<li>
<a href="{% model_url group 'delete' %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete group' %}</a>
</li>
{% endif %}
</ul>
{% endif %}
{% endblock %}

View File

@ -5,18 +5,19 @@
{% block title %}{{ block.super }} {% trans "Participant settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Participant settings" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Participant settings" %}</h1> <h1>
{% trans "Configuration" %}
<small>{% trans "Participants" %}</small>
{% block config_submenu %}{{ block.super }}{% endblock %}
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_save.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href="{% url 'config_participant' %}" class="btn">
</button> {% trans 'Cancel' %}
<a href="{% url 'config_participant' %}"> </a>
<button class="button" type="button" onclick="window.location='{% url 'config_participant' %}'"> </p>
<span class="icon cancel">{% trans 'Cancel' %}</span> <small>* {% trans "required" %}</small>
</button>
</a>
</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
@ -11,33 +11,30 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if edit_user %} <h1>
<h1>{% trans "Edit participant" %}</h1> {% if edit_user %}
{% else %} {% trans "Edit participant" %}
<h1>{% trans "New participant" %}</h1> {% else %}
{% endif %} {% trans "New participant" %}
{% endif %}
<small class="pull-right">
<a href="{% url 'user_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
{% if edit_user %} {% if edit_user %}
<p> <p style="margin: -15px 0 25px 0;">
<a href="{% url 'user_reset_password' edit_user.id %}">{% trans 'Reset to First Password' %}</a> <a class="btn btn-mini" href="{% url 'user_reset_password' edit_user.id %}"><i class="icon-exclamation-sign"></i> {% trans 'Reset to First Password' %}</a>
</p> </p>
{% endif %} {% endif %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_saveapply.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href="{% url 'user_overview' %}" class="btn">
</button> {% trans 'Cancel' %}
<button class="button" type="submit" name="apply"> </a>
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href='{% url "user_overview" %}'>
<button class="button" type="button" onclick="window.location='{% url 'user_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
</p> </p>
<small>* {% trans "required" %}</small> <small>* {% trans "required" %}</small>
</form> </form>

View File

@ -1,4 +1,4 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load tags %} {% load tags %}
@ -7,16 +7,22 @@
{% block content %} {% block content %}
<h1>{{ group }}</h1> <h1>{{ group }}
<small class="pull-right">
<a href="{% url 'user_group_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<p>{{ group.description }}</p> <p>{{ group.description }}</p>
<h2>{% trans "Members" %}</h2> <h4>{% trans "Members" %}</h4>
<ol>
{% for member in group.user_set.all %} {% for member in group.user_set.all %}
<p>{{ member }}</p> <li>{{ member }}</li>
{% empty %} {% empty %}
<p>{% trans "No members available." %}</p> <p>{% trans "No members available." %}</p>
{% endfor %} {% endfor %}
</ol>
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
@ -12,25 +12,23 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>
{% if group %} {% if group %}
<h1>{% trans "Edit group" %}</h1> {% trans "Edit group" %}
{% else %} {% else %}
<h1>{% trans "New group" %}</h1> {% trans "New group" %}
{% endif %} {% endif %}
<small class="pull-right">
<a href="{% url 'user_group_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> {% include "formbuttons_saveapply.html" %}
<span class="icon ok">{% trans 'Save' %}</span> <a href="{% url 'user_group_overview' %}" class="btn">
</button> {% trans 'Cancel' %}
<button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span>
</button>
<a href='{% url "user_group_overview" %}'>
<button class="button" type="button" onclick="window.location='{% url 'user_group_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a> </a>
</p> </p>
<small>* {% trans "required" %}</small> <small>* {% trans "required" %}</small>

View File

@ -1,30 +1,45 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% load tags %} {% load tags %}
{% block title %}{{ block.super }} {% trans "Groups" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Groups" %}{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Groups" %}</h1> <h1>{% trans "Groups" %}
<table> <small class="pull-right">
<a href="{% url 'user_group_new' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'New group' %}"><i class="icon-plus"></i> {% trans "New" %}</a>
<a href="{% url 'user_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to participants overview" %}</a>
</small>
</h1>
<table class="table table-striped table-bordered">
<tr> <tr>
<th>{% trans "Group" %}</th> <th>{% trans "Group" %}</th>
<th>{% trans "Actions" %}</th> <th style="width: 1px;">{% trans "Actions" %}</th>
</tr> </tr>
{% for group in groups %} {% for group in groups %}
<tr class="{% cycle '' 'odd' %}"> <tr class="{% if group.active %}activeline{% endif %}">
<td><a href="{% model_url group 'view' %}">{{ group.name }}</a></td> <td>
<td><a href="{% url 'user_group_edit' group.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit group' %}"></a> <a href="{% model_url group 'view' %}">{{ group.name }}</a>
{% if group.name|lower != 'anonymous' and group.name|lower != 'registered' %} </td>
<a href="{% url 'user_group_delete' group.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete group' %}"></a> <td>
{% endif %} <span style="width: 1px; white-space: nowrap;">
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' group.sid %}" class="activate_link btn {% if group.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<i class="icon-facetime-video {% if group.active %}icon-white{% endif %}"></i>
</a>
{% endif %}
<a href="{% url 'user_group_edit' group.id %}" title="{% trans 'Edit' %}" class="btn btn-mini">
<i class="icon-pencil"></i>
</a>
{% if group.name|lower != 'anonymous' and group.name|lower != 'registered' %}
<a href="{% url 'user_group_delete' group.id %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<i class="icon-remove"></i>
</a>
{% endif %}
</span>
</td> </td>
</tr>
{% empty %}
<tr>
<td colspan="5"><i>{% trans "No groups available." %}</i></td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View File

@ -5,17 +5,14 @@
{% for group in groups %} {% for group in groups %}
{% if group.name != 'Anonymous' and group.name != 'Registered' %} {% if group.name != 'Anonymous' and group.name != 'Registered' %}
<li class="{% if group.active %}activeline{% endif %}"> <li class="{% if group.active %}activeline{% endif %}">
<a href="{% url 'projector_activate_slide' group.sid %}" class="activate_link {% if group.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' group.sid %}" class="activate_link btn {% if group.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<div></div> <i class="icon-facetime-video {% if group.active %}icon-white{% endif %}"></i>
</a>&nbsp;
<a href="{% model_url group 'edit' %}" title="{% trans 'Edit' %}" class="btn btn-mini right">
<i class="icon-pencil"></i>
</a> </a>
<a href="{% model_url group 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% url 'projctor_preview_slide' group.sid %}" title="{% trans 'Preview' %}" class="btn btn-mini right">
<span></span> <i class="icon-search"></i>
</a>
<a href="{% model_url group 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url 'projctor_preview_slide' group.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a> </a>
<a href="{% model_url group 'view' %}">{{ group }}</a> <a href="{% model_url group 'view' %}">{{ group }}</a>
</li> </li>

View File

@ -1,11 +1,17 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{{ block.super }} {% trans "Import participants" %} {% endblock %} {% block title %}{{ block.super }} {% trans "Import participants" %} {% endblock %}
{% block content %} {% block content %}
<h1>{% trans 'Import participants' %}</h1> <h1>
{% trans 'Import participants' %}
<small class="pull-right">
<a href="{% url 'user_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<p>{% trans 'Select a CSV file to import participants!' %}</p> <p>{% trans 'Select a CSV file to import participants!' %}</p>
<p>{% trans 'Required comma separated values' %}: <p>{% trans 'Required comma separated values' %}:
@ -18,15 +24,13 @@
</p> </p>
<form enctype="multipart/form-data" action="" method="post">{% csrf_token %} <form enctype="multipart/form-data" action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
<p> <p>
<button class="button" type="submit"> <button class="btn btn-primary" type="submit">
<span class="icon import">{% trans 'Import' %}</span> <span class="icon import">{% trans 'Import' %}</span>
</button> </button>
<a href="{% url 'user_overview' %}"> <a href="{% url 'user_overview' %}" class="btn">
<button class="button" type="button" onclick="window.location='{% url 'user_overview' %}'"> {% trans 'Cancel' %}
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a> </a>
</p> </p>
<small>* {% trans "required" %}</small> <small>* {% trans "required" %}</small>

View File

@ -1,25 +1,17 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load staticfiles %}
{% block mainmenu %} {% block loginbutton %}
<ul>
<li class="selected"><a href="{% url 'user_login' %}" title="">{% trans "Login" %}</a></li>
</ul>
{% endblock %} {% endblock %}
{% block submenu %} {% block body %}
{% endblock %} <div id="login-page" class="container">
<h2><img src="{% static '/static/img/logo-login.png' %}"></h2>
{% block content %}
<h1>{% trans "Login" %}</h1>
{% if form.errors %} {% if form.errors %}
<div class="notification error"> <div class="alert alert-error">
<a class="close" href="#">
<img alt="close" title="{% trans 'Close this notification' %}" src="{% static 'images/icons/cross.png' %}">
</a>
{% for msg in form.non_field_errors %} {% for msg in form.non_field_errors %}
<em>{{ msg }}</em> <em>{{ msg }}</em>
{% if not forloop.last %}<br />{% endif %} {% if not forloop.last %}<br />{% endif %}
@ -29,48 +21,37 @@
</div> </div>
{% endif %} {% endif %}
{% if first_time_message %} {% if first_time_message %}
<div class="notification info"> <div class="alert alert-info">
<a class="close" href="#">
<img alt="close" title="{% trans 'Close this notification' %}" src="{% static 'images/icons/cross.png' %}">
</a>
<em>{{ first_time_message|safe }}</em> <em>{{ first_time_message|safe }}</em>
</div> </div>
{% endif %} {% endif %}
<script> <script>
$("div.notification").click(function () { $("div.notification").click(function () {
$(this).hide("fast"); $(this).hide("fast");
}); });
</script> </script>
<form method="post" action="{% url 'user_login' %}{% if next %}?next={{ next }}{% endif %}"> <form method="post" action="{% url 'user_login' %}{% if next %}?next={{ next }}{% endif %}" class="well">
{% csrf_token %} {% csrf_token %}
<table> <div class="input-prepend">
<tr> <span class="add-on"><i class="icon-user"></i></span>
<td>{{ form.username.label_tag }}</td> <input type="text" maxlength="30" name="username" id="id_username" placeholder="{% trans 'Username' %}">
<td>{{ form.username }}</td> </div>
</tr> <div class="input-prepend">
<tr> <span class="add-on"><i class="icon-lock"></i></span>
<td>{{ form.password.label_tag }}</td> <input type="password" maxlength="30" name="password" id="id_password" placeholder="{% trans 'Password' %}">
<td>{{ form.password }}</td> </div>
</tr>
</table>
<p> <p>
<button class="button" type="submit"> <button type="submit" class="btn btn-primary">
<span class="icon ok">{% trans 'Login' %}</span> {% trans 'Login' %}
</button> </button>
{% if os_enable_anonymous_login %} {% if os_enable_anonymous_login %}
<button class="button" id="anonymous_login"> <a id="anonymous_login" class="btn" href="{% url 'dashboard' %}">
<span class="icon guest">{% trans 'Continue as guest' %}</span> {% trans 'Continue as guest' %}
</button> </a>
{% endif %} {% endif %}
<input type="hidden" name="next" value="{{ next }}" /> <input type="hidden" name="next" value="{{ next }}" />
</p> </p>
</form> </form>
{% if os_enable_anonymous_login %}
<script>
$("#anonymous_login").live('click', function () {
window.location.href = "{% url 'item_overview' %}";
return false;
});
</script>
{% endif %}
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load staticfiles %}
@ -6,104 +6,142 @@
{% block title %}{{ block.super }} {% trans "Participants" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Participants" %}{% endblock %}
{% block header %} {% block javascript %}
{% if perms.agenda.can_manage_agenda %} {% if perms.participant.can_manage_participant %}
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/participant.css' %}" />
<script type="text/javascript" src="{% static 'javascript/participant.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/participant.js' %}"></script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Participants" %}</h1> <h1>{% trans "Participants" %}
<small class="pull-right">
<div class="btn-toolbar">
{% if perms.participant.can_manage_participant %}
<a href="{% url 'user_new' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'New participant' %}"><i class="icon-plus"></i> {% trans "New" %}</a>
<a href="{% url 'user_group_overview' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'All groups' %}"><i class="icon-group"></i> {% trans "Groups" %}</a>
<a href="{% url 'user_import' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Import participants' %}"><i class="icon-import"></i> {% trans 'Import' %}</a>
{% endif %}
{% if perms.participant.can_see_participant and perms.participant.can_manage_participant %}
<div class="btn-group pull-right">
{% if user.is_authenticated %}
<a href="#" data-toggle="dropdown" class="btn btn-mini dropdown-toggle">
<i class="icon-print"></i> PDF
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{% url 'user_settings' as url_usersettings %}
<li><a href="{% url 'user_print' %}"><i class="icon-list"></i> {% trans 'List of participants' %}</a></li>
<li><a href="{% url 'print_passwords' %}"><i class="icon-th-large"></i> {% trans 'First time passwords' %}</a></li>
</ul>
{% else %}
<a href="{% url 'user_login' %}" class="btn">{% trans "Login" %}</a>
{% endif %}
</div>
{% else %}
{% if perms.participant.can_see_participant %}
<a href="{% url 'user_print' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Print list of participants as PDF' %}"><i class="icon-print"></i> PDF</a>
{% endif %}
{% if perms.participant.can_manage_participant %}
<a href="{% url 'print_passwords' %}" class="btn btn-mini" rel="tooltip" data-original-title="{% trans 'Print first time passwords as PDF' %}"><i class="icon-print"></i> PDF</a>
{% endif %}
{% endif %}
</div>
</small>
</h1>
<p> <form action="" name="filter" method="get">
<form action="" name="filter" method="get"> {% trans "Filter" %}:
{% trans "Filter" %}: <div class="control-group">
<select class="default-input" name="gender" onchange="document.forms['filter'].submit()"> <select class="span2" name="gender" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Gender" %} --</option> <option value="---">-- {% trans "Gender" %} --</option>
<option value="male"{% if 'male' in sortfilter.gender %} selected{% endif %}>{% trans "Male" %}</option> <option value="male"{% if 'male' in sortfilter.gender %} selected{% endif %}>{% trans "Male" %}</option>
<option value="female"{% if 'female' in sortfilter.gender %} selected{% endif %}>{% trans "Female" %}</option> <option value="female"{% if 'female' in sortfilter.gender %} selected{% endif %}>{% trans "Female" %}</option>
<option value=""{% if '' in sortfilter.gender %} selected{% endif %}>{% trans "Not specified" %}</option> <option value=""{% if '' in sortfilter.gender %} selected{% endif %}>{% trans "Not specified" %}</option>
</select> </select>
<select class="default-input" name="structure_level" onchange="document.forms['filter'].submit()"> <select class="span2" name="structure_level" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Structure level" %} --</option> <option value="---">-- {% trans "Structure level" %} --</option>
{% for level in structure_levels %} {% for level in structure_levels %}
<option value="{{ level }}"{% if level in sortfilter.structure_level %} selected{% endif %}> <option value="{{ level }}"{% if level in sortfilter.structure_level %} selected{% endif %}>
{{ level }}</option> {{ level }}</option>
{% endfor %} {% endfor %}
</select> </select>
<select class="default-input" name="type" onchange="document.forms['filter'].submit()"> <select class="span2" name="type" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Type" %} --</option> <option value="---">-- {% trans "Type" %} --</option>
<option value="delegate"{% if 'delegate' in sortfilter.type %} selected{% endif %}>{% trans "Delegate" %}</option> <option value="delegate"{% if 'delegate' in sortfilter.type %} selected{% endif %}>{% trans "Delegate" %}</option>
<option value="observer"{% if 'observer' in sortfilter.type %} selected{% endif %}>{% trans "Observer" %}</option> <option value="observer"{% if 'observer' in sortfilter.type %} selected{% endif %}>{% trans "Observer" %}</option>
<option value="staff"{% if 'staff' in sortfilter.type %} selected{% endif %}>{% trans "Staff" %}</option> <option value="staff"{% if 'staff' in sortfilter.type %} selected{% endif %}>{% trans "Staff" %}</option>
<option value="guest"{% if 'guest' in sortfilter.type %} selected{% endif %}>{% trans "Guest" %}</option> <option value="guest"{% if 'guest' in sortfilter.type %} selected{% endif %}>{% trans "Guest" %}</option>
<option value=""{% if '' in sortfilter.type %} selected{% endif %}>{% trans "Not specified" %}</option> <option value=""{% if '' in sortfilter.type %} selected{% endif %}>{% trans "Not specified" %}</option>
</select> </select>
<select class="default-input" name="committee" onchange="document.forms['filter'].submit()"> <select class="span2" name="committee" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Committee" %} --</option> <option value="---">-- {% trans "Committee" %} --</option>
{% for committee in committees %} {% for committee in committees %}
<option value="{{ committee }}"{% if committee in sortfilter.committee %} selected{% endif %}> <option value="{{ committee }}"{% if committee in sortfilter.committee %} selected{% endif %}>
{{ committee }}</option> {{ committee }}</option>
{% endfor %} {% endfor %}
</select> </select>
<select class="default-input" name="status" onchange="document.forms['filter'].submit()"> <select class="span2" name="status" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Status" %} --</option> <option value="---">-- {% trans "Status" %} --</option>
<option value="1"{% if '1' in sortfilter.status %} selected{% endif %}>{% trans "Active" %}</option> <option value="1"{% if '1' in sortfilter.status %} selected{% endif %}>{% trans "Active" %}</option>
<option value="0"{% if '0' in sortfilter.status %} selected{% endif %}>{% trans "Inactive" %}</option> <option value="0"{% if '0' in sortfilter.status %} selected{% endif %}>{% trans "Inactive" %}</option>
</select> </select>
</form> </div>
</p> </form>
<small><i>
{% if users.count == allusers %} {% if users.count == allusers %}
{{ users.count }} {{ users.count }}
{% blocktrans count counter=users.count %}participant{% plural %}participants{% endblocktrans %} {% blocktrans count counter=users.count %}participant{% plural %}participants{% endblocktrans %}
{% else %} {% else %}
{{ users.count }} {% trans "of" %} {{ allusers }} {% trans "Participants" %} (= {{ percent }} %) {{ users.count }} {% trans "of" %} {{ allusers }} {% trans "Participants" %} (= {{ percent }} %)
{% endif %} {% endif %}
<table> </i></small>
<table class="table table-striped table-bordered">
<tr> <tr>
<th><a href="?sort=first_name&reverse={% if 'first_name' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "First Name" %}</a></th> <th><a href="?sort=first_name&reverse={% if 'first_name' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "First Name" %}</a></th>
<th><a href="?sort=last_name&reverse={% if 'last_name' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Last Name" %}</a></th> <th><a href="?sort=last_name&reverse={% if 'last_name' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Last Name" %}</a></th>
<th><a href="?sort=structure_level&reverse={% if 'structure_level' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Structure level" %}</a></th> <th class="optional"><a href="?sort=structure_level&reverse={% if 'structure_level' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Structure level" %}</a></th>
<th><a href="?sort=type&reverse={% if 'type' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Type" %}</a></th> <th class="optional"><a href="?sort=type&reverse={% if 'type' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Type" %}</a></th>
<th><a href="?sort=committee&reverse={% if 'committee' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Committee" %}</a></th> <th class="optional"><a href="?sort=committee&reverse={% if 'committee' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Committee" %}</a></th>
{% if perms.participant.can_manage_participant %} {% if perms.participant.can_manage_participant %}
<th><a href="?sort=comment&reverse={% if 'comment' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Comment" %}</a></th> <th class="optional"><a href="?sort=comment&reverse={% if 'comment' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Comment" %}</a></th>
<th><a href="?sort=last_login&reverse={% if 'last_login' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Last Login" %}</a></th> <th class="optional"><a href="?sort=last_login&reverse={% if 'last_login' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Last Login" %}</a></th>
<th>{% trans "Actions" %}</th> <th class="mini_width">{% trans "Actions" %}</th>
{% endif %} {% endif %}
</tr> </tr>
{% for user in users %} {% for user in users %}
<tr class="{% cycle '' 'odd' %}"> <tr class="{% if user.active %}activeline{% endif %}">
<td><a href="{% model_url user 'view' %}">{{ user.first_name }}</a></td> <td><a href="{% url 'user_view' user.id %}">{{ user.first_name }}</a></td>
<td><a href="{% model_url user 'view' %}">{{ user.last_name }}</a></td> <td><a href="{% url 'user_view' user.id %}">{{ user.last_name }}</a></td>
<td>{{ user.structure_level }}</td> <td class="optional">{{ user.structure_level }}</td>
<td>{{ user.get_type_display }}</td> <td class="optional">{{ user.get_type_display }}</td>
<td>{{ user.committee }}</td> <td class="optional">{{ user.committee }}</td>
{% if perms.participant.can_manage_participant %} {% if perms.participant.can_manage_participant %}
<td>{{ user.comment|first_line }}</td> <td class="optional">{{ user.comment|first_line }}</td>
<td> <td class="optional">
{% if user.last_login > user.date_joined %} {% if user.last_login > user.date_joined %}
{{ user.last_login }} {{ user.last_login }}
{% endif %} {% endif %}
</td> </td>
<td> <td>
<span style="width: 1px; white-space: nowrap;"> <span style="width: 1px; white-space: nowrap;">
<a href="{% url 'user_edit' user.id %}"> {% if perms.projector.can_manage_projector %}
<img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit participant' %}"> <a href="{% url 'projector_activate_slide' user.sid %}" class="activate_link btn {% if user.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<i class="icon-facetime-video {% if user.active %}icon-white{% endif %}"></i>
</a>
{% endif %}
<a href="{% url 'user_edit' user.id %}" title="{% trans 'Edit' %}" class="btn btn-mini">
<i class="icon-pencil"></i>
</a> </a>
{% if user != request_user %} {% if user != request_user %}
<a href="{% url 'user_delete' user.id %}"> <a href="{% url 'user_delete' user.id %}" title="{% trans 'Delete' %}" class="btn btn-mini">
<img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete participant' %}"> <i class="icon-remove"></i>
</a> </a>
{% endif %} {% endif %}
{% if user != request_user and not user.is_superuser %} {% if user != request_user and not user.is_superuser %}
<a class="status_link deactivate" href="{% url 'user_status_deactivate' user.id %}" title="{% trans 'Change status to inactive' %}"{% if not user.is_active %} style="display:none"{% endif %}> <a href="{% url 'user_status_toggle' user.id %}"
<span></span> class="status_link btn btn-mini {% if user.is_active %}btn-success{% endif %}"
</a> title="{% trans 'Change status (active/inactive)' %}">
<a class="status_link activate" href="{% url 'user_status_activate' user.id %}" title="{% trans 'Change status to active' %}"{% if user.is_active %} style="display:none"{% endif %}> <i class="{% if user.is_active %}icon-on{% else %}icon-off{% endif %}"></i>
<span></span>
</a> </a>
{% endif %} {% endif %}
</span> </span>

View File

@ -4,28 +4,11 @@
{% block title %}{{ block.super }} {% trans "Password Settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Password Settings" %}{% endblock %}
{% block submenu %}
<h4 class="sectiontitle">{% trans "User Settings" %}</h4>
<ul>
<li><a href="{% url 'user_settings' %}">{% trans "Personal Settings" %}</a></li>
<li class="selected"><a href="{% url 'password_change' %}">{% trans "Password Settings" %}</a></li>
</ul>
{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Password Settings" %}</h1> <h1>{% trans "Password Settings" %}</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form.as_p }} {% include "form.html" %}
{% include "formbuttons_save.html" %}
<button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span>
</button>
<a href=''>
<button class="button" type="button">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
</form> </form>
<p></p>
{% endblock %} {% endblock %}

View File

@ -2,29 +2,13 @@
{% load i18n %} {% load i18n %}
{% block title %}{{ block.super }} {% trans "Personal Settings" %}{% endblock %} {% block title %}{{ block.super }} {% trans "Edit profile" %}{% endblock %}
{% block submenu %}
<h4 class="sectiontitle">{% trans "User Settings" %}</h4>
<ul>
<li class="selected"><a href="{% url 'user_settings' %}">{% trans "Personal Settings" %}</a></li>
<li><a href="{% url 'password_change' %}">{% trans "Password Settings" %}</a></li>
</ul>
{% endblock %}
{% block content %} {% block content %}
<h1>{% trans "Personal Settings" %}</h1> <h1>{% trans "Edit profile" %}</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{{ form_user.as_p }} {% include "form.html" %}
{% include "formbuttons_save.html" %}
<button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span>
</button>
<a href=''>
<button class="button" type="button">
<span class="icon cancel">{% trans 'Cancel' %}</span>
</button>
</a>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "participant/base_participant.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load tags %} {% load tags %}
@ -7,11 +7,15 @@
{% block content %} {% block content %}
<h1>{{ shown_user }}</h1> <h1>{{ shown_user }}
<small class="pull-right">
<a href="{% url 'user_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
</small>
</h1>
<p>{{ shown_user.email }}</p> <p>{{ shown_user.email }}</p>
<h2>{% trans "Groups" %}</h2> <h4>{% trans "Groups" %}</h4>
<p> <p>
{% if shown_user.groups.all %} {% if shown_user.groups.all %}
{{ shown_user.groups.all|join:", " }} {{ shown_user.groups.all|join:", " }}
@ -21,32 +25,32 @@
</p> </p>
{% if shown_user.get_gender_display %} {% if shown_user.get_gender_display %}
<h2>{% trans "Gender" %}</h2> <h4>{% trans "Gender" %}</h4>
<p>{{ shown_user.get_gender_display }}</p> <p>{{ shown_user.get_gender_display }}</p>
{% endif %} {% endif %}
{% if shown_user.get_type_display %} {% if shown_user.get_type_display %}
<h2>{% trans "Type" %}</h2> <h4>{% trans "Type" %}</h4>
<p>{{ shown_user.get_type_display }}</p> <p>{{ shown_user.get_type_display }}</p>
{% endif %} {% endif %}
{% if shown_user.committee %} {% if shown_user.committee %}
<h2>{% trans "Committee" %}</h2> <h4>{% trans "Committee" %}</h4>
<p>{{ shown_user.committee }}</p> <p>{{ shown_user.committee }}</p>
{% endif %} {% endif %}
{% if shown_user.about_me %} {% if shown_user.about_me %}
<h2>{% trans "About me" %}</h2> <h4>{% trans "About me" %}</h4>
<p>{{ shown_user.about_me }}</p> <p>{{ shown_user.about_me }}</p>
{% endif %} {% endif %}
{% if perms.participant.can_manage_participant %} {% if perms.participant.can_manage_participant %}
{% if shown_user.comment %} {% if shown_user.comment %}
<h2>{% trans "Comment" %}</h2> <h4>{% trans "Comment" %}</h4>
<p>{{ shown_user.comment }}</p> <p>{{ shown_user.comment }}</p>
{% endif %} {% endif %}
<h2>{% trans "Last Login" %}</h2> <h4>{% trans "Last Login" %}</h4>
{% if shown_user.last_login > shown_user.date_joined %} {% if shown_user.last_login > shown_user.date_joined %}
<p>{{ shown_user.last_login }}</p> <p>{{ shown_user.last_login }}</p>
{% else %} {% else %}

View File

@ -4,17 +4,14 @@
<ul style="line-height: 180%"> <ul style="line-height: 180%">
{% for user in users %} {% for user in users %}
<li class="{% if user.active %}activeline{% endif %}"> <li class="{% if user.active %}activeline{% endif %}">
<a href="{% url 'projector_activate_slide' user.sid %}" class="activate_link {% if user.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' user.sid %}" class="activate_link btn {% if user.active %}btn-primary{% endif %} btn-mini" title="{% trans 'Show' %}">
<div></div> <i class="icon-facetime-video {% if user.active %}icon-white{% endif %}"></i>
</a>&nbsp;
<a href="{% model_url user 'edit' %}" title="{% trans 'Edit' %}" class="btn btn-mini right">
<i class="icon-pencil"></i>
</a> </a>
<a href="{% model_url user 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% url 'projctor_preview_slide' user.sid %}" title="{% trans 'Preview' %}" class="btn btn-mini right">
<span></span> <i class="icon-search"></i>
</a>
<a href="{% model_url user 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url 'projctor_preview_slide' user.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a> </a>
<a href="{% model_url user 'view' %}">{{ user }}</a> <a href="{% model_url user 'view' %}">{{ user }}</a>
</li> </li>

View File

@ -163,8 +163,7 @@ class UserCreateView(CreateView):
model = User model = User
context_object_name = 'edit_user' context_object_name = 'edit_user'
form_class = UserCreateForm form_class = UserCreateForm
success_url = 'user_overview' success_url_name = 'user_overview'
apply_url = 'user_edit'
def manipulate_object(self, form): def manipulate_object(self, form):
self.object.username = gen_username( self.object.username = gen_username(
@ -183,8 +182,7 @@ class UserUpdateView(UpdateView):
model = User model = User
context_object_name = 'edit_user' context_object_name = 'edit_user'
form_class = UserUpdateForm form_class = UserUpdateForm
success_url = 'user_overview' success_url_name = 'user_overview'
apply_url = 'participant_edit'
class UserDeleteView(DeleteView): class UserDeleteView(DeleteView):
@ -193,7 +191,7 @@ class UserDeleteView(DeleteView):
""" """
permission_required = 'participant.can_manage_participant' permission_required = 'participant.can_manage_participant'
model = User model = User
url = 'user_overview' success_url_name = 'user_overview'
def pre_redirect(self, request, *args, **kwargs): def pre_redirect(self, request, *args, **kwargs):
if self.get_object() == self.request.user: if self.get_object() == self.request.user:
@ -208,7 +206,7 @@ class SetUserStatusView(RedirectView, SingleObjectMixin):
""" """
permission_required = 'participant.can_manage_participant' permission_required = 'participant.can_manage_participant'
allow_ajax = True allow_ajax = True
url = 'user_overview' url_name = 'user_overview'
model = User model = User
def pre_redirect(self, request, *args, **kwargs): def pre_redirect(self, request, *args, **kwargs):
@ -400,8 +398,7 @@ class GroupCreateView(CreateView):
context_object_name = 'group' context_object_name = 'group'
model = Group model = Group
form_class = GroupForm form_class = GroupForm
success_url = 'user_group_overview' success_url_name = 'user_group_overview'
apply_url = 'user_group_edit'
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
delete_default_permissions() delete_default_permissions()
@ -417,8 +414,7 @@ class GroupUpdateView(UpdateView):
model = Group model = Group
context_object_name = 'group' context_object_name = 'group'
form_class = GroupForm form_class = GroupForm
success_url = 'user_group_overview' success_url_name = 'user_group_overview'
apply_url = 'user_group_edit'
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
delete_default_permissions() delete_default_permissions()
@ -431,7 +427,7 @@ class GroupDeleteView(DeleteView):
""" """
permission_required = 'participant.can_manage_participant' permission_required = 'participant.can_manage_participant'
model = Group model = Group
url = 'user_group_overview' success_url_name = 'user_group_overview'
def pre_redirect(self, request, *args, **kwargs): def pre_redirect(self, request, *args, **kwargs):
if self.get_object().name.lower() in ['anonymous', 'registered']: if self.get_object().name.lower() in ['anonymous', 'registered']:
@ -447,6 +443,7 @@ class Config(FormView):
permission_required = 'config.can_manage_config' permission_required = 'config.can_manage_config'
form_class = ConfigForm form_class = ConfigForm
template_name = 'participant/config.html' template_name = 'participant/config.html'
success_url_name = 'config_participant'
def get_initial(self): def get_initial(self):
return { return {
@ -507,7 +504,7 @@ def user_settings(request):
form_user = UsersettingsForm(instance=request.user, initial={'language': language}) form_user = UsersettingsForm(instance=request.user, initial={'language': language})
return { return {
'form_user': form_user, 'form': form_user,
'edituser': request.user, 'edituser': request.user,
} }
@ -523,7 +520,7 @@ def user_settings_password(request):
if form.is_valid(): if form.is_valid():
form.save() form.save()
messages.success(request, _('Password successfully changed.')) messages.success(request, _('Password successfully changed.'))
return redirect(reverse('user_settings')) return redirect(reverse('dashboard'))
else: else:
messages.error(request, _('Please check the form for errors.')) messages.error(request, _('Please check the form for errors.'))
else: else:
@ -541,6 +538,7 @@ def register_tab(request):
selected = request.path.startswith('/participant/') selected = request.path.startswith('/participant/')
return Tab( return Tab(
title=_('Participants'), title=_('Participants'),
app='participant',
url=reverse('user_overview'), url=reverse('user_overview'),
permission=( permission=(
request.user.has_perm('participant.can_see_participant') or request.user.has_perm('participant.can_see_participant') or
@ -554,30 +552,30 @@ def get_widgets(request):
group_widget and a personal_info_widget. group_widget and a personal_info_widget.
""" """
return [ return [
get_personal_info_widget(request), #get_personal_info_widget(request),
get_user_widget(request), get_user_widget(request),
get_group_widget(request)] get_group_widget(request)]
def get_personal_info_widget(request): ## def get_personal_info_widget(request):
""" ## """
Provides a widget for personal info. It shows your submitted motions ## Provides a widget for personal info. It shows your submitted motions
and where you are supporter or candidate. ## and where you are supporter or candidate.
""" ## """
personal_info_context = { ## personal_info_context = {
'submitted_motions': Motion.objects.filter(submitter=request.user), ## 'submitted_motions': Motion.objects.filter(submitter=request.user),
'config_motion_min_supporters': config['motion_min_supporters'], ## 'config_motion_min_supporters': config['motion_min_supporters'],
'supported_motions': Motion.objects.filter(motionsupporter=request.user), ## 'supported_motions': Motion.objects.filter(motionsupporter=request.user),
'assignments': Assignment.objects.filter( ## 'assignments': Assignment.objects.filter(
assignmentcandidate__person=request.user, ## assignmentcandidate__person=request.user,
assignmentcandidate__blocked=False)} ## assignmentcandidate__blocked=False)}
return Widget( ## return Widget(
name='personal_info', ## name='personal_info',
display_name=_('My motions and elections'), ## display_name=_('My motions and elections'),
template='participant/personal_info_widget.html', ## template='participant/personal_info_widget.html',
context=personal_info_context, ## context=personal_info_context,
permission_required=None, ## permission_required=None,
default_column=1) ## default_column=1)
def get_user_widget(request): def get_user_widget(request):

View File

@ -12,42 +12,20 @@
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.forms.models import modelform_factory from django.forms.models import modelform_factory
from django.core.exceptions import ImproperlyConfigured
from openslides.utils.views import TemplateView from openslides.utils.views import TemplateView, UrlMixin
class PollFormView(TemplateView): class PollFormView(UrlMixin, TemplateView):
template_name = 'poll/poll.html' poll_class = None
poll_argument = 'poll_id'
def set_poll(self, poll_id): def get(self, request, *args, **kwargs):
poll_id = poll_id self.poll = self.object = self.get_object()
self.poll = self.poll_class.objects.get(pk=poll_id) return super(PollFormView, self).get(request, *args, **kwargs)
def get_context_data(self, **kwargs):
context = super(PollFormView, self).get_context_data(**kwargs)
self.set_poll(self.kwargs['poll_id'])
context['poll'] = self.poll
if 'forms' in kwargs:
context['forms'] = kwargs['forms']
context['pollform'] = kwargs['pollform']
else:
context['forms'] = self.poll.get_vote_forms()
FormClass = self.get_modelform_class()
context['pollform'] = FormClass(instance=self.poll,
prefix='pollform')
return context
def get_success_url(self):
return self.success_url
def get_modelform_class(self):
fields = []
self.poll.append_pollform_fields(fields)
return modelform_factory(self.poll.__class__, fields=fields)
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
self.set_poll(self.kwargs['poll_id']) self.poll = self.object = self.get_object()
option_forms = self.poll.get_vote_forms(data=self.request.POST) option_forms = self.poll.get_vote_forms(data=self.request.POST)
FormClass = self.get_modelform_class() FormClass = self.get_modelform_class()
@ -76,3 +54,32 @@ class PollFormView(TemplateView):
pollform.save() pollform.save()
return HttpResponseRedirect(self.get_success_url()) return HttpResponseRedirect(self.get_success_url())
def get_poll_class(self):
if self.poll_class is not None:
return self.poll_class
else:
raise ImproperlyConfigured(
"No poll class defined. Either provide a poll_class or define"
" a get_poll_class method.")
def get_object(self):
return self.get_poll_class().objects.get(pk=self.kwargs['poll_id'])
def get_context_data(self, **kwargs):
context = super(PollFormView, self).get_context_data(**kwargs)
context['poll'] = self.poll
if 'forms' in kwargs:
context['forms'] = kwargs['forms']
context['pollform'] = kwargs['pollform']
else:
context['forms'] = self.poll.get_vote_forms()
FormClass = self.get_modelform_class()
context['pollform'] = FormClass(instance=self.poll,
prefix='pollform')
return context
def get_modelform_class(self):
fields = []
self.poll.append_pollform_fields(fields)
return modelform_factory(self.poll.__class__, fields=fields)

View File

@ -38,7 +38,9 @@ class ProjectorSlide(models.Model, SlideMixin):
} }
@models.permalink @models.permalink
def get_absolute_url(self, link='delete'): def get_absolute_url(self, link='edit'):
if link == 'edit':
return ('customslide_edit', [str(self.id)])
if link == 'delete': if link == 'delete':
return ('customslide_delete', [str(self.id)]) return ('customslide_delete', [str(self.id)])

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -5,48 +5,30 @@
* :license: GNU GPL, see LICENSE for more details. * :license: GNU GPL, see LICENSE for more details.
*/ */
// function that writes the portlet list order to a cookie // function that writes the widget list order to a cookie
function saveOrder() { function saveOrder() {
$(".column").each(function(index, value){ $(".column").each(function(index, value){
var colid = value.id; var colid = value.id;
var cookieName = "cookie-" + colid; var cookieName = "cookie-" + colid;
// Get the order for this column. // Get the order for this column.
var order = $('#' + colid).sortable("toArray"); var order = $('#' + colid).sortable("toArray");
// For each portlet in the column
for ( var i = 0, n = order.length; i < n; i++ ) {
// Determine if it is 'opened' or 'closed'
var v = $('#' + order[i] ).find('.portlet-content').is(':visible');
// Modify the array we're saving to indicate what's open and
// what's not.
order[i] = order[i] + ":" + v;
}
$.cookie(cookieName, order, { path: "/", expiry: new Date(2012, 1, 1)}); $.cookie(cookieName, order, { path: "/", expiry: new Date(2012, 1, 1)});
}); });
} }
// function that restores the portlet list order from a cookie // function that restores the widget list order from a cookie
function restoreOrder() { function restoreOrder() {
$(".column").each(function(index, value) { $(".column").each(function(index, value) {
var colid = value.id; var colid = value.id;
var cookieName = "cookie-" + colid var cookieName = "cookie-" + colid;
var cookie = $.cookie(cookieName); var cookie = $.cookie(cookieName);
if ( cookie == null ) { return; } if ( cookie == null ) { return; }
var IDs = cookie.split(","); var IDs = cookie.split(",");
for (var i = 0, n = IDs.length; i < n; i++ ) { for (var i = 0, n = IDs.length; i < n; i++ ) {
var toks = IDs[i].split(":"); var widgetID = IDs[i];
if ( toks.length != 2 ) { var widget = $(".column")
continue; .find('#' + widgetID)
}
var portletID = toks[0];
var visible = toks[1]
var portlet = $(".column")
.find('#' + portletID)
.appendTo($('#' + colid)); .appendTo($('#' + colid));
if (visible === 'false') {
portlet.find(".ui-icon").toggleClass("ui-icon-minus");
portlet.find(".ui-icon").toggleClass("ui-icon-plus");
portlet.find(".portlet-content").hide();
}
} }
}); });
} }
@ -57,75 +39,7 @@ $(function() {
stop: function() { saveOrder(); } stop: function() { saveOrder(); }
}); });
$(".portlet") // control the projector view
.addClass("ui-widget ui-widget-content")
.addClass("ui-helper-clearfix ui-corner-all")
.find(".portlet-header")
.addClass("ui-widget-header ui-corner-all")
.prepend('<span class="ui-icon ui-icon-minus"></span>')
.end()
.find(".portlet-content");
restoreOrder();
$(".portlet-header .ui-icon").click(function() {
$(this).toggleClass("ui-icon-minus");
$(this).toggleClass("ui-icon-plus");
$(this).parents(".portlet:first").find(".portlet-content").toggle();
saveOrder(); // This is important
});
if ($.browser.msie) {
if ($.browser.version >= 8.0 && $.browser.version < 9.0)
{
/* scaling bug in IE8.. iframe has to be 4 times bigger */
$( "#iframe" ).css('width', 1024 * 4);
$( "#iframe" ).css('height', 768 * 4);
}
$( "#iframe" ).css('zoom', '0.25');
}
// activate an element to show it on projector
$('.activate_link').click(function(event) {
event.preventDefault();
var link = $(this);
$.ajax({
type: 'GET',
url: $(this).attr('href'),
dataType: 'json',
success: function(data) {
$('.activate_link').removeClass('active');
$('li').removeClass('activeline');
$('div').removeClass('activeline');
link.addClass('active');
link.parent().addClass('activeline');
},
error: function () {
alert("Ajax Error");
}
});
});
$('a.overlay').click(function(event) {
event.preventDefault();
var link = $(this);
$.ajax({
type: 'GET',
url: $(this).attr('href'),
dataType: 'json',
success: function(data) {
if (data['active']) {
$('#' + data['def_name'] + '_active').show();
$('#' + data['def_name'] + '_inactive').hide();
} else {
$('#' + data['def_name'] + '_active').hide();
$('#' + data['def_name'] + '_inactive').show();
}
},
});
});
// control the projector
$('.projector_edit').click(function(event) { $('.projector_edit').click(function(event) {
event.preventDefault(); event.preventDefault();
var link = $(this); var link = $(this);
@ -143,7 +57,6 @@ $(function() {
event.preventDefault(); event.preventDefault();
var link = $(this); var link = $(this);
var requestData = {}; var requestData = {};
if (link.attr('id') == "countdown_set") { if (link.attr('id') == "countdown_set") {
requestData = { "countdown_time" : $( "#countdown_time" ).val() }; requestData = { "countdown_time" : $( "#countdown_time" ).val() };
} }
@ -165,7 +78,8 @@ $(function() {
}); });
}); });
$('.countdown_visible_link').click(function(event) { // activate/deactivate overlay
$('.overlay_activate_link').click(function(event) {
event.preventDefault(); event.preventDefault();
var link = $(this); var link = $(this);
$.ajax({ $.ajax({
@ -173,13 +87,13 @@ $(function() {
url: link.attr('href'), url: link.attr('href'),
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if (data.countdown_visible == "True") { if (data['active']) {
newclass = 'open'; $('#' + data['def_name'] + '_active').show();
$('#' + data['def_name'] + '_inactive').hide();
} else { } else {
newclass = 'closed'; $('#' + data['def_name'] + '_active').hide();
$('#' + data['def_name'] + '_inactive').show();
} }
link.removeClass('closed open').addClass(newclass);
link.attr('href', data.link);
} }
}); });
}); });
@ -190,4 +104,21 @@ $(function() {
$('#overlay_message_text').val(data['overlay_message']); $('#overlay_message_text').val(data['overlay_message']);
} }
}); });
/* comment out this function because '$.browser' has been removed from jquery 1.9, see:
http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/
TODO: use jquery migrate to have $.browser support for IE8;
if ($.browser.msie) {
if ($.browser.version >= 8.0 && $.browser.version < 9.0)
{
// scaling bug in IE8.. iframe has to be 4 times bigger
$( "#iframe" ).css('width', 1024 * 4);
$( "#iframe" ).css('height', 768 * 4);
}
$( "#iframe" ).css('zoom', '0.25');
}
*/
restoreOrder();
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/*! /*!
* jQuery Form Plugin * jQuery Form Plugin
* version: 3.09 (16-APR-2012) * version: 3.26.0-2013.01.28
* @requires jQuery v1.3.2 or later * @requires jQuery v1.5 or later
* *
* Examples and documentation at: http://malsup.com/jquery/form/ * Examples and documentation at: http://malsup.com/jquery/form/
* Project repository: https://github.com/malsup/form * Project repository: https://github.com/malsup/form
@ -165,14 +165,18 @@ $.fn.ajaxSubmit = function(options) {
} }
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
var context = options.context || options; // jQuery 1.4+ supports scope context var context = options.context || this ; // jQuery 1.4+ supports scope context
for (var i=0, max=callbacks.length; i < max; i++) { for (var i=0, max=callbacks.length; i < max; i++) {
callbacks[i].apply(context, [data, status, xhr || $form, $form]); callbacks[i].apply(context, [data, status, xhr || $form, $form]);
} }
}; };
// are there files to upload? // are there files to upload?
var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)
// [value] (issue #113), also see comment:
// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
var fileInputs = $('input[type=file]:enabled[value!=""]', this);
var hasFileInputs = fileInputs.length > 0; var hasFileInputs = fileInputs.length > 0;
var mp = 'multipart/form-data'; var mp = 'multipart/form-data';
var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
@ -181,6 +185,8 @@ $.fn.ajaxSubmit = function(options) {
log("fileAPI :" + fileAPI); log("fileAPI :" + fileAPI);
var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
var jqxhr;
// options.iframe allows user to force iframe mode // options.iframe allows user to force iframe mode
// 06-NOV-09: now defaulting to iframe mode if file input is detected // 06-NOV-09: now defaulting to iframe mode if file input is detected
if (options.iframe !== false && (options.iframe || shouldUseFrame)) { if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
@ -188,20 +194,22 @@ $.fn.ajaxSubmit = function(options) {
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
if (options.closeKeepAlive) { if (options.closeKeepAlive) {
$.get(options.closeKeepAlive, function() { $.get(options.closeKeepAlive, function() {
fileUploadIframe(a); jqxhr = fileUploadIframe(a);
}); });
} }
else { else {
fileUploadIframe(a); jqxhr = fileUploadIframe(a);
} }
} }
else if ((hasFileInputs || multipart) && fileAPI) { else if ((hasFileInputs || multipart) && fileAPI) {
fileUploadXhr(a); jqxhr = fileUploadXhr(a);
} }
else { else {
$.ajax(options); jqxhr = $.ajax(options);
} }
$form.removeData('jqxhr').data('jqxhr', jqxhr);
// clear element array // clear element array
for (var k=0; k < elements.length; k++) for (var k=0; k < elements.length; k++)
elements[k] = null; elements[k] = null;
@ -210,6 +218,22 @@ $.fn.ajaxSubmit = function(options) {
this.trigger('form-submit-notify', [this, options]); this.trigger('form-submit-notify', [this, options]);
return this; return this;
// utility fn for deep serialization
function deepSerialize(extraData){
var serialized = $.param(extraData).split('&');
var len = serialized.length;
var result = [];
var i, part;
for (i=0; i < len; i++) {
// #252; undo param space replacement
serialized[i] = serialized[i].replace(/\+/g,' ');
part = serialized[i].split('=');
// #278; use array instead of object storage, favoring array serializations
result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
}
return result;
}
// XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
function fileUploadXhr(a) { function fileUploadXhr(a) {
var formdata = new FormData(); var formdata = new FormData();
@ -219,9 +243,10 @@ $.fn.ajaxSubmit = function(options) {
} }
if (options.extraData) { if (options.extraData) {
for (var p in options.extraData) var serializedData = deepSerialize(options.extraData);
if (options.extraData.hasOwnProperty(p)) for (i=0; i < serializedData.length; i++)
formdata.append(p, options.extraData[p]); if (serializedData[i])
formdata.append(serializedData[i][0], serializedData[i][1]);
} }
options.data = null; options.data = null;
@ -230,7 +255,7 @@ $.fn.ajaxSubmit = function(options) {
contentType: false, contentType: false,
processData: false, processData: false,
cache: false, cache: false,
type: 'POST' type: method || 'POST'
}); });
if (options.uploadProgress) { if (options.uploadProgress) {
@ -253,26 +278,20 @@ $.fn.ajaxSubmit = function(options) {
} }
s.data = null; s.data = null;
var beforeSend = s.beforeSend; var beforeSend = s.beforeSend;
s.beforeSend = function(xhr, o) { s.beforeSend = function(xhr, o) {
o.data = formdata; o.data = formdata;
if(beforeSend) if(beforeSend)
beforeSend.call(o, xhr, options); beforeSend.call(this, xhr, o);
}; };
$.ajax(s); return $.ajax(s);
} }
// private function for handling file uploads (hat tip to YAHOO!) // private function for handling file uploads (hat tip to YAHOO!)
function fileUploadIframe(a) { function fileUploadIframe(a) {
var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
var useProp = !!$.fn.prop; var useProp = !!$.fn.prop;
var deferred = $.Deferred();
if ($(':input[name=submit],:input[id=submit]', form).length) {
// if there is an input with a name or id of 'submit' then we won't be
// able to invoke the submit fn on the form (at least not x-browser)
alert('Error: Form elements must not have name or id of "submit".');
return;
}
if (a) { if (a) {
// ensure that every serialized input is still enabled // ensure that every serialized input is still enabled
@ -316,6 +335,14 @@ $.fn.ajaxSubmit = function(options) {
var e = (status === 'timeout' ? 'timeout' : 'aborted'); var e = (status === 'timeout' ? 'timeout' : 'aborted');
log('aborting upload... ' + e); log('aborting upload... ' + e);
this.aborted = 1; this.aborted = 1;
try { // #214, #257
if (io.contentWindow.document.execCommand) {
io.contentWindow.document.execCommand('Stop');
}
}
catch(ignore) {}
$io.attr('src', s.iframeSrc); // abort op in progress $io.attr('src', s.iframeSrc); // abort op in progress
xhr.error = e; xhr.error = e;
if (s.error) if (s.error)
@ -340,10 +367,12 @@ $.fn.ajaxSubmit = function(options) {
if (s.global) { if (s.global) {
$.active--; $.active--;
} }
return; deferred.reject();
return deferred;
} }
if (xhr.aborted) { if (xhr.aborted) {
return; deferred.reject();
return deferred;
} }
// add submitting element to data if we know it // add submitting element to data if we know it
@ -426,9 +455,16 @@ $.fn.ajaxSubmit = function(options) {
if (s.extraData) { if (s.extraData) {
for (var n in s.extraData) { for (var n in s.extraData) {
if (s.extraData.hasOwnProperty(n)) { if (s.extraData.hasOwnProperty(n)) {
extraInputs.push( // if using the $.param format that allows for multiple values with the same name
$('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n]) if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
.appendTo(form)[0]); extraInputs.push(
$('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
.appendTo(form)[0]);
} else {
extraInputs.push(
$('<input type="hidden" name="'+n+'">').val(s.extraData[n])
.appendTo(form)[0]);
}
} }
} }
} }
@ -442,7 +478,9 @@ $.fn.ajaxSubmit = function(options) {
io.addEventListener('load', cb, false); io.addEventListener('load', cb, false);
} }
setTimeout(checkState,15); setTimeout(checkState,15);
form.submit(); // just in case form has element with name/id of 'submit'
var submitFn = document.createElement('form').submit;
submitFn.apply(form);
} }
finally { finally {
// reset attrs and remove "extra" input elements // reset attrs and remove "extra" input elements
@ -478,10 +516,12 @@ $.fn.ajaxSubmit = function(options) {
} }
if (e === CLIENT_TIMEOUT_ABORT && xhr) { if (e === CLIENT_TIMEOUT_ABORT && xhr) {
xhr.abort('timeout'); xhr.abort('timeout');
deferred.reject(xhr, 'timeout');
return; return;
} }
else if (e == SERVER_ABORT && xhr) { else if (e == SERVER_ABORT && xhr) {
xhr.abort('server abort'); xhr.abort('server abort');
deferred.reject(xhr, 'error', 'server abort');
return; return;
} }
@ -586,6 +626,7 @@ $.fn.ajaxSubmit = function(options) {
if (status === 'success') { if (status === 'success') {
if (s.success) if (s.success)
s.success.call(s.context, data, 'success', xhr); s.success.call(s.context, data, 'success', xhr);
deferred.resolve(xhr.responseText, 'success', xhr);
if (g) if (g)
$.event.trigger("ajaxSuccess", [xhr, s]); $.event.trigger("ajaxSuccess", [xhr, s]);
} }
@ -594,6 +635,7 @@ $.fn.ajaxSubmit = function(options) {
errMsg = xhr.statusText; errMsg = xhr.statusText;
if (s.error) if (s.error)
s.error.call(s.context, xhr, status, errMsg); s.error.call(s.context, xhr, status, errMsg);
deferred.reject(xhr, 'error', errMsg);
if (g) if (g)
$.event.trigger("ajaxError", [xhr, s, errMsg]); $.event.trigger("ajaxError", [xhr, s, errMsg]);
} }
@ -658,6 +700,8 @@ $.fn.ajaxSubmit = function(options) {
} }
return data; return data;
}; };
return deferred;
} }
}; };
@ -723,9 +767,9 @@ function captureSubmittingElement(e) {
/*jshint validthis:true */ /*jshint validthis:true */
var target = e.target; var target = e.target;
var $el = $(target); var $el = $(target);
if (!($el.is(":submit,input:image"))) { if (!($el.is("[type=submit],[type=image]"))) {
// is this a child element of the submit el? (ex: a span within a button) // is this a child element of the submit el? (ex: a span within a button)
var t = $el.closest(':submit'); var t = $el.closest('[type=submit]');
if (t.length === 0) { if (t.length === 0) {
return; return;
} }
@ -883,19 +927,19 @@ $.fn.fieldSerialize = function(successful) {
* <input name="C" type="radio" value="C2" /> * <input name="C" type="radio" value="C2" />
* </fieldset></form> * </fieldset></form>
* *
* var v = $(':text').fieldValue(); * var v = $('input[type=text]').fieldValue();
* // if no values are entered into the text inputs * // if no values are entered into the text inputs
* v == ['',''] * v == ['','']
* // if values entered into the text inputs are 'foo' and 'bar' * // if values entered into the text inputs are 'foo' and 'bar'
* v == ['foo','bar'] * v == ['foo','bar']
* *
* var v = $(':checkbox').fieldValue(); * var v = $('input[type=checkbox]').fieldValue();
* // if neither checkbox is checked * // if neither checkbox is checked
* v === undefined * v === undefined
* // if both checkboxes are checked * // if both checkboxes are checked
* v == ['B1', 'B2'] * v == ['B1', 'B2']
* *
* var v = $(':radio').fieldValue(); * var v = $('input[type=radio]').fieldValue();
* // if neither radio is checked * // if neither radio is checked
* v === undefined * v === undefined
* // if first radio is checked * // if first radio is checked
@ -996,8 +1040,15 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
else if (tag == 'select') { else if (tag == 'select') {
this.selectedIndex = -1; this.selectedIndex = -1;
} }
else if (t == "file") {
if (/MSIE/.test(navigator.userAgent)) {
$(this).replaceWith($(this).clone());
} else {
$(this).val('');
}
}
else if (includeHidden) { else if (includeHidden) {
// includeHidden can be the valud true, or it can be a selector string // includeHidden can be the value true, or it can be a selector string
// indicating a special test; for example: // indicating a special test; for example:
// $('#myForm').clearForm('.special:hidden') // $('#myForm').clearForm('.special:hidden')
// the above would clean hidden inputs that have the class of 'special' // the above would clean hidden inputs that have the class of 'special'

View File

@ -5,32 +5,71 @@
* :license: GNU GPL, see LICENSE for more details. * :license: GNU GPL, see LICENSE for more details.
*/ */
/* Portlet */ /** Widgets **/
.column { .column {
width: 50%; width: 50%;
float: left; float: left;
padding-bottom: 100px; padding-bottom: 100px;
} }
.portlet { .widget {
margin: 0 10px 10px 0; margin: 0 10px 10px 0;
} }
.portlet-header { .widget-header {
margin: 0.3em; height: 30px;
padding-bottom: 4px; background: #E9E9E9;
padding-left: 0.2em; background:-moz-linear-gradient(top, #FAFAFA 0%, #E9E9E9 100%); /* FF3.6+ */
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#FAFAFA), color-stop(100%,#E9E9E9)); /* Chrome,Safari4+ */
background:-webkit-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); /* Chrome10+,Safari5.1+ */
background:-o-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); /* Opera11.10+ */
background:-ms-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); /* IE10+ */
background:linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9')";
border: 1px solid #D5D5D5;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
} }
.portlet-header .ui-icon { .widget-header h3 {
float: right; padding-left: 7px;
margin: 7px 0;
display: inline-block;
font-size: 14px;
color: #555;
line-height: 18px;
} }
.portlet-content {
padding: 0.4em; .widget-header [class^="icon-"], .widget-header [class*=" icon-"] {
overflow: hidden; display: inline-block;
margin: -2px 0 0 13px;
color: #555;
vertical-align: middle;
} }
.portlet-content li{ .widget-content {
padding: 20px 15px 15px 13px;
background: #FFF;
border: 1px solid #D5D5D5;
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
}
.widget-content li {
padding: 4px 0; padding: 4px 0;
} }
.widget-content .overlay_list li {
padding-bottom: 10px;
}
.widget-content ul {
list-style: none inside none;
margin: 0;
}
.widget-content hr {
margin: 5px 0;
}
.ui-sortable-placeholder { .ui-sortable-placeholder {
border: 1px dotted black; border: 2px dashed #555555;
visibility: visible !important; visibility: visible !important;
height: 50px !important; height: 50px !important;
} }
@ -38,11 +77,12 @@
visibility: hidden; visibility: hidden;
} }
/*.projector_countdown_spinval {*/ .overlay_list .form-inline {
margin: 5px 0 0 31px;
}
#countdown_time { #countdown_time {
width: 40px; width: 40px;
height: 16px;
} }
/* iframe */ /* iframe */
@ -53,18 +93,16 @@
-moz-transform: scale(0.25); -moz-transform: scale(0.25);
-webkit-transform: scale(0.25); -webkit-transform: scale(0.25);
-o-transform: scale(0.25); -o-transform: scale(0.25);
width: 1024px; width: 1024px;
height: 768px; height: 768px;
} }
#iframewrapper { #iframewrapper {
width: 256px;/*100%;*/ width: 256px;/*100%;*/
height: 192px;/*230px;*/ height: 192px;/*230px;*/
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border: 1px solid #D5D5D5;
} }
#iframeoverlay { #iframeoverlay {
width: 256px; width: 256px;
height: 192px; height: 192px;
@ -74,38 +112,3 @@
display: block; display: block;
z-index: 1; z-index: 1;
} }
/* activate link */
a.activate_link div {
background-image: url(../images/icons/accept-grey.png);
background-repeat: no-repeat;
float: left;
width: 16px;
height: 16px;
padding-right: 12px;
position: relative;
top: 4px;
left: 4px;
}
a.activate_link.active div {
background-image: url(../images/icons/accept.png);
}
a.overlay div {
background-image: url(../images/icons/accept-grey.png);
background-repeat: no-repeat;
float: left;
width: 16px;
height: 16px;
padding-right: 16px;
position: relative;
top: 4px;
left: 4px;
}
a.overlay.active div {
background-image: url(../images/icons/accept.png);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Some files were not shown because too many files have changed in this diff Show More