Merge pull request #77 from ostcar/django1.5

Changes for Django1.5
This commit is contained in:
Oskar Hahn 2013-01-04 02:51:20 -08:00
commit bd243313e5
56 changed files with 234 additions and 258 deletions

10
.gitignore vendored
View File

@ -1,18 +1,16 @@
.venv/* .venv/*
openslides/.venv/
*.pyc *.pyc
*.swp *.swp
openslides/settings.py
database.db
*~ *~
extras/website/* settings.py
extras/website-old/* database.sqlite
# Package building
docs/_build/* docs/_build/*
*.egg-info *.egg-info
build/* build/*
dist/* dist/*
.DS_Store .DS_Store
settings.py
versiontools* versiontools*
# Unit test / coverage reports # Unit test / coverage reports

View File

@ -1,9 +1,9 @@
language: python language: python
python: python:
- "2.5"
- "2.6" - "2.6"
- "2.7" - "2.7"
install: install:
- easy_install https://www.djangoproject.com/download/1.5b2/tarball/
- pip install -r requirements.txt --use-mirrors - pip install -r requirements.txt --use-mirrors
- python extras/scripts/create_local_settings.py - python extras/scripts/create_local_settings.py
script: script:

View File

@ -18,7 +18,7 @@ I. Installation on GNU/Linux and MacOSX using the Python Package Index (PyPI)
1. Check requirements: 1. Check requirements:
Make sure that you have installed Python Programming Language 2 Make sure that you have installed Python Programming Language 2
(>= 2.5) on your system. (>= 2.6) on your system.
2. Setup a virtual environment with virtualenv (optional): 2. Setup a virtual environment with virtualenv (optional):
@ -65,7 +65,7 @@ II. Installation on GNU/Linux and MacOSX using the sources
OpenSlides requires following programs, which should be OpenSlides requires following programs, which should be
installed first: installed first:
+ Python Programming Language 2 (>= 2.5) + Python Programming Language 2 (>= 2.6)
+ virtualenv (>= 1.4.1) + virtualenv (>= 1.4.1)
+ ReportLab Toolkit + ReportLab Toolkit
+ Python Imaging Library (PIL) + Python Imaging Library (PIL)
@ -141,7 +141,7 @@ portable version you should run the following install steps.
The OpenSlides install requires following programs, which should be The OpenSlides install requires following programs, which should be
installed first: installed first:
+ Python Programming Language 2 (>= 2.5) + Python Programming Language 2 (>= 2.6)
+ Setuptools + Setuptools
a) Download and run 32bit MSI installer from http://www.python.org/: a) Download and run 32bit MSI installer from http://www.python.org/:

View File

@ -5,15 +5,15 @@
{% load staticfiles %} {% load staticfiles %}
{% block submenu %} {% block submenu %}
{% url item_overview as url_itemoverview %} {% url 'item_overview' as url_itemoverview %}
{% url item_new as url_itemnew %} {% url 'item_new' as url_itemnew %}
<h4 class="sectiontitle">{% trans "Agenda" %}</h4> <h4 class="sectiontitle">{% trans "Agenda" %}</h4>
<ul> <ul>
<li class="{% if request.path == url_itemoverview %}selected{% endif %}"><a href="{% url item_overview %}">{% trans "All items" %}</a></li> <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 %} {% if perms.agenda.can_manage_agenda %}
<li class="{% active request '/agenda/new/' %}"><a href="{% url item_new %}">{% trans "New item" %}</a></li> <li class="{% active request '/agenda/new/' %}"><a href="{% url 'item_new' %}">{% trans "New item" %}</a></li>
{% endif %} {% endif %}
<li><a href="{% url print_agenda %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Agenda as PDF' %}</a></li> <li><a href="{% url 'print_agenda' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Agenda as PDF' %}</a></li>
</ul> </ul>
{# second submenu #} {# second submenu #}
@ -22,20 +22,20 @@
<h3>{{ item.title }}</h3> <h3>{{ item.title }}</h3>
<ul> <ul>
{# view item #} {# view item #}
{% url item_view item.id as url_itemview %} {% 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> <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 %} {% if perms.agenda.can_manage_agenda %}
{# edit item #} {# edit item #}
{% url item_edit item.id as url_itemedit %} {% 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> <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 #} {# delete item #}
<li><a href="{% url item_delete item.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete item' %}</a></li> <li><a href="{% url 'item_delete' item.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete item' %}</a></li>
{% endif %} {% endif %}
{# activate item #} {# activate item #}
{% if perms.projector.can_manage_projector %} {% 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> <li><a href="{% url 'projector_activate_slide' item.sid %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Show item' %}</a></li>
{% endif %} {% endif %}
</ul> </ul>
{% endif %} {% endif %}

View File

@ -12,8 +12,8 @@
<button class="button" type="submit"> <button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span> <span class="icon ok">{% trans 'Save' %}</span>
</button> </button>
<a href='{% url config_agenda %}'> <a href="{% url 'config_agenda' %}">
<button class="button" type="button" onclick="window.location='{% url config_agenda %}'"> <button class="button" type="button" onclick="window.location='{% url 'config_agenda' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -26,8 +26,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url item_overview %}'> <a href="{% url 'item_overview' %}">
<button class="button" type="button" onclick="window.location='{% url item_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'item_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -5,7 +5,7 @@
<td> <td>
<span class="close_link{% if item.closed %} closed{% endif %}"> <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 %}" title="{% trans 'Mark item as done' %}"> <a href="{% if item.closed %}{% url 'item_open' item.id %}{% else %}{% url 'item_close' item.id %}{% endif %}" title="{% trans 'Mark item as done' %}">
<span></span> <span></span>
</a> </a>
{% elif item.closed %} {% elif item.closed %}
@ -32,7 +32,7 @@
<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 class="activate_link {% if item.active %}active{% endif %}" href="{% url 'projector_activate_slide' item.sid %}" title="{% trans 'Activate item' %}">
<span></span> <span></span>
</a> </a>
{% endif %} {% endif %}
@ -40,7 +40,7 @@
<a href="{% model_url item 'edit' %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit item' %}"></a> <a href="{% model_url item 'edit' %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit item' %}"></a>
<a href="{% model_url item 'delete' %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete item' %}"></a> <a href="{% model_url item 'delete' %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete item' %}"></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 class="activate_link" href="{% url 'projector_activate_slide' item.sid 'summary' %}">
<img src="{% static 'images/icons/summary.png' %}" title="{% trans 'Activate summary for this item' %}"> <img src="{% static 'images/icons/summary.png' %}" title="{% trans 'Activate summary for this item' %}">
</a> </a>
{% endif %} {% endif %}

View File

@ -44,7 +44,7 @@
<div id="changed-order-message" style="display:none" class="notification warning"> <div id="changed-order-message" style="display:none" class="notification warning">
<em>{% trans "Do you want to save the changed order of agenda items?" %}<br> <em>{% trans "Do you want to save the changed order of agenda items?" %}<br>
<input type="submit" value="{% trans 'Yes' %}"> <input type="submit" value="{% trans 'Yes' %}">
<input type="button" onclick="window.location.href='{% url item_overview %}';" value="{% trans 'No' %}"> <input type="button" onclick="window.location.href='{% url 'item_overview' %}';" value="{% trans 'No' %}">
</em> </em>
</div> </div>
{% endif %} {% endif %}
@ -83,7 +83,7 @@
<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 class="activate_link{% if active_sid == 'agenda' %} active{% endif %}" href="{% url 'projector_activate_slide' 'agenda' %}" title="{% trans 'Activate item' %}">
<span></span> <span></span>
</a> </a>
</span> </span>

View File

@ -4,10 +4,10 @@
<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 {% if agenda.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<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>
{{ agenda.name }} {{ agenda.name }}
@ -17,7 +17,7 @@
<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 {% if item.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url item 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% model_url item 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
@ -26,11 +26,11 @@
<a href="{% model_url item 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right"> <a href="{% model_url item 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide item.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' item.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <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 right" href="{% url 'projector_activate_slide' item.sid 'summary' %}">
<img src="{% static 'images/icons/summary.png' %}" <img src="{% static 'images/icons/summary.png' %}"
title="{% trans 'Activate summary for this item' %}" title="{% trans 'Activate summary for this item' %}"
style="padding-right: 2px;"> style="padding-right: 2px;">

View File

@ -10,14 +10,14 @@
{% endblock %} {% endblock %}
{% block submenu %} {% block submenu %}
{% url assignment_overview as url_assignment_overview %} {% url 'assignment_overview' as url_assignment_overview %}
<h4 class="sectiontitle">{% trans "Elections" %}</h4> <h4 class="sectiontitle">{% trans "Elections" %}</h4>
<ul> <ul>
<li class="{% if request.path == url_assignment_overview %}selected{% endif %}"><a href="{% url assignment_overview %}">{% trans "All elections" %}</a></li> <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 %} {% if perms.assignment.can_manage_assignment %}
<li class="{% active request '/assignment/new' %}"><a href="{% url assignment_new %}">{% trans "New election" %}</a></li> <li class="{% active request '/assignment/new' %}"><a href="{% url 'assignment_new' %}">{% trans "New election" %}</a></li>
{% endif %} {% endif %}
<li><a href="{% url print_assignment %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'All elections as PDF' %}</a></li> <li><a href="{% url 'print_assignment' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'All elections as PDF' %}</a></li>
</ul> </ul>
{# second submenu #} {# second submenu #}
@ -26,49 +26,49 @@
<h3>{{assignment}}</h3> <h3>{{assignment}}</h3>
<ul> <ul>
{# view assignemnt #} {# view assignemnt #}
{% url assignment_view assignment.id as url_assignmentview %} {% url 'assignment_view' assignment.id as url_assignmentview %}
<li class="{% if request.path == url_assignmentview %}selected{% endif %}"> <li class="{% if request.path == url_assignmentview %}selected{% endif %}">
<a href="{% url assignment_view assignment.id %}">{% trans 'View election' %}</a> <a href="{% url 'assignment_view' assignment.id %}">{% trans 'View election' %}</a>
</li> </li>
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
{# edit assignemnt #} {# edit assignemnt #}
{% url assignment_edit assignment.id as url_assignmentedit %} {% url 'assignment_edit' assignment.id as url_assignmentedit %}
<li class="{% if request.path == url_assignmentedit %}selected{% endif %}"> <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> <a href="{% url 'assignment_edit' assignment.id %}"><img src="{% static 'images/icons/edit.png' %}"> {% trans 'Edit election' %}</a>
</li> </li>
{# delete assignment #} {# delete assignment #}
<li> <li>
<a href="{% url assignment_delete assignment.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete election' %}</a> <a href="{% url 'assignment_delete' assignment.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete election' %}</a>
</li> </li>
{% endif %} {% endif %}
{# PDF #} {# PDF #}
<li> <li>
<a href="{% url print_assignment assignment.id %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Election as PDF' %}</a> <a href="{% url 'print_assignment' assignment.id %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Election as PDF' %}</a>
</li> </li>
{# activate #} {# activate #}
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<li> <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> <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> </li>
{% endif %} {% endif %}
{# agenda #} {# agenda #}
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<li> <li>
<a href="{% url assignment_create_agenda assignment.id %}">{% trans 'New agenda item' %}</a> <a href="{% url 'assignment_create_agenda' assignment.id %}">{% trans 'New agenda item' %}</a>
</li> </li>
{% endif %} {% endif %}
{# polls #} {# polls #}
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
{% for poll in polls %} {% for poll in polls %}
{% url assignment_poll_view poll.id as url_assignmentpollview %} {% 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> <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 %} {% endfor %}
{% endif %} {% endif %}
</ul> </ul>

View File

@ -12,8 +12,8 @@
<button class="button" type="submit"> <button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span> <span class="icon ok">{% trans 'Save' %}</span>
</button> </button>
<a href='{% url config_assignment %}'> <a href="{% url 'config_assignment' %}">
<button class="button" type="button" onclick="window.location='{% url config_assignment %}'"> <button class="button" type="button" onclick="window.location='{% url 'config_assignment' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -28,8 +28,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url assignment_overview %}'> <a href="{% url 'assignment_overview' %}">
<button class="button" type="button" onclick="window.location='{% url assignment_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'assignment_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -30,7 +30,7 @@
{% for assignment in assignments %} {% for assignment in assignments %}
<tr class="{% cycle '' 'odd' %} <tr class="{% cycle '' 'odd' %}
{% 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 %}
{% if assignment.status != 'fin' %} {% if assignment.status != 'fin' %}
@ -42,15 +42,15 @@
<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 class="activate_link {% if assignment.active %}active{% endif %}" href="{% url 'projector_activate_slide' assignment.sid %}" title="{% trans 'Activate election' %}">
<span></span> <span></span>
</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 %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit election' %}"></a>
<a href="{% url assignment_delete assignment.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete election' %}"></a> <a href="{% url 'assignment_delete' assignment.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete election' %}"></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 %}" title="{% trans 'Election as PDF' %}"><img src="{% static 'images/icons/pdf.png' %}"></a>
</span> </span>
</td> </td>
</tr> </tr>

View File

@ -54,8 +54,8 @@
</table> </table>
<p> <p>
<a href='{% url print_assignment_poll poll.id %}'> <a href="{% url 'print_assignment_poll' poll.id %}">
<button class="button" type="button" onclick="window.location='{% url print_assignment_poll poll.id %}'"> <button class="button" type="button" onclick="window.location='{% url 'print_assignment_poll' poll.id %}'">
<span class="icon pdf">{% trans 'Ballot paper as PDF' %}</span> <span class="icon pdf">{% trans 'Ballot paper as PDF' %}</span>
</button> </button>
</a> </a>
@ -68,8 +68,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url assignment_view poll.assignment.id %}'> <a href="{% url 'assignment_view' poll.assignment.id %}">
<button class="button" type="button" onclick="window.location='{% url assignment_view poll.assignment.id %}'"> <button class="button" type="button" onclick="window.location='{% url 'assignment_view' poll.assignment.id %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -19,11 +19,11 @@
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
<div class="box"> <div class="box">
<h4>{% trans "Change status" %}:</h4> <h4>{% trans "Change status" %}:</h4>
<input type="radio" name="status" onclick="window.location.href='{% url assignment_set_status assignment.id 'sea' %}';" <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> {% 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' %}';" <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> {% 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' %}';" <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' %} {% if 'fin' in assignment.status %}checked{% endif %}>{% trans 'Finished' %}
</div> </div>
{% endif %} {% endif %}
@ -41,14 +41,14 @@
{{ 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 %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Remove candidate' %}"></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 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>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -64,13 +64,13 @@
{% 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 %}">
<span class="button"> <span class="button">
<span class="icon removeuser">{% trans 'Withdraw self candidature' %}</span> <span class="icon removeuser">{% trans 'Withdraw self candidature' %}</span>
</span> </span>
</a> </a>
{% else %} {% else %}
<a href='{% url assignment_run assignment.id %}'> <a href="{% url 'assignment_run' assignment.id %}">
<span class="button"> <span class="button">
<span class="icon adduser">{% trans 'Self candidature' %}</span> <span class="icon adduser">{% trans 'Self candidature' %}</span>
</span> </span>
@ -83,7 +83,7 @@
<label>{{ field.label }}:</label> <label>{{ field.label }}:</label>
<nobr>{{ field }} <nobr>{{ field }}
{% if perms.participant.can_see_participant and perms.participant.can_manage_participant %} {% if perms.participant.can_see_participant and perms.participant.can_manage_participant %}
<a href="{% url user_new %}" target="_blank"><img src="{% static 'images/icons/add-user.png' %}" title="{% trans 'Add new participant' %}"></a> <a href="{% url 'user_new' %}" target="_blank"><img src="{% static 'images/icons/add-user.png' %}" title="{% trans 'Add new participant' %}"></a>
{% endif %} {% endif %}
</nobr> </nobr>
{% endfor %} {% endfor %}
@ -103,7 +103,7 @@
<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 href="{% url 'assignment_delother' assignment.id person.person_id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Remove candidate' %}"></a>
</li> </li>
{% empty %} {% empty %}
<li>{% trans "No blocked candidates available." %}</li> <li>{% trans "No blocked candidates available." %}</li>
@ -124,18 +124,18 @@
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
<br> <br>
<a class="publish_link {% if poll.published %}published{% endif %}" <a class="publish_link {% if poll.published %}published{% endif %}"
href="{% url assignment_poll_publish_status poll.id %}" href="{% url 'assignment_poll_publish_status' poll.id %}"
title="{% trans 'Publish/unpublish results' %}"> title="{% trans 'Publish/unpublish results' %}">
<span></span> <span></span>
</a> </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_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> <a href="{% url 'assignment_poll_delete' poll.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete' %}"></a>
{% endif %} {% endif %}
</th> </th>
{% endfor %} {% endfor %}
{% 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" %}
<th> <th>
<a href='{% url assignment_gen_poll assignment.id %}'> <a href="{% url 'assignment_gen_poll' assignment.id %}">
<span class="button"> <span class="button">
<span class="icon statistics">{% trans 'New ballot' %}</span> <span class="icon statistics">{% trans 'New ballot' %}</span>
</span> </span>
@ -149,7 +149,7 @@
<td class="candidate"> <td class="candidate">
{% if candidate in assignment.elected %} {% if candidate in assignment.elected %}
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
<a class="election_link elected" href='{% url assignment_user_not_elected assignment.id candidate.person_id %}'></a> <a class="election_link elected" href="{% url 'assignment_user_not_elected' assignment.id candidate.person_id %}"></a>
{% else %} {% else %}
<a class="elected"> <a class="elected">
<img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}"> <img src="{% static 'images/icons/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
@ -157,7 +157,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
{% if perms.assignment.can_manage_assignment %} {% if perms.assignment.can_manage_assignment %}
<a class="election_link" href='{% url assignment_user_elected assignment.id candidate.person_id %}'></a> <a class="election_link" href="{% url 'assignment_user_elected' assignment.id candidate.person_id %}"></a>
{% endif %} {% endif %}
{% endif %} {% endif %}
{{ candidate }} {{ candidate }}
@ -218,7 +218,7 @@
{% else %} {% else %}
<i>{% trans "No results available." %}</i> <i>{% trans "No results 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><a href="{% url 'assignment_gen_poll' assignment.id %}">
<span class="button"> <span class="button">
<span class="icon statistics">{% trans 'New ballot' %}</span> <span class="icon statistics">{% trans 'New ballot' %}</span>
</span> </span>

View File

@ -5,7 +5,7 @@
<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 {% if assignment.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url assignment 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% model_url assignment 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
@ -14,7 +14,7 @@
<a href="{% model_url assignment 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right"> <a href="{% model_url assignment 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide assignment.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' assignment.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
<a href="{% model_url assignment 'view' %}">{{ assignment }}</a> <a href="{% model_url assignment 'view' %}">{{ assignment }}</a>

View File

@ -55,8 +55,8 @@
<button class="button" type="submit"> <button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span> <span class="icon ok">{% trans 'Save' %}</span>
</button> </button>
<a href='{% url config_general %}'> <a href="{% url 'config_general' %}">
<button class="button" type="button" onclick="window.location='{% url config_general %}'"> <button class="button" type="button" onclick="window.location='{% url 'config_general' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -88,12 +88,12 @@ TEMPLATE_LOADERS = (
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'openslides.participant.middleware.AuthenticationMiddleware', 'openslides.participant.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
) )
ROOT_URLCONF = 'openslides.urls' ROOT_URLCONF = 'openslides.urls'

View File

@ -10,9 +10,6 @@
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
# for python 2.5 support
from __future__ import with_statement
import base64 import base64
import ctypes import ctypes
import optparse import optparse

View File

@ -5,17 +5,17 @@
{% load staticfiles %} {% load staticfiles %}
{% block submenu %} {% block submenu %}
{% url motion_overview as url_motionoverview %} {% url 'motion_overview' as url_motionoverview %}
<h4>{% trans "Motions" %}</h4> <h4>{% trans "Motions" %}</h4>
<ul> <ul>
<li class="{% if request.path == url_motionoverview %}selected{% endif %}"><a href="{% url motion_overview %}">{% trans "All motions" %}</a></li> <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 %} {% 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> <li class="{% active request '/motion/new' %}"><a href="{% url 'motion_new' %}">{% trans "New motion" %}</a></li>
{% endif %} {% endif %}
{% if perms.motion.can_manage_motion %} {% if perms.motion.can_manage_motion %}
<li class="{% active request '/motion/import' %}"><a href="{% url motion_import %}">{% trans 'Import motions' %}</a></li> <li class="{% active request '/motion/import' %}"><a href="{% url 'motion_import' %}">{% trans 'Import motions' %}</a></li>
{% endif %} {% endif %}
<li><a href="{% url print_motions %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'All motions as PDF' %}</a></li> <li><a href="{% url 'print_motions' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'All motions as PDF' %}</a></li>
</ul> </ul>
{# second submenu #} {# second submenu #}
@ -30,35 +30,35 @@
</h3> </h3>
<ul> <ul>
{# view motion #} {# view motion #}
{% url motion_view motion.id as url_motionview %} {% 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> <li class="{% if request.path == url_motionview %}selected{% endif %}"><a href="{% url 'motion_view' motion.id %}">{% trans 'View motion' %}</a></li>
{# edit motion #} {# edit motion #}
{% if "edit" in actions %} {% if "edit" in actions %}
{% url motion_edit motion.id as url_motionedit %} {% 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> <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 %} {% endif %}
{# delete motion #} {# delete motion #}
{% if "delete" in actions %} {% if "delete" in actions %}
<li><a href="{% url motion_delete motion.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete motion' %}</a></li> <li><a href="{% url 'motion_delete' motion.id %}"><img src="{% static 'images/icons/delete.png' %}"> {% trans 'Delete motion' %}</a></li>
{% endif %} {% endif %}
{# PDF #} {# PDF #}
<li><a href="{% url print_motion motion.id %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Motion as PDF' %}</a></li> <li><a href="{% url 'print_motion' motion.id %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'Motion as PDF' %}</a></li>
{# activate and polls #} {# activate and polls #}
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<li> <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> <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> </li>
{% endif %} {% endif %}
{% if perms.motion.can_manage_motion %} {% if perms.motion.can_manage_motion %}
{% for poll in motion.polls %} {% for poll in motion.polls %}
{% url motion_poll_view poll.id as url_motionpollview %} {% 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> <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 %} {% endfor %}
{% endif %} {% endif %}
{# Agenda Item #} {# Agenda Item #}
{% if perms.agenda.can_manage_agenda %} {% if perms.agenda.can_manage_agenda %}
<li> <li>
<a href="{% url motion_create_agenda motion.id %}">{% trans 'New agenda item' %}</a> <a href="{% url 'motion_create_agenda' motion.id %}">{% trans 'New agenda item' %}</a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>

View File

@ -12,8 +12,8 @@
<button class="button" type="submit"> <button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span> <span class="icon ok">{% trans 'Save' %}</span>
</button> </button>
<a href='{% url config_motion %}'> <a href="{% url 'config_motion' %}">
<button class="button" type="button" onclick="window.location='{% url config_motion %}'"> <button class="button" type="button" onclick="window.location='{% url 'config_motion' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -28,8 +28,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url motion_overview %}'> <a href="{% url 'motion_overview' %}">
<button class="button" type="button" onclick="window.location='{% url motion_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'motion_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -25,8 +25,8 @@
<button class="button" type="submit"> <button class="button" type="submit">
<span class="icon import">{% trans 'Import' %}</span> <span class="icon import">{% trans 'Import' %}</span>
</button> </button>
<a href="{% url motion_overview%}"> <a href="{% url 'motion_overview' %}">
<button class="button" type="button" onclick="window.location='{% url motion_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'motion_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -47,7 +47,7 @@
<tr class="{% cycle '' 'odd' %} <tr class="{% cycle '' 'odd' %}
{% if motion.active %}activeline{% endif %}"> {% if motion.active %}activeline{% endif %}">
<td>{% if motion.number %}{{ motion.number }}{% else %}-{% endif %}</td> <td>{% if motion.number %}{{ motion.number }}{% else %}-{% endif %}</td>
<td><a href="{% url motion_view motion.id %}">{{ motion.public_version.title }}</a></td> <td><a href="{% url 'motion_view' motion.id %}">{{ motion.public_version.title }}</a></td>
{% if min_supporters > 0 %} {% if min_supporters > 0 %}
<td>{{ motion.count_supporters }}</td> <td>{{ motion.count_supporters }}</td>
{% endif %} {% endif %}
@ -64,17 +64,17 @@
<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 motion.active %}active{% endif %}" href="{% url projector_activate_slide motion.sid %}" title="{% trans 'Activate motion' %}"> <a class="activate_link {% if motion.active %}active{% endif %}" href="{% url 'projector_activate_slide' motion.sid %}" title="{% trans 'Activate motion' %}">
<span></span> <span></span>
</a> </a>
{% endif %} {% endif %}
{% if perms.motion.can_manage_motion %} {% 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> <a href="{% url 'motion_edit' motion.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit motion' %}"></a>
{% if "delete" in useractions %} {% if "delete" in useractions %}
<a href="{% url motion_delete motion.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete motion' %}"></a> <a href="{% url 'motion_delete' motion.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete motion' %}"></a>
{% endif %} {% endif %}
{% endif %} {% endif %}
<a href="{% url print_motion motion.id %}" title="{% trans 'Motion as PDF' %}"><img src="{% static 'images/icons/pdf.png' %}"></a> <a href="{% url 'print_motion' motion.id %}" title="{% trans 'Motion as PDF' %}"><img src="{% static 'images/icons/pdf.png' %}"></a>
</span> </span>
</td> </td>
</tr> </tr>

View File

@ -40,8 +40,8 @@
{{ post_form }} {{ post_form }}
<p> <p>
<a href='{% url print_motion_poll poll.id %}'> <a href="{% url 'print_motion_poll' poll.id %}">
<button class="button" type="button" onclick="window.location='{% 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> <span class="icon pdf">{% trans 'Ballot paper as PDF' %}</span>
</button> </button>
</a> </a>
@ -54,8 +54,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url motion_view motion.id %}'> <a href="{% url 'motion_view' motion.id %}">
<button class="button" type="button" onclick="window.location='{% 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> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -46,7 +46,7 @@
{% if not polls.exists %} {% if not polls.exists %}
{% if perms.motion.can_manage_motion %} {% if perms.motion.can_manage_motion %}
{% if "genpoll" in actions %} {% if "genpoll" in actions %}
<a href='{% url motion_gen_poll motion.id %}'> <a href="{% url 'motion_gen_poll' motion.id %}">
<span class="button"> <span class="button">
<span class="icon statistics">{% trans 'New vote' %}</span> <span class="icon statistics">{% trans 'New vote' %}</span>
</span> </span>
@ -64,10 +64,10 @@
<li> <li>
{% if perms.motion.can_manage_motion %} {% if perms.motion.can_manage_motion %}
<strong>{{ forloop.counter }}. {% trans "Vote" %} </strong> <strong>{{ forloop.counter }}. {% trans "Vote" %} </strong>
<a class="icon edit" href="{% url motion_poll_view poll.id %}" title="{% trans 'Edit Vote' %}"> <a class="icon edit" href="{% url 'motion_poll_view' poll.id %}" title="{% trans 'Edit Vote' %}">
<span></span> <span></span>
</a> </a>
<a class="icon delete" href="{% url motion_poll_delete poll.id %}" title="{% trans 'Delete Vote' %}"> <a class="icon delete" href="{% url 'motion_poll_delete' poll.id %}" title="{% trans 'Delete Vote' %}">
<span></span> <span></span>
</a> </a>
{% elif poll.has_votes %} {% elif poll.has_votes %}
@ -87,7 +87,7 @@
{% if perms.motion.can_manage_motion %} {% if perms.motion.can_manage_motion %}
{% if forloop.last %} {% if forloop.last %}
{% if "genpoll" in actions %} {% if "genpoll" in actions %}
<a href='{% url motion_gen_poll motion.id %}'> <a href="{% url 'motion_gen_poll' motion.id %}">
<span class="button"><span class="icon statistics">{% trans 'New vote' %}</span></span> <span class="button"><span class="icon statistics">{% trans 'New vote' %}</span></span>
</a> </a>
{% endif %} {% endif %}
@ -95,7 +95,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
{% if perms.motion.can_manage_motion %} {% if perms.motion.can_manage_motion %}
<a href='{% url motion_poll_view poll.id %}'> <a href="{% url 'motion_poll_view' poll.id %}">
<span class="button"><span class="icon statistics">{% trans 'Enter result' %}</span></span> <span class="button"><span class="icon statistics">{% trans 'Enter result' %}</span></span>
</a> </a>
{% endif %} {% endif %}
@ -112,7 +112,7 @@
<p></p> <p></p>
{% if "wit" in actions and user == motion.submitter.user %} {% if "wit" in actions and user == motion.submitter.user %}
<p></p> <p></p>
<a href='{% url motion_set_status motion.id 'wit' %}'> <a href="{% url 'motion_set_status' motion.id 'wit' %}">
<span class="button"><span class="icon revert">{% trans 'Withdraw' %}</span></span> <span class="button"><span class="icon revert">{% trans 'Withdraw' %}</span></span>
</a> </a>
{% endif %} {% endif %}
@ -120,13 +120,13 @@
{% if perms.motion.can_support_motion and min_supporters > 0 %} {% if perms.motion.can_support_motion and min_supporters > 0 %}
{% if "unsupport" in actions %} {% if "unsupport" in actions %}
<p></p> <p></p>
<a href='{% url motion_unsupport motion.id %}'> <a href="{% url 'motion_unsupport' motion.id %}">
<span class="button"><span class="icon remove">{% trans 'Unsupport' %}</span></span> <span class="button"><span class="icon remove">{% trans 'Unsupport' %}</span></span>
</a> </a>
{% endif %} {% endif %}
{% if "support" in actions %} {% if "support" in actions %}
<p></p> <p></p>
<a href='{% url motion_support motion.id %}'> <a href="{% url 'motion_support' motion.id %}">
<span class="button"><span class="icon add">{% trans 'Support' %}</span></span> <span class="button"><span class="icon add">{% trans 'Support' %}</span></span>
</a> </a>
{% endif %} {% endif %}
@ -145,16 +145,16 @@
{% if "pub" in actions or "per" in actions or "nop" in actions or "setnumber" in actions %} {% if "pub" in actions or "per" in actions or "nop" in actions or "setnumber" in actions %}
<h4>{% trans "Formal validation" %}:</h4> <h4>{% trans "Formal validation" %}:</h4>
{% if "pub" in actions %} {% 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> <a href="{% url 'motion_set_status' motion.id 'pub' %}"><span class="button"><span class="icon ok-blue">{% trans 'Publish' %}</span></span></a>
{% endif %} {% endif %}
{% if "per" in actions %} {% if "per" in actions %}
<a href='{% url motion_permit motion.id %}'><span class="button"><span class="icon ok-blue">{% trans 'Permit' %}</span></span></a> <a href="{% url 'motion_permit' motion.id %}"><span class="button"><span class="icon ok-blue">{% trans 'Permit' %}</span></span></a>
{% endif %} {% endif %}
{% if "nop" in actions %} {% 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> <a href="{% url 'motion_notpermit' motion.id %}"><span class="button"><span class="icon reject">{% trans 'Not permit (reject)' %}</span></span></a>
{% endif %} {% endif %}
{% if "setnumber" in actions %} {% 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> <a href="{% url 'motion_set_number' motion.id %}"><span class="button"><span class="icon number">{% trans 'Set number' %}</span></span></a>
{% endif %} {% endif %}
</p> </p>
{% endif %} {% endif %}
@ -163,12 +163,12 @@
{% if "acc" in actions or "rej" in actions %} {% if "acc" in actions or "rej" in actions %}
<h4>{% trans "Result after vote" %}:</h4> <h4>{% trans "Result after vote" %}:</h4>
{% if "acc" in actions %} {% if "acc" in actions %}
<a href='{% url motion_set_status motion.id 'acc' %}'> <a href="{% url 'motion_set_status' motion.id 'acc' %}">
<span class="button"><span class="icon done">{% trans 'Accepted' %}</span></span> <span class="button"><span class="icon done">{% trans 'Accepted' %}</span></span>
</a> </a>
{% endif %} {% endif %}
{% if "rej" in actions %} {% if "rej" in actions %}
<a href='{% url motion_set_status motion.id 'rej' %}'> <a href="{% url 'motion_set_status' motion.id 'rej' %}">
<span class="button"><span class="icon reject">{% trans 'Rejected' %}</span></span> <span class="button"><span class="icon reject">{% trans 'Rejected' %}</span></span>
</a> </a>
{% endif %} {% endif %}
@ -177,22 +177,22 @@
{% if "adj" in actions or "noc" in actions or "com" in actions or "wit" in actions %} {% if "adj" in actions or "noc" in actions or "com" in actions or "wit" in actions %}
<h4>{% trans 'Result after debate' %}:</h4> <h4>{% trans 'Result after debate' %}:</h4>
{% if "adj" in actions %} {% if "adj" in actions %}
<a href='{% url motion_set_status motion.id 'adj' %}'><span class="button">{% trans 'Adjourned' %}</span></a><br> <a href="{% url 'motion_set_status' motion.id 'adj' %}"><span class="button">{% trans 'Adjourned' %}</span></a><br>
{% endif %} {% endif %}
{% if "noc" in actions %} {% if "noc" in actions %}
<a href='{% url motion_set_status motion.id 'noc' %}'><span class="button">{% trans 'Not Concerned' %}</span></a><br> <a href="{% url 'motion_set_status' motion.id 'noc' %}'><span class="button">{% trans 'Not Concerned' %}</span></a><br>
{% endif %} {% endif %}
{% if "com" in actions %} {% if "com" in actions %}
<a href='{% url motion_set_status motion.id 'com' %}'><span class="button">{% trans 'Commited a bill' %}</span></a><br> <a href="{% url 'motion_set_status' motion.id 'com' %}'><span class="button">{% trans 'Commited a bill' %}</span></a><br>
{% endif %} {% endif %}
{% if "wit" in actions %} {% if "wit" in actions %}
<a href='{% url motion_set_status motion.id 'wit' %}'><span class="button">{% trans 'Withdrawed by submitter' %}</span></a> <a href="{% url 'motion_set_status' motion.id 'wit' %}'><span class="button">{% trans 'Withdrawed by submitter' %}</span></a>
{% endif %} {% endif %}
{% endif %} {% endif %}
<p></p> <p></p>
<hr> <hr>
<h4>{% trans "For Administration only:" %}</h4> <h4>{% trans "For Administration only:" %}</h4>
<a href='{% url motion_reset motion.id %}'> <a href="{% url 'motion_reset' motion.id %}">
<span class="button"><span class="icon undo">{% trans 'Reset' %}</span></span> <span class="button"><span class="icon undo">{% trans 'Reset' %}</span></span>
</a> </a>
</div> </div>
@ -216,9 +216,9 @@
{% if motion.public_version != motion.last_version %} {% if motion.public_version != motion.last_version %}
&#8901; &#8901;
{% if version == motion.public_version %} {% 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> {% 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 %} {% else %}
{% trans "This is not the authorized version." %} <a href="{% url motion_view motion.id %}">{% trans "Go to version" %} {{ motion.public_version.aid }}.</a> {% 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 %}
{% endif %} {% endif %}
@ -256,10 +256,10 @@
<img title="{% trans 'Version authorized' %}" src="{% static 'images/icons/accept.png' %}"> <img title="{% trans 'Version authorized' %}" src="{% static 'images/icons/accept.png' %}">
{% else %} {% else %}
{% if perms.motion.can_manage_motion %} {% 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> <a href="{% url 'motion_version_permit' revision.id %}"><img title="{% trans 'Permit Version' %}" src="{% static 'images/icons/accept-grey.png' %}"></a>
{% endif %} {% endif %}
{% if not revision.rejected and revision.id > motion.permitted.id and perms.motion.can_manage_motion %} {% 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> <a href="{% url 'motion_version_reject' revision.id %}"><img title="{% trans 'Reject Version' %}" src="{% static 'images/icons/reject-grey.png' %}"></a>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if revision.rejected %} {% if revision.rejected %}

View File

@ -5,7 +5,7 @@
<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 {% if motion.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url motion 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% model_url motion 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
@ -14,7 +14,7 @@
<a href="{% model_url motion 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right"> <a href="{% model_url motion 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide motion.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' motion.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
<a href="{% model_url motion 'view' %}"> <a href="{% model_url motion 'view' %}">

View File

@ -10,16 +10,10 @@
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
# for python 2.5 support
from __future__ import with_statement
import csv import csv
import os import os
try: from urlparse import parse_qs
from urlparse import parse_qs
except ImportError: # python <= 2.5
from cgi import parse_qs
from reportlab.lib import colors from reportlab.lib import colors
from reportlab.lib.units import cm from reportlab.lib.units import cm

View File

@ -10,9 +10,6 @@
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
# for python 2.5 support
from __future__ import with_statement
from random import choice from random import choice
import csv import csv

View File

@ -13,6 +13,7 @@
from django import forms from django import forms
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from openslides.utils.forms import ( from openslides.utils.forms import (
CssClassMixin, LocalizedModelMultipleChoiceField) CssClassMixin, LocalizedModelMultipleChoiceField)
@ -101,6 +102,8 @@ class GroupForm(forms.ModelForm, CssClassMixin):
class UsersettingsForm(forms.ModelForm, CssClassMixin): class UsersettingsForm(forms.ModelForm, CssClassMixin):
language = forms.ChoiceField(choices=settings.LANGUAGES)
class Meta: class Meta:
model = User model = User
fields = ('username', 'first_name', 'last_name', 'gender', 'email', 'committee', 'about_me') fields = ('username', 'first_name', 'last_name', 'gender', 'email', 'committee', 'about_me')

View File

@ -5,26 +5,26 @@
{% load staticfiles %} {% load staticfiles %}
{% block submenu %} {% block submenu %}
{% url user_overview as url_users %} {% url 'user_overview' as url_users %}
{% url user_new as url_usernew %} {% url 'user_new' as url_usernew %}
{% url user_group_overview as url_usergroups %} {% url 'user_group_overview' as url_usergroups %}
{% url user_import as url_userimport %} {% url 'user_import' as url_userimport %}
<h4 class="sectiontitle">{% trans "Participants" %}</h4> <h4 class="sectiontitle">{% trans "Participants" %}</h4>
<ul> <ul>
{% if perms.participant.can_see_participant %} {% 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> <li class="{% if request.path == url_users %}selected{% endif %}"><a href="{% url 'user_overview' %}">{% trans "All participants" %}</a></li>
{% endif %} {% endif %}
{% if perms.participant.can_manage_participant %} {% if perms.participant.can_manage_participant %}
<li class="{% active request url_usernew %}"><a href="{% url user_new %}">{% trans "New participant" %}</a></li> <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="{% 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="{% 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> <li class="{% if request.path == url_userimport %}selected{% endif %}"><a href="{% url 'user_import' %}"> {% trans 'Import participants' %}</a></li>
{% endif %} {% endif %}
{% if perms.participant.can_see_participant %} {% 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> <li><a href="{% url 'user_print' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'List of participants as PDF' %}</a></li>
{% endif %} {% endif %}
{% if perms.participant.can_manage_participant %} {% 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> <li><a href="{% url 'print_passwords' %}"><img src="{% static 'images/icons/pdf.png' %}"> {% trans 'First time passwords as PDF' %}</a></li>
{% endif %} {% endif %}
</ul> </ul>

View File

@ -12,8 +12,8 @@
<button class="button" type="submit"> <button class="button" type="submit">
<span class="icon ok">{% trans 'Save' %}</span> <span class="icon ok">{% trans 'Save' %}</span>
</button> </button>
<a href='{% url config_participant %}'> <a href="{% url 'config_participant' %}">
<button class="button" type="button" onclick="window.location='{% url config_participant %}'"> <button class="button" type="button" onclick="window.location='{% url 'config_participant' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -23,7 +23,7 @@
{{ form.as_p }} {{ form.as_p }}
{% if edit_user %} {% if edit_user %}
<p> <p>
<a href="{% url user_reset_password edit_user.id %}">{% trans 'Reset to First Password' %}</a> <a href="{% url 'user_reset_password' edit_user.id %}">{% trans 'Reset to First Password' %}</a>
</p> </p>
{% endif %} {% endif %}
<p> <p>
@ -33,8 +33,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url user_overview %}'> <a href='{% url "user_overview" %}'>
<button class="button" type="button" onclick="window.location='{% url user_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'user_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -27,8 +27,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url user_group_overview %}'> <a href='{% url "user_group_overview" %}'>
<button class="button" type="button" onclick="window.location='{% url user_group_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'user_group_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -16,9 +16,9 @@
{% for group in groups %} {% for group in groups %}
<tr class="{% cycle '' 'odd' %}"> <tr class="{% cycle '' 'odd' %}">
<td><a href="{% model_url group 'view' %}">{{ group.name }}</a></td> <td><a href="{% model_url group 'view' %}">{{ group.name }}</a></td>
<td><a href="{% url user_group_edit group.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit group' %}"></a> <td><a href="{% url 'user_group_edit' group.id %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit group' %}"></a>
{% if group.name|lower != 'anonymous' and group.name|lower != 'registered' %} {% if group.name|lower != 'anonymous' and group.name|lower != 'registered' %}
<a href="{% url user_group_delete group.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete group' %}"></a> <a href="{% url 'user_group_delete' group.id %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete group' %}"></a>
{% endif %} {% endif %}
</td> </td>
</tr> </tr>

View File

@ -5,7 +5,7 @@
{% 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 {% if group.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url group 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% model_url group 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
@ -14,7 +14,7 @@
<a href="{% model_url group 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right"> <a href="{% model_url group 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide group.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' group.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
<a href="{% model_url group 'view' %}">{{ group }}</a> <a href="{% model_url group 'view' %}">{{ group }}</a>

View File

@ -23,8 +23,8 @@
<button class="button" type="submit"> <button class="button" 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' %}">
<button class="button" type="button" onclick="window.location='{% url user_overview %}'"> <button class="button" type="button" onclick="window.location='{% url 'user_overview' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -5,7 +5,7 @@
{% block mainmenu %} {% block mainmenu %}
<ul> <ul>
<li class="selected"><a href="{% url user_login %}" title="">{% trans "Login" %}</a></li> <li class="selected"><a href="{% url 'user_login' %}" title="">{% trans "Login" %}</a></li>
</ul> </ul>
{% endblock %} {% endblock %}
@ -41,7 +41,7 @@
$(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 %}">
{% csrf_token %} {% csrf_token %}
<table> <table>
<tr> <tr>
@ -68,7 +68,7 @@
{% if os_enable_anonymous_login %} {% if os_enable_anonymous_login %}
<script> <script>
$("#anonymous_login").live('click', function () { $("#anonymous_login").live('click', function () {
window.location.href = '{% url item_overview %}'; window.location.href = "{% url 'item_overview' %}";
return false; return false;
}); });
</script> </script>

View File

@ -90,19 +90,19 @@
</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 %}"> <a href="{% url 'user_edit' user.id %}">
<img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit participant' %}"> <img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit participant' %}">
</a> </a>
{% if user != request_user %} {% if user != request_user %}
<a href="{% url user_delete user.id %}"> <a href="{% url 'user_delete' user.id %}">
<img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete participant' %}"> <img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete participant' %}">
</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 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 %}>
<span></span> <span></span>
</a> </a>
<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 %}> <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 %}>
<span></span> <span></span>
</a> </a>
{% endif %} {% endif %}

View File

@ -7,8 +7,8 @@
{% block submenu %} {% block submenu %}
<h4 class="sectiontitle">{% trans "User Settings" %}</h4> <h4 class="sectiontitle">{% trans "User Settings" %}</h4>
<ul> <ul>
<li><a href="{% url user_settings %}">{% trans "Personal Settings" %}</a></li> <li><a href="{% url 'user_settings' %}">{% trans "Personal Settings" %}</a></li>
<li class="selected"><a href="{% url password_change %}">{% trans "Password Settings" %}</a></li> <li class="selected"><a href="{% url 'password_change' %}">{% trans "Password Settings" %}</a></li>
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -7,8 +7,8 @@
{% block submenu %} {% block submenu %}
<h4 class="sectiontitle">{% trans "User Settings" %}</h4> <h4 class="sectiontitle">{% trans "User Settings" %}</h4>
<ul> <ul>
<li class="selected"><a href="{% url user_settings %}">{% trans "Personal Settings" %}</a></li> <li class="selected"><a href="{% url 'user_settings' %}">{% trans "Personal Settings" %}</a></li>
<li><a href="{% url password_change %}">{% trans "Password Settings" %}</a></li> <li><a href="{% url 'password_change' %}">{% trans "Password Settings" %}</a></li>
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -4,7 +4,7 @@
<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 {% if user.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url user 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% model_url user 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
@ -13,7 +13,7 @@
<a href="{% model_url user 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right"> <a href="{% model_url user 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide user.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' user.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
<a href="{% model_url user 'view' %}">{{ user }}</a> <a href="{% model_url user 'view' %}">{{ user }}</a>

View File

@ -10,15 +10,8 @@
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
# for python 2.5 support
from __future__ import with_statement
from urllib import urlencode from urllib import urlencode
from urlparse import parse_qs
try:
from urlparse import parse_qs
except ImportError: # python <= 2.5 grab it from cgi
from cgi import parse_qs
from reportlab.lib import colors from reportlab.lib import colors
from reportlab.lib.units import cm from reportlab.lib.units import cm
@ -31,7 +24,7 @@ from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.views import login as django_login from django.contrib.auth.views import login as django_login
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.shortcuts import redirect from django.shortcuts import redirect
from django.utils.translation import ugettext as _, ugettext_lazy from django.utils.translation import ugettext as _, ugettext_lazy, activate
from openslides.utils.pdf import stylesheet from openslides.utils.pdf import stylesheet
from openslides.utils.template import Tab from openslides.utils.template import Tab
@ -503,11 +496,15 @@ def user_settings(request):
form_user = UsersettingsForm(request.POST, instance=request.user) form_user = UsersettingsForm(request.POST, instance=request.user)
if form_user.is_valid(): if form_user.is_valid():
form_user.save() form_user.save()
language = request.LANGUAGE_CODE = \
request.session['django_language'] = form_user.cleaned_data['language']
activate(language)
messages.success(request, _('User settings successfully saved.')) messages.success(request, _('User settings successfully saved.'))
else: else:
messages.error(request, _('Please check the form for errors.')) messages.error(request, _('Please check the form for errors.'))
else: else:
form_user = UsersettingsForm(instance=request.user) language = request.session.get('django_language', request.LANGUAGE_CODE)
form_user = UsersettingsForm(instance=request.user, initial={'language': language})
return { return {
'form_user': form_user, 'form_user': form_user,

View File

@ -7,19 +7,19 @@
{% block title %}{{ block.super}} {% trans 'Dashboard' %} {% endblock %} {% block title %}{{ block.super}} {% trans 'Dashboard' %} {% endblock %}
{% block submenu %} {% block submenu %}
{% url dashboard as url_dashboard %} {% url 'dashboard' as url_dashboard %}
{% url projector_select_widgets as url_select_widget %} {% url 'projector_select_widgets' as url_select_widget %}
<h4 class="sectiontitle">{% trans "Dashboard" %}</h4> <h4 class="sectiontitle">{% trans "Dashboard" %}</h4>
<ul> <ul>
<li{% if request.path == url_dashboard %} class="selected"{% endif %}> <li{% if request.path == url_dashboard %} class="selected"{% endif %}>
<a href="{% url dashboard %}">{% trans 'Overview' %}</a> <a href="{% url 'dashboard' %}">{% trans 'Overview' %}</a>
</li> </li>
<li{% if request.path == url_select_widget %} class="selected"{% endif %}> <li{% if request.path == url_select_widget %} class="selected"{% endif %}>
<a href="{{ url_select_widget }}">{% trans 'Select widgets' %}</a> <a href="{{ url_select_widget }}">{% trans 'Select widgets' %}</a>
</li> </li>
{% if perms.projector.can_see_projector %} {% if perms.projector.can_see_projector %}
<li> <li>
<a href="{% url projector_show %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Projector view' %}</a> <a href="{% url 'projector_show' %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Projector view' %}</a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>

View File

@ -4,16 +4,16 @@
<span class="projector_countdown_spinbox"> <span class="projector_countdown_spinbox">
<input class="projector_countdown_spinval" id="countdown_time" name="countdown_time" type="number" min="0" value="{{ countdown_time }}"> {% trans "s" context "seconds" %} <input class="projector_countdown_spinval" id="countdown_time" name="countdown_time" type="number" min="0" value="{{ countdown_time }}"> {% trans "s" context "seconds" %}
<a id="countdown_set" class="countdown_control" href="{% url countdown_set_default %}" title="{% trans 'Save as default' %}"> <a id="countdown_set" class="countdown_control" href="{% url 'countdown_set_default' %}" title="{% trans 'Save as default' %}">
<img src="{% static 'images/icons/document-save.png' %}" alt="{% url countdown_set_default %}"> <img src="{% static 'images/icons/document-save.png' %}" alt="{% url 'countdown_set_default' %}">
</a> </a>
<a id="countdown_reset" class="countdown_control" href="{% url countdown_reset %}" title="{% trans 'Reset countdown' %}"> <a id="countdown_reset" class="countdown_control" href="{% url 'countdown_reset' %}" title="{% trans 'Reset countdown' %}">
<img src="{% static 'images/icons/skip-backward.png' %}" alt="{% trans 'Reset countdown' %}"> <img src="{% static 'images/icons/skip-backward.png' %}" alt="{% trans 'Reset countdown' %}">
</a> </a>
<a id="countdown_play" class="countdown_control" href="{% url countdown_start %}" title="{% trans 'Start countdown' %}"{% if countdown_state == 'active' %} style="display:none"{% endif %}> <a id="countdown_play" class="countdown_control" href="{% url 'countdown_start' %}" title="{% trans 'Start countdown' %}"{% if countdown_state == 'active' %} style="display:none"{% endif %}>
<img src="{% static 'images/icons/play.png' %}" alt="{% url countdown_start %}"> <img src="{% static 'images/icons/play.png' %}" alt="{% url 'countdown_start' %}">
</a> </a>
<a id="countdown_stop" class="countdown_control" href="{% url countdown_stop %}" title="{% trans 'Stop countdown' %}"{% if countdown_state == 'inactive' or countdown_state == 'paused' or countdown_state == 'expired' %} style="display:none"{% endif %}> <a id="countdown_stop" class="countdown_control" href="{% url 'countdown_stop' %}" title="{% trans 'Stop countdown' %}"{% if countdown_state == 'inactive' or countdown_state == 'paused' or countdown_state == 'expired' %} style="display:none"{% endif %}>
<img src="{% static 'images/icons/pause.png' %}" alt="{% url countdown_stop %}"> <img src="{% static 'images/icons/pause.png' %}" alt="{% url 'countdown_stop' %}">
</a> </a>
</span> </span>

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load tags %} {% load tags %}
<form id="overlay_message" action="{% url projector_overlay_message %}" method="post" style="display:inline">{% csrf_token %} <form id="overlay_message" action="{% url 'projector_overlay_message' %}" method="post" style="display:inline">{% csrf_token %}
<input id="overlay_message_text" name='message_text' type='text' style='width: 40%' value="{% get_config 'projector_message' %}"> <input id="overlay_message_text" name='message_text' type='text' style='width: 40%' value="{% get_config 'projector_message' %}">
<button type="submit" class="button" name='message'> <button type="submit" class="button" name='message'>
<span class="icon ok">{% trans 'Apply' %}</span> <span class="icon ok">{% trans 'Apply' %}</span>

View File

@ -5,10 +5,10 @@
<ul style="line-height: 180%"> <ul style="line-height: 180%">
<li class="{% if welcomepage_is_active %}activeline{% endif %}"> <li class="{% if welcomepage_is_active %}activeline{% endif %}">
<a href="{% url projector_activate_welcomepage %}" class="activate_link {% if welcomepage_is_active %}active{% endif %}"> <a href="{% url 'projector_activate_welcomepage' %}" class="activate_link {% if welcomepage_is_active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% url projctor_preview_welcomepage %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_welcomepage' %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
{% trans 'Welcome Page' %} {% trans 'Welcome Page' %}
@ -18,26 +18,26 @@
<ul style="line-height: 180%"> <ul style="line-height: 180%">
{% for slide in slides %} {% for slide in slides %}
<li class="{% if slide.active %}activeline{% endif %}"> <li class="{% if slide.active %}activeline{% endif %}">
<a href="{% url projector_activate_slide slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}"> <a href="{% url 'projector_activate_slide' slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% url customslide_delete slide.id %}" title="{% trans 'Delete' %}" class="icon delete right"> <a href="{% url 'customslide_delete' slide.id %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span> <span></span>
</a> </a>
<a href="{% url customslide_edit slide.id %}" title="{% trans 'Edit' %}" class="icon edit right"> <a href="{% url 'customslide_edit' slide.id %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide slide.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url 'projctor_preview_slide' slide.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
<a href="{% url customslide_edit slide.id %}">{{ slide }}</a> <a href="{% url 'customslide_edit' slide.id %}">{{ slide }}</a>
</li> </li>
{% empty %} {% empty %}
<li>{% trans 'No items available.' %}</li> <li>{% trans 'No items available.' %}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<a href='{% url customslide_new %}'> <a href='{% url "customslide_new" %}'>
<button class="button" type="button" onclick="window.location='{% url customslide_new %}'"> <button class="button" type="button" onclick="window.location='{% url 'customslide_new' %}'">
<span class="icon add">{% trans 'New slide' %}</span> <span class="icon add">{% trans 'New slide' %}</span>
</button> </button>
</a> </a>

View File

@ -7,23 +7,23 @@
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<div style="float: right;"> <div style="float: right;">
<p> <p>
<a class="projector_edit" href="{% url projector_bigger %}" title="{% trans 'Zoom in' %}"> <a class="projector_edit" href="{% url 'projector_bigger' %}" title="{% trans 'Zoom in' %}">
<img src="{% static 'images/icons/zoom-in.png' %}" /> <img src="{% static 'images/icons/zoom-in.png' %}" />
</a><br> </a><br>
<a class="projector_edit" href="{% url projector_smaller %}" title="{% trans 'Zoom out' %}"> <a class="projector_edit" href="{% url 'projector_smaller' %}" title="{% trans 'Zoom out' %}">
<img src="{% static 'images/icons/zoom-out.png' %}" /> <img src="{% static 'images/icons/zoom-out.png' %}" />
</a> </a>
</p> </p>
<p> <p>
<a class="projector_edit" href="{% url projector_up %}" title="{% trans 'Scroll text up' %}"> <a class="projector_edit" href="{% url 'projector_up' %}" title="{% trans 'Scroll text up' %}">
<img src="{% static 'images/icons/go-up.png' %}" /> <img src="{% static 'images/icons/go-up.png' %}" />
</a><br> </a><br>
<a class="projector_edit" href="{% url projector_down %}" title="{% trans 'Scroll text down' %}"> <a class="projector_edit" href="{% url 'projector_down' %}" title="{% trans 'Scroll text down' %}">
<img src="{% static 'images/icons/go-down.png' %}" /> <img src="{% static 'images/icons/go-down.png' %}" />
</a> </a>
</p> </p>
<p> <p>
<a class="projector_edit" href="{% url projector_clean %}" title="{% trans 'Reset projector view' %}"> <a class="projector_edit" href="{% url 'projector_clean' %}" title="{% trans 'Reset projector view' %}">
<img src="{% static 'images/icons/view-reset.png' %}" /> <img src="{% static 'images/icons/view-reset.png' %}" />
</a> </a>
</p> </p>
@ -31,9 +31,9 @@
{% endif %} {% endif %}
<!-- projector view --> <!-- projector view -->
<a href="{% url projector_show %}" target="_blank"> <a href="{% url 'projector_show' %}" target="_blank">
<div id="iframewrapper"> <div id="iframewrapper">
<iframe id="iframe" src="{% url projector_show %}" frameborder="0"></iframe> <iframe id="iframe" src="{% url 'projector_show' %}" frameborder="0"></iframe>
<div id="iframeoverlay"></div> <div id="iframeoverlay"></div>
</div> </div>
</a> </a>

View File

@ -15,8 +15,8 @@
<button class="button" type="submit" name="apply"> <button class="button" type="submit" name="apply">
<span class="icon apply">{% trans 'Apply' %}</span> <span class="icon apply">{% trans 'Apply' %}</span>
</button> </button>
<a href='{% url dashboard %}'> <a href='{% url "dashboard" %}'>
<button class="button" type="button" onclick="window.location='{% url dashboard %}'"> <button class="button" type="button" onclick="window.location='{% url 'dashboard' %}'">
<span class="icon cancel">{% trans 'Cancel' %}</span> <span class="icon cancel">{% trans 'Cancel' %}</span>
</button> </button>
</a> </a>

View File

@ -4,10 +4,10 @@
<ul> <ul>
{% for overlay in overlays %} {% for overlay in overlays %}
<li> <li>
<a id="{{ overlay.def_name }}_inactive" href="{% url projector_overlay_activate overlay.def_name %}" class="overlay"{% if overlay.active %} style="display:none"{% endif %}> <a id="{{ overlay.def_name }}_inactive" href="{% url 'projector_overlay_activate' overlay.def_name %}" class="overlay"{% if overlay.active %} style="display:none"{% endif %}>
<div></div> <div></div>
</a> </a>
<a id="{{ overlay.def_name }}_active" href="{% url projector_overlay_deactivate overlay.def_name %}" class="overlay active"{% if not overlay.active %} style="display:none"{% endif %}> <a id="{{ overlay.def_name }}_active" href="{% url 'projector_overlay_deactivate' overlay.def_name %}" class="overlay active"{% if not overlay.active %} style="display:none"{% endif %}>
<div></div> <div></div>
</a> </a>

View File

@ -12,7 +12,7 @@
<link rel="shortcut icon" href="{% static 'images/favicon.png' %}" type="image/png" /> <link rel="shortcut icon" href="{% static 'images/favicon.png' %}" type="image/png" />
<script type="text/javascript" src="{% static 'javascript/jquery.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/jquery.js' %}"></script>
<script type="text/javascript" src="{% static 'javascript/utils.js' %}"></script> <script type="text/javascript" src="{% static 'javascript/utils.js' %}"></script>
<script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script> <script type="text/javascript" src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
{% block header %} {% block header %}
{% endblock %} {% endblock %}
</head> </head>
@ -24,12 +24,12 @@
<div id="header_userprofile"> <div id="header_userprofile">
<ul> <ul>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li>|<a href="{% url user_logout %}">{% trans "Logout" %}</a></li> <li>|<a href="{% url 'user_logout' %}">{% trans "Logout" %}</a></li>
{% url user_settings as url_usersettings %} {% url 'user_settings' as url_usersettings %}
<li>|<a href="{% url user_settings %}">{% if request.path == url_usersettings %}<strong>{% endif %}{% trans "User Settings" %}{% if request.path == url_usersettings %}</strong>{% endif %}</a></li> <li>|<a href="{% url 'user_settings' %}">{% if request.path == url_usersettings %}<strong>{% endif %}{% trans "User Settings" %}{% if request.path == url_usersettings %}</strong>{% endif %}</a></li>
<li>{% trans "Welcome" %}, <strong>{{ user.username }}</strong></li> <li>{% trans "Welcome" %}, <strong>{{ user.username }}</strong></li>
{% else %} {% else %}
<li><a href="{% url user_login %}">{% trans "Login" %}</a></li> <li><a href="{% url 'user_login' %}">{% trans "Login" %}</a></li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>

View File

@ -1,8 +1,8 @@
import json
from django.db import models from django.db import models
from django.core.serializers.json import DjangoJSONEncoder from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson as json
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field from django.forms.fields import Field
from django.forms.util import ValidationError as FormValidationError from django.forms.util import ValidationError as FormValidationError

View File

@ -21,8 +21,7 @@ from reportlab.rl_config import defaultPageSize
from django.conf import settings from django.conf import settings
from django.utils import formats from django.utils import formats
# Import gettext for python 2.5 support from django.utils.translation import ugettext as _
from django.utils.translation import ugettext as _, gettext
from openslides.config.models import config from openslides.config.models import config

View File

@ -11,11 +11,7 @@
""" """
import sys import sys
import json
try:
import json
except ImportError: # For python 2.5 support
import simplejson as json
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission

View File

@ -10,11 +10,7 @@
:license: GNU GPL, see LICENSE for more details. :license: GNU GPL, see LICENSE for more details.
""" """
try: import json
import json
except ImportError:
# for python 2.5 support
import simplejson as json
try: try:
from cStringIO import StringIO from cStringIO import StringIO

View File

@ -1,8 +1,7 @@
Django==1.4.2 Django==1.5b2
django-mptt django-mptt==0.5.5
reportlab reportlab==2.6
PIL PIL==1.1.7
simplejson coverage==3.6b1
coverage django-discover-runner==0.2.2
django-discover-runner pep8==1.3.3
pep8