From 681d909fa383e583abf67d6d31599aeced393118 Mon Sep 17 00:00:00 2001
From: Oskar Hahn
Date: Wed, 24 Oct 2012 11:04:23 +0200
Subject: [PATCH] rename application to motion
---
.../application/base_application.html | 66 --
.../templates/application/widget.html | 34 -
openslides/application/urls.py | 141 ----
openslides/assignment/models.py | 2 +-
openslides/config/views.py | 2 +-
.../{application => motion}/__init__.py | 0
openslides/{application => motion}/forms.py | 32 +-
openslides/{application => motion}/models.py | 188 +++---
.../motion/templates/motion/base_motion.html | 66 ++
.../templates/motion}/config.html | 8 +-
.../templates/motion}/edit.html | 10 +-
.../templates/motion}/import.html | 6 +-
.../templates/motion}/overview.html | 38 +-
.../templates/motion}/poll_view.html | 16 +-
.../templates/motion}/view.html | 106 +--
.../motion/templates/motion/widget.html | 34 +
.../templates/projector/Motion.html} | 28 +-
openslides/{application => motion}/tests.py | 12 +-
openslides/motion/urls.py | 141 ++++
openslides/{application => motion}/views.py | 606 +++++++++---------
openslides/openslides_global_settings.py | 2 +-
.../templates/participant/config.html | 4 +-
openslides/urls.py | 2 +-
openslides/utils/templatetags/tags.py | 2 +-
24 files changed, 773 insertions(+), 773 deletions(-)
delete mode 100644 openslides/application/templates/application/base_application.html
delete mode 100644 openslides/application/templates/application/widget.html
delete mode 100644 openslides/application/urls.py
rename openslides/{application => motion}/__init__.py (100%)
rename openslides/{application => motion}/forms.py (77%)
rename openslides/{application => motion}/models.py (73%)
create mode 100644 openslides/motion/templates/motion/base_motion.html
rename openslides/{application/templates/application => motion/templates/motion}/config.html (67%)
rename openslides/{application/templates/application => motion/templates/motion}/edit.html (83%)
rename openslides/{application/templates/application => motion/templates/motion}/import.html (89%)
rename openslides/{application/templates/application => motion/templates/motion}/overview.html (71%)
rename openslides/{application/templates/application => motion/templates/motion}/poll_view.html (79%)
rename openslides/{application/templates/application => motion/templates/motion}/view.html (64%)
create mode 100644 openslides/motion/templates/motion/widget.html
rename openslides/{application/templates/projector/Application.html => motion/templates/projector/Motion.html} (74%)
rename openslides/{application => motion}/tests.py (77%)
create mode 100644 openslides/motion/urls.py
rename openslides/{application => motion}/views.py (54%)
diff --git a/openslides/application/templates/application/base_application.html b/openslides/application/templates/application/base_application.html
deleted file mode 100644
index c886215ef..000000000
--- a/openslides/application/templates/application/base_application.html
+++ /dev/null
@@ -1,66 +0,0 @@
-{% extends "base.html" %}
-
-{% load tags %}
-{% load i18n %}
-{% load staticfiles %}
-
-{% block submenu %}
- {% url application_overview as url_applicationoverview %}
- {% trans "Motions" %}
-
-
- {# second submenu #}
- {% if application %}
-
- {% trans "Application No." %}
- {% if application.number != None %}
- {{ application.number }}
- {% else %}
- [-]
- {% endif %}
-
-
- {% endif %}
-{% endblock %}
diff --git a/openslides/application/templates/application/widget.html b/openslides/application/templates/application/widget.html
deleted file mode 100644
index e41c7b370..000000000
--- a/openslides/application/templates/application/widget.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{% load staticfiles %}
-{% load i18n %}
-{% load tags %}
-
-
-{% for application in applications %}
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ application.public_version.title }}
-
- ({% trans "motion" %}
- {% if application.number %}
- {{ application.number }})
- {% else %}
- [{% trans "no number" %}])
- {% endif %}
-
-{% empty %}
- - {% trans 'No motion available.' %}
-{% endfor %}
-
-
diff --git a/openslides/application/urls.py b/openslides/application/urls.py
deleted file mode 100644
index 3b3e83e9e..000000000
--- a/openslides/application/urls.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
- openslides.application.urls
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- URL list for the application app.
-
- :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
- :license: GNU GPL, see LICENSE for more details.
-"""
-
-from django.conf.urls.defaults import url, patterns
-
-from openslides.application.views import (ApplicationDelete, ViewPoll,
- ApplicationPDF, ApplicationPollPDF, CreateAgendaItem)
-
-urlpatterns = patterns('openslides.application.views',
- url(r'^$',
- 'overview',
- name='application_overview',
- ),
-
- url(r'^(?P\d+)/$',
- 'view',
- name='application_view',
- ),
-
- url(r'^(?P\d+)/agenda/$',
- CreateAgendaItem.as_view(),
- name='application_create_agenda',
- ),
-
- url(r'^(?P\d+)/newest/$',
- 'view',
- {'newest': True},
- name='application_view_newest',
- ),
-
- url(r'^new/$',
- 'edit',
- name='application_new',
- ),
-
- url(r'^import/$',
- 'application_import',
- name='application_import',
- ),
-
- url(r'^(?P\d+)/edit/$',
- 'edit',
- name='application_edit',
- ),
-
- url(r'^(?P\d+)/del/$',
- ApplicationDelete.as_view(),
- name='application_delete',
- ),
-
- url(r'^del/$',
- ApplicationDelete.as_view(),
- { 'application_id' : None , 'application_ids' : None },
- name='application_delete',
- ),
-
- url(r'^(?P\d+)/setnumber/$',
- 'set_number',
- name='application_set_number',
- ),
-
- url(r'^(?P\d+)/setstatus/(?P[a-z]{3})/$',
- 'set_status',
- name='application_set_status',
- ),
-
- url(r'^(?P\d+)/permit/$',
- 'permit',
- name='application_permit',
- ),
-
- url(r'^version/(?P\d+)/permit/$',
- 'permit_version',
- name='application_version_permit',
- ),
-
- url(r'^version/(?P\d+)/reject/$',
- 'reject_version',
- name='application_version_reject',
- ),
-
- url(r'^(?P\d+)/notpermit/$',
- 'notpermit',
- name='application_notpermit',
- ),
-
- url(r'^(?P\d+)/reset/$',
- 'reset',
- name='application_reset',
- ),
-
- url(r'^(?P\d+)/support/$',
- 'support',
- name='application_support',
- ),
-
- url(r'^(?P\d+)/unsupport/$',
- 'unsupport',
- name='application_unsupport',
- ),
-
- url(r'^(?P\d+)/gen_poll/$',
- 'gen_poll',
- name='application_gen_poll',
- ),
-
- url(r'^print/$',
- ApplicationPDF.as_view(),
- {'application_id': None},
- name='print_applications',
- ),
-
- url(r'^(?P\d+)/print/$',
- ApplicationPDF.as_view(),
- name='print_application',
- ),
-
- url(r'^poll/(?P\d+)/print/$',
- ApplicationPollPDF.as_view(),
- name='print_application_poll',
- ),
-
- url(r'^poll/(?P\d+)/$',
- ViewPoll.as_view(),
- name='application_poll_view',
- ),
-
- url(r'^poll/(?P\d+)/del/$',
- 'delete_poll',
- name='application_poll_delete',
- ),
-)
diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py
index 19c9886bf..af67411a6 100644
--- a/openslides/assignment/models.py
+++ b/openslides/assignment/models.py
@@ -218,7 +218,7 @@ class Assignment(models.Model, SlideMixin):
return self.name
def delete(self):
- # Remove any Agenda-Item, which is related to this application.
+ # Remove any Agenda-Item, which is related to this assignment.
for item in Item.objects.filter(related_sid=self.sid):
item.delete()
super(Assignment, self).delete()
diff --git a/openslides/config/views.py b/openslides/config/views.py
index fc2d5037e..19b7b9953 100644
--- a/openslides/config/views.py
+++ b/openslides/config/views.py
@@ -67,7 +67,7 @@ class GeneralConfig(FormView):
anonymous = Group.objects.get(name='Anonymous')
except Group.DoesNotExist:
default_perms = [u'can_see_agenda', u'can_see_projector',
- u'can_see_application', u'can_see_assignment']
+ u'can_see_motion', u'can_see_assignment']
anonymous = Group()
anonymous.name = 'Anonymous'
anonymous.save()
diff --git a/openslides/application/__init__.py b/openslides/motion/__init__.py
similarity index 100%
rename from openslides/application/__init__.py
rename to openslides/motion/__init__.py
diff --git a/openslides/application/forms.py b/openslides/motion/forms.py
similarity index 77%
rename from openslides/application/forms.py
rename to openslides/motion/forms.py
index a6cc0bfad..cf144feec 100644
--- a/openslides/application/forms.py
+++ b/openslides/motion/forms.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
- openslides.application.forms
+ openslides.motion.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Forms for the application app.
+ Forms for the motion app.
:copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
@@ -15,36 +15,36 @@ from django.utils.translation import ugettext_lazy as _, ugettext_noop
from openslides.utils.forms import CssClassMixin
from openslides.utils.person import PersonFormField, MultiplePersonFormField
-from openslides.application.models import Application
+from openslides.motion.models import Motion
-class ApplicationForm(forms.Form, CssClassMixin):
+class MotionForm(forms.Form, CssClassMixin):
title = forms.CharField(widget=forms.TextInput(), label=_("Title"))
text = forms.CharField(widget=forms.Textarea(), label=_("Text"))
reason = forms.CharField(widget=forms.Textarea(), required=False,
label=_("Reason"))
-class ApplicationFormTrivialChanges(ApplicationForm):
+class MotionFormTrivialChanges(MotionForm):
trivial_change = forms.BooleanField(required=False,
label=_("Trivial change"),
help_text=_("Trivial changes don't create a new version."))
-class ApplicationManagerForm(forms.ModelForm, CssClassMixin):
+class MotionManagerForm(forms.ModelForm, CssClassMixin):
submitter = PersonFormField()
class Meta:
- model = Application
+ model = Motion
exclude = ('number', 'status', 'permitted', 'log', 'supporter')
-class ApplicationManagerFormSupporter(ApplicationManagerForm):
+class MotionManagerFormSupporter(MotionManagerForm):
# TODO: Do not show the submitter in the user-list
supporter = MultiplePersonFormField(required=False, label=_("Supporters"))
-class ApplicationImportForm(forms.Form, CssClassMixin):
+class MotionImportForm(forms.Form, CssClassMixin):
csvfile = forms.FileField(
widget=forms.FileInput(attrs={'size':'50'}),
label=_("CSV File"),
@@ -58,7 +58,7 @@ class ApplicationImportForm(forms.Form, CssClassMixin):
class ConfigForm(forms.Form, CssClassMixin):
- application_min_supporters = forms.IntegerField(
+ motion_min_supporters = forms.IntegerField(
widget=forms.TextInput(attrs={'class':'small-input'}),
label=_("Number of (minimum) required supporters for a motion"),
initial=4,
@@ -66,12 +66,12 @@ class ConfigForm(forms.Form, CssClassMixin):
max_value=8,
help_text=_("Choose 0 to disable the supporting system"),
)
- application_preamble = forms.CharField(
+ motion_preamble = forms.CharField(
widget=forms.TextInput(),
required=False,
label=_("Motion preamble")
)
- application_pdf_ballot_papers_selection = forms.ChoiceField(
+ motion_pdf_ballot_papers_selection = forms.ChoiceField(
widget=forms.Select(),
required=False,
label=_("Number of ballot papers (selection)"),
@@ -81,24 +81,24 @@ class ConfigForm(forms.Form, CssClassMixin):
("CUSTOM_NUMBER", _("Use the following custom number")),
]
)
- application_pdf_ballot_papers_number = forms.IntegerField(
+ motion_pdf_ballot_papers_number = forms.IntegerField(
widget=forms.TextInput(attrs={'class':'small-input'}),
required=False,
min_value=1,
label=_("Custom number of ballot papers")
)
- application_pdf_title = forms.CharField(
+ motion_pdf_title = forms.CharField(
widget=forms.TextInput(),
required=False,
label=_("Title for PDF document (all motions)")
)
- application_pdf_preamble = forms.CharField(
+ motion_pdf_preamble = forms.CharField(
widget=forms.Textarea(),
required=False,
label=_("Preamble text for PDF document (all motions)")
)
- application_allow_trivial_change = forms.BooleanField(
+ motion_allow_trivial_change = forms.BooleanField(
label=_("Allow trivial changes"),
help_text=_('Warning: Trivial changes undermine the motions '
'autorisation system.'),
diff --git a/openslides/application/models.py b/openslides/motion/models.py
similarity index 73%
rename from openslides/application/models.py
rename to openslides/motion/models.py
index bac0f47f0..4a06dc492 100644
--- a/openslides/application/models.py
+++ b/openslides/motion/models.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
- openslides.application.models
+ openslides.motion.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Models for the application app.
+ Models for the motion app.
:copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
@@ -34,13 +34,13 @@ from openslides.projector.models import SlideMixin
from openslides.agenda.models import Item
-class ApplicationSupporter(models.Model):
- application = models.ForeignKey("Application")
+class MotionSupporter(models.Model):
+ motion = models.ForeignKey("Motion")
person = PersonField()
-class Application(models.Model, SlideMixin):
- prefix = "application"
+class Motion(models.Model, SlideMixin):
+ prefix = "motion"
STATUS = (
('pub', _('Published')),
('per', _('Permitted')),
@@ -74,10 +74,10 @@ class Application(models.Model, SlideMixin):
@property
def last_version(self):
"""
- Return last version of the application.
+ Return last version of the motion.
"""
try:
- return AVersion.objects.filter(application=self).order_by('id') \
+ return AVersion.objects.filter(motion=self).order_by('id') \
.reverse()[0]
except IndexError:
return None
@@ -85,7 +85,7 @@ class Application(models.Model, SlideMixin):
@property
def public_version(self):
"""
- Return permitted, if the application was permitted, else last_version
+ Return permitted, if the motion was permitted, else last_version
"""
if self.permitted is not None:
return self.permitted
@@ -115,14 +115,14 @@ class Application(models.Model, SlideMixin):
@property
def versions(self):
"""
- Return a list of all versions of the application.
+ Return a list of all versions of the motion.
"""
- return AVersion.objects.filter(application=self)
+ return AVersion.objects.filter(motion=self)
@property
def creation_time(self):
"""
- Return the time of the creation of the application.
+ Return the time of the creation of the motion.
"""
try:
return self.versions[0].time
@@ -132,7 +132,7 @@ class Application(models.Model, SlideMixin):
@property
def notes(self):
"""
- Return some information of the application.
+ Return some information of the motion.
"""
note = []
if self.status == "pub" and not self.enough_supporters:
@@ -146,9 +146,9 @@ class Application(models.Model, SlideMixin):
@property
def unpermitted_changes(self):
"""
- Return True if the application has unpermitted changes.
+ Return True if the motion has unpermitted changes.
- The application has unpermitted changes, if the permitted-version
+ The motion has unpermitted changes, if the permitted-version
is not the lastone and the lastone is not rejected.
TODO: rename the property in unchecked__changes
"""
@@ -160,35 +160,35 @@ class Application(models.Model, SlideMixin):
@property
def supporters(self):
- for object in self.applicationsupporter_set.all():
+ for object in self.motionsupporter_set.all():
yield object.person
def is_supporter(self, person):
try:
- return self.applicationsupporter_set.filter(person=person).exists()
+ return self.motionsupporter_set.filter(person=person).exists()
except AttributeError:
return False
@property
def enough_supporters(self):
"""
- Return True, if the application has enough supporters
+ Return True, if the motion has enough supporters
"""
- min_supporters = int(config['application_min_supporters'])
+ min_supporters = int(config['motion_min_supporters'])
if self.status == "pub":
return self.count_supporters() >= min_supporters
else:
return True
def count_supporters(self):
- return self.applicationsupporter_set.count()
+ return self.motionsupporter_set.count()
@property
def missing_supporters(self):
"""
Return number of missing supporters
"""
- min_supporters = int(config['application_min_supporters'])
+ min_supporters = int(config['motion_min_supporters'])
delta = min_supporters - self.count_supporters()
if delta > 0:
return delta
@@ -197,9 +197,9 @@ class Application(models.Model, SlideMixin):
def save(self, user=None, nonewversion=False, trivial_change=False):
"""
- Save the Application, and create a new AVersion if necessary
+ Save the Motion, and create a new AVersion if necessary
"""
- super(Application, self).save()
+ super(Motion, self).save()
if nonewversion:
return
last_version = self.last_version
@@ -229,14 +229,14 @@ class Application(models.Model, SlideMixin):
version = AVersion(title=getattr(self, 'title', ''),
text=getattr(self, 'text', ''),
reason=getattr(self, 'reason', ''),
- application=self)
+ motion=self)
version.save()
self.writelog(_("Version %s created") % version.aid, user)
- is_manager = user.has_perm('application.can_manage_application')
+ is_manager = user.has_perm('motion.can_manage_motion')
except AttributeError:
is_manager = False
- supporters = self.applicationsupporter_set.all()
+ supporters = self.motionsupporter_set.all()
if (self.status == "pub"
and supporters
and not is_manager):
@@ -245,7 +245,7 @@ class Application(models.Model, SlideMixin):
def reset(self, user):
"""
- Reset the application.
+ Reset the motion.
"""
self.status = "pub"
self.permitted = None
@@ -254,43 +254,43 @@ class Application(models.Model, SlideMixin):
def support(self, person):
"""
- Add a Supporter to the list of supporters of the application.
+ Add a Supporter to the list of supporters of the motion.
"""
if person == self.submitter:
# TODO: Use own Exception
raise NameError('Supporter can not be the submitter of a ' \
- 'application.')
+ 'motion.')
if self.permitted is not None:
# TODO: Use own Exception
- raise NameError('This application is already permitted.')
+ raise NameError('This motion is already permitted.')
if not self.is_supporter(person):
- ApplicationSupporter(application=self, person=person).save()
+ MotionSupporter(motion=self, person=person).save()
self.writelog(_("Supporter: +%s") % (person))
def unsupport(self, person):
"""
- remove a supporter from the list of supporters of the application
+ remove a supporter from the list of supporters of the motion
"""
if self.permitted is not None:
# TODO: Use own Exception
- raise NameError('This application is already permitted.')
+ raise NameError('This motion is already permitted.')
try:
- object = self.applicationsupporter_set.get(person=person).delete()
- except ApplicationSupporter.DoesNotExist:
+ object = self.motionsupporter_set.get(person=person).delete()
+ except MotionSupporter.DoesNotExist:
pass
else:
self.writelog(_("Supporter: -%s") % (person))
def set_number(self, number=None, user=None):
"""
- Set a number for ths application.
+ Set a number for ths motion.
"""
if self.number is not None:
# TODO: Use own Exception
- raise NameError('This application has already a number.')
+ raise NameError('This motion has already a number.')
if number is None:
try:
- number = Application.objects.aggregate(Max('number')) \
+ number = Motion.objects.aggregate(Max('number')) \
['number__max'] + 1
except TypeError:
number = 1
@@ -301,7 +301,7 @@ class Application(models.Model, SlideMixin):
def permit(self, user=None):
"""
- Change the status of this application to permit.
+ Change the status of this motion to permit.
"""
self.set_status(user, "per")
aversion = self.last_version
@@ -314,7 +314,7 @@ class Application(models.Model, SlideMixin):
def notpermit(self, user=None):
"""
- Change the status of this application to 'not permitted (rejected)'.
+ Change the status of this motion to 'not permitted (rejected)'.
"""
self.set_status(user, "nop")
#TODO: reject last version
@@ -327,10 +327,10 @@ class Application(models.Model, SlideMixin):
def set_status(self, user, status, force=False):
"""
- Set the status of the application.
+ Set the status of the motion.
"""
error = True
- for a, b in Application.STATUS:
+ for a, b in Motion.STATUS:
if status == a:
error = False
break
@@ -364,25 +364,25 @@ class Application(models.Model, SlideMixin):
"""
actions = []
- # check if user allowed to withdraw an application
+ # check if user allowed to withdraw an motion
if ((self.status == "pub"
and self.number
and user == self.submitter)
or (self.status == "pub"
and self.number
- and user.has_perm("application.can_manage_application"))
+ and user.has_perm("motion.can_manage_motion"))
or (self.status == "per"
and user == self.submitter)
or (self.status == "per"
- and user.has_perm("application.can_manage_application"))):
+ and user.has_perm("motion.can_manage_motion"))):
actions.append("wit")
- #Check if the user can review the application
+ #Check if the user can review the motion
if (self.status == "rev"
and (self.submitter == user
- or user.has_perm("application.can_manage_application"))):
+ or user.has_perm("motion.can_manage_motion"))):
actions.append("pub")
- # Check if the user can support and unspoort the application
+ # Check if the user can support and unspoort the motion
if (self.status == "pub"
and user != self.submitter
and not self.is_supporter(user)):
@@ -391,22 +391,22 @@ class Application(models.Model, SlideMixin):
if self.status == "pub" and self.is_supporter(user):
actions.append("unsupport")
- #Check if the user can edit the application
+ #Check if the user can edit the motion
if (user == self.submitter \
and (self.status in ('pub', 'per'))) \
- or user.has_perm("application.can_manage_application"):
+ or user.has_perm("motion.can_manage_motion"):
actions.append("edit")
- # Check if the user can delete the application (admin, manager, owner)
+ # Check if the user can delete the motion (admin, manager, owner)
# reworked as requiered in #100
- if (user.has_perm("applicatoin.can_delete_all_applications") or
- (user.has_perm("application.can_manage_application") and
+ if (user.has_perm("applicatoin.can_delete_all_motions") or
+ (user.has_perm("motion.can_manage_motion") and
self.number is None) or
(self.submitter == user and self.number is None)):
actions.append("delete")
#For the rest, all actions need the manage permission
- if not user.has_perm("application.can_manage_application"):
+ if not user.has_perm("motion.can_manage_motion"):
return actions
if self.status == "pub":
@@ -430,17 +430,17 @@ class Application(models.Model, SlideMixin):
def delete(self, force=False):
"""
- Delete the application. It is not possible, if the application has
+ Delete the motion. It is not possible, if the motion has
allready a number
"""
if self.number and not force:
- raise NameError('The application has already a number. ' \
+ raise NameError('The motion has already a number. ' \
'You can not delete it.')
for item in Item.objects.filter(related_sid=self.sid):
item.delete()
- super(Application, self).delete()
+ super(Motion, self).delete()
def writelog(self, text, user=None):
if not self.log:
@@ -461,7 +461,7 @@ class Application(models.Model, SlideMixin):
def __getattr__(self, name):
"""
if name is title, text, reason or time,
- Return this attribute from the newest version of the application
+ Return this attribute from the newest version of the motion
"""
if name in ('title', 'text', 'reason', 'time', 'aid'):
try:
@@ -476,9 +476,9 @@ class Application(models.Model, SlideMixin):
def gen_poll(self, user=None):
"""
- Generates a poll object for the application
+ Generates a poll object for the motion
"""
- poll = ApplicationPoll(application=self)
+ poll = MotionPoll(motion=self)
poll.save()
poll.set_options()
self.writelog(_("Poll created"), user)
@@ -486,7 +486,7 @@ class Application(models.Model, SlideMixin):
@property
def polls(self):
- return self.applicationpoll_set.all()
+ return self.motionpoll_set.all()
@property
def results(self):
@@ -510,19 +510,19 @@ class Application(models.Model, SlideMixin):
"""
return the slide dict
"""
- data = super(Application, self).slide()
- data['application'] = self
+ data = super(Motion, self).slide()
+ data['motion'] = self
data['title'] = self.title
- data['template'] = 'projector/Application.html'
+ data['template'] = 'projector/Motion.html'
return data
def get_absolute_url(self, link='view'):
if link == 'view':
- return reverse('application_view', args=[str(self.id)])
+ return reverse('motion_view', args=[str(self.id)])
if link == 'edit':
- return reverse('application_edit', args=[str(self.id)])
+ return reverse('motion_edit', args=[str(self.id)])
if link == 'delete':
- return reverse('application_delete', args=[str(self.id)])
+ return reverse('motion_delete', args=[str(self.id)])
def __unicode__(self):
try:
@@ -532,10 +532,10 @@ class Application(models.Model, SlideMixin):
class Meta:
permissions = (
- ('can_see_application', ugettext_noop("Can see motions")),
- ('can_create_application', ugettext_noop("Can create motions")),
- ('can_support_application', ugettext_noop("Can support motions")),
- ('can_manage_application', ugettext_noop("Can manage motions")),
+ ('can_see_motion', ugettext_noop("Can see motions")),
+ ('can_create_motion', ugettext_noop("Can create motions")),
+ ('can_support_motion', ugettext_noop("Can support motions")),
+ ('can_manage_motion', ugettext_noop("Can manage motions")),
)
ordering = ('number',)
@@ -546,7 +546,7 @@ class AVersion(models.Model):
reason = models.TextField(null=True, blank=True, verbose_name = _("Reason"))
rejected = models.BooleanField() # = Not Permitted
time = models.DateTimeField(auto_now=True)
- application = models.ForeignKey(Application)
+ motion = models.ForeignKey(Motion)
def __unicode__(self):
return "%s %s" % (self.id, self.title)
@@ -557,31 +557,31 @@ class AVersion(models.Model):
return self._aid
except AttributeError:
self._aid = AVersion.objects \
- .filter(application=self.application) \
+ .filter(motion=self.motion) \
.filter(id__lte=self.id).count()
return self._aid
-register_slidemodel(Application)
+register_slidemodel(Motion)
-class ApplicationVote(BaseVote):
- option = models.ForeignKey('ApplicationOption')
+class MotionVote(BaseVote):
+ option = models.ForeignKey('MotionOption')
-class ApplicationOption(BaseOption):
- poll = models.ForeignKey('ApplicationPoll')
- vote_class = ApplicationVote
+class MotionOption(BaseOption):
+ poll = models.ForeignKey('MotionPoll')
+ vote_class = MotionVote
-class ApplicationPoll(BasePoll, CountInvalid, CountVotesCast):
- option_class = ApplicationOption
+class MotionPoll(BasePoll, CountInvalid, CountVotesCast):
+ option_class = MotionOption
vote_values = [ugettext_noop('Yes'), ugettext_noop('No'),
ugettext_noop('Abstain')]
- application = models.ForeignKey(Application)
+ motion = models.ForeignKey(Motion)
- def get_application(self):
- return self.application
+ def get_motion(self):
+ return self.motion
def set_options(self):
#TODO: maybe it is possible with .create() to call this without poll=self
@@ -592,20 +592,20 @@ class ApplicationPoll(BasePoll, CountInvalid, CountVotesCast):
CountVotesCast.append_pollform_fields(self, fields)
def get_absolute_url(self):
- return reverse('application_poll_view', args=[self.id])
+ return reverse('motion_poll_view', args=[self.id])
def get_ballot(self):
- return self.application.applicationpoll_set.filter(id__lte=self.id).count()
+ return self.motion.motionpoll_set.filter(id__lte=self.id).count()
-@receiver(default_config_value, dispatch_uid="application_default_config")
+@receiver(default_config_value, dispatch_uid="motion_default_config")
def default_config(sender, key, **kwargs):
return {
- 'application_min_supporters': 0,
- 'application_preamble': _('The assembly may decide,'),
- 'application_pdf_ballot_papers_selection': 'CUSTOM_NUMBER',
- 'application_pdf_ballot_papers_number': '8',
- 'application_pdf_title': _('Motions'),
- 'application_pdf_preamble': '',
- 'application_allow_trivial_change': False,
+ '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_allow_trivial_change': False,
}.get(key)
diff --git a/openslides/motion/templates/motion/base_motion.html b/openslides/motion/templates/motion/base_motion.html
new file mode 100644
index 000000000..1466bfcf2
--- /dev/null
+++ b/openslides/motion/templates/motion/base_motion.html
@@ -0,0 +1,66 @@
+{% extends "base.html" %}
+
+{% load tags %}
+{% load i18n %}
+{% load staticfiles %}
+
+{% block submenu %}
+ {% url motion_overview as url_motionoverview %}
+ {% trans "Motions" %}
+
+
+ {# second submenu #}
+ {% if motion %}
+
+ {% trans "Motion No." %}
+ {% if motion.number != None %}
+ {{ motion.number }}
+ {% else %}
+ [-]
+ {% endif %}
+
+
+ {% endif %}
+{% endblock %}
diff --git a/openslides/application/templates/application/config.html b/openslides/motion/templates/motion/config.html
similarity index 67%
rename from openslides/application/templates/application/config.html
rename to openslides/motion/templates/motion/config.html
index 8dd65eddf..8f2ac89b8 100644
--- a/openslides/application/templates/application/config.html
+++ b/openslides/motion/templates/motion/config.html
@@ -2,18 +2,18 @@
{% load i18n %}
-{% block title %}{{ block.super }} – {% trans "Application settings" %}{% endblock %}
+{% block title %}{{ block.super }} – {% trans "Motion settings" %}{% endblock %}
{% block content %}
- {% trans "Application settings" %}
+ {% trans "Motion settings" %}
- {{ applications|length }}
- {% blocktrans count counter=applications|length %}motion{% plural %}motions{% endblocktrans %}
+ {{ motions|length }}
+ {% blocktrans count counter=motions|length %}motion{% plural %}motions{% endblocktrans %}
{% trans "Number" %} |
@@ -42,39 +42,39 @@
{% trans "Creation Time" %} |
{% trans "Actions" %} |
- {% for app_info in applications %}
- {% with application=app_info.application useractions=app_info.actions %}
+ {% for app_info in motions %}
+ {% with motion=app_info.motion useractions=app_info.actions %}
- {% if application.number %}{{ application.number }}{% else %}-{% endif %} |
- {{ application.public_version.title }} |
+ {% if motion.active %}activeline{% endif %}">
+ {% if motion.number %}{{ motion.number }}{% else %}-{% endif %} |
+ {{ motion.public_version.title }} |
{% if min_supporters > 0 %}
- {{ application.count_supporters }} |
+ {{ motion.count_supporters }} |
{% endif %}
- {% if application.status != "pub" %}
- {{ application.get_status_display }}
+ | {% if motion.status != "pub" %}
+ {{ motion.get_status_display }}
{% endif %}
- {% for note in application.notes %}
+ {% for note in motion.notes %}
{{ note }}
{% if not forloop.last %} {%endif%}
{% endfor %}
|
- {{ application.submitter }} |
- {{ application.creation_time }} |
+ {{ motion.submitter }} |
+ {{ motion.creation_time }} |
{% if perms.projector.can_manage_projector %}
-
+
{% endif %}
- {% if perms.application.can_manage_application %}
-
+ {% if perms.motion.can_manage_motion %}
+
{% if "delete" in useractions %}
-
+
{% endif %}
{% endif %}
-
+
|
diff --git a/openslides/application/templates/application/poll_view.html b/openslides/motion/templates/motion/poll_view.html
similarity index 79%
rename from openslides/application/templates/application/poll_view.html
rename to openslides/motion/templates/motion/poll_view.html
index 67facddf5..b21236f23 100644
--- a/openslides/application/templates/application/poll_view.html
+++ b/openslides/motion/templates/motion/poll_view.html
@@ -1,16 +1,16 @@
-{% extends 'application/base_application.html' %}
+{% extends 'motion/base_motion.html' %}
{% load i18n %}
{% load staticfiles %}
{% block title %}
- {{ block.super }} – {% trans "Motion" %} "{{ application.public_version.title }}"
+ {{ block.super }} – {% trans "Motion" %} "{{ motion.public_version.title }}"
– {{ ballot }}. {% trans "Vote" %}
{% endblock %}
{% block content %}
- {{ application.public_version.title }} ({% trans "Motion" %}
- {{ application.number }}) – {{ ballot }}. {% trans "Vote" %}
+ {{ motion.public_version.title }} ({% trans "Motion" %}
+ {{ motion.number }}) – {{ ballot }}. {% trans "Vote" %}
{% trans "Special values" %}: -1 = {% trans 'majority' %}; -2 = {% trans 'undocumented' %}