diff --git a/openslides/motion/models.py b/openslides/motion/models.py index 010b1a855..0adc1cd51 100644 --- a/openslides/motion/models.py +++ b/openslides/motion/models.py @@ -49,9 +49,9 @@ class Motion(SlideMixin, models.Model): related_name="active_version") """Points to a specific version. - Used be the permitted-version-system to deside witch version is the active - Version. Could also be used to only choose a specific version as a default - version. Like the Sighted versions on Wikipedia. + Used be the permitted-version-system to deside which version is the active + version. Could also be used to only choose a specific version as a default + version. Like the sighted versions on Wikipedia. """ state = models.ForeignKey('State', null=True) # TODO: Check whether null=True is necessary. @@ -574,7 +574,7 @@ class Category(models.Model): name = models.CharField(max_length=255, verbose_name=ugettext_lazy("Category name")) """Name of the category.""" - prefix = models.CharField(blank=True, max_length=32, verbose_name=ugettext_lazy("Category prefix")) + prefix = models.CharField(blank=True, max_length=32, verbose_name=ugettext_lazy("Prefix")) """Prefix of the category. Used to build the identifier of a motion. @@ -589,6 +589,8 @@ class Category(models.Model): if link == 'delete': return reverse('motion_category_delete', args=[str(self.id)]) + class Meta: + ordering = ['prefix'] ## class Comment(models.Model): ## motion_version = models.ForeignKey(MotionVersion) diff --git a/openslides/motion/static/styles/motion.css b/openslides/motion/static/styles/motion.css new file mode 100644 index 000000000..951f94309 --- /dev/null +++ b/openslides/motion/static/styles/motion.css @@ -0,0 +1,41 @@ +/** + * OpenSlides motion style + * + * :copyright: 2013 by OpenSlides team, see AUTHORS. + * :license: GNU GPL, see LICENSE for more details. + */ + +/* motion version diff table */ +table.diff, .diff_row { + font-size: 12px; + width: 100%; + border: 0px; +} +table.diff[rules][rules="groups"] > colgroup, table[rules][rules="groups"] > tfoot, table[rules][rules="groups"] > thead, table[rules][rules="groups"] > tbody { + border: none; +} +table.diff td { + padding: 0 !important; + border: none; +} +.diff_header { + background-color:#e0e0e0; +} +td.diff_header { + text-align:right; + display: none; +} +.diff_next { + background-color:#c0c0c0; + display: none; +} +.diff_add { + background-color:#aaffaa; +} +.diff_chg { + background-color:#ffff77; +} +.diff_sub { + background-color:#ffaaaa; +} + diff --git a/openslides/motion/templates/motion/category_form.html b/openslides/motion/templates/motion/category_form.html index 5114c9a0a..421b3a019 100644 --- a/openslides/motion/templates/motion/category_form.html +++ b/openslides/motion/templates/motion/category_form.html @@ -5,7 +5,7 @@ {% block title %} {{ block.super }} – - {% if motion %} + {% if category %} {% trans "Edit category" %} {% else %} {% trans "New category" %} @@ -14,7 +14,7 @@ {% block content %}

- {% if motion %} + {% if category %} {% trans "Edit category" %} {% else %} {% trans "New category" %} @@ -24,7 +24,7 @@ {% include "form.html" %}

{% include "formbuttons_saveapply.html" %} - + {% trans 'Cancel' %}

diff --git a/openslides/motion/templates/motion/category_list.html b/openslides/motion/templates/motion/category_list.html index 175cf2854..41e9f821d 100644 --- a/openslides/motion/templates/motion/category_list.html +++ b/openslides/motion/templates/motion/category_list.html @@ -6,11 +6,40 @@ {% block title %}{{ block.super }} – {% trans "Motions" %}{% endblock %} {% block content %} -

{% trans "Categories" %}

+

+ {% trans "Categories" %} + + {% if perms.motion.can_manage_motion %} + {% trans 'New' %} + {% endif %} + {% trans "Back to overview" %} + +

+ + + + + + + {% for category in category_list %} -

{{ category }}

+ + + + + {% empty %} -

No Categories

+ + + {% endfor %}
{% trans "Prefix" %}{% trans "Category name" %}{% trans "Actions" %}
{{ category.prefix }}{{ category }} + + + + + + + +
{% trans "No categories available." %}
{% endblock %} diff --git a/openslides/motion/templates/motion/motion_detail.html b/openslides/motion/templates/motion/motion_detail.html index 12d26fba3..cda0ad03b 100644 --- a/openslides/motion/templates/motion/motion_detail.html +++ b/openslides/motion/templates/motion/motion_detail.html @@ -4,18 +4,19 @@ {% load i18n %} {% load staticfiles %} -{% block title %}{{ block.super }} – {% trans "Motion" %} {{ motion.number }}{% endblock %} +{% block title %}{{ block.super }} – {% trans "Motion" %} {{ motion.identifier }}{% endblock %} {% block content %}

{{ motion.title }} {{ motion.category }}
- {% if motion.identifier != None %} + {% if motion.identifier %} {% trans "Motion" %} {{ motion.identifier }}, {% else %} [{% trans "no number" %}], {% endif %} + {# TODO: show only for complex workflow #} {% trans "Version" %} {{ motion.version.version_number }} @@ -56,13 +57,20 @@
- {% if motion.active_version.id != motion.version.id %} - - {% if motion.version == motion.public_version %} - {% trans "This is not the newest version." %} {% trans "Go to version" %} {{ motion.last_version.version_number }}. - {% else %} - {% trans "This is not the authorized version." %} {% trans "Go to version" %} {{ motion.public_version.aid }}. - {% endif %} + {# TODO: show only for complex workflow #} + {% if motion.version.version_number < motion.last_version.version_number %} + + {% trans "This is not the newest version." %} + + {% trans "Go to last version" %} + (#{{ motion.last_version.version_number }}) + {% endif %} + {% if motion.version.version_number > motion.active_version.version_number %} + + {% trans "This version is not yet authorized." %} + + {% trans "Go to last authorized version" %} + (#{{ motion.active_version.version_number }}) {% endif %} @@ -80,84 +88,60 @@
- {% for version in motion.versions.all %} - {% if forloop.first %} -

{% trans "Version history" %}:

- - - - - - - - - - {% endif %} - - + + + + + + + {% if forloop.last %} +
{% trans "Version" %}{% trans "Time" %}{% trans "Title" %}{% trans "Text" %}{% trans "Reason" %}
- {% if version == motion.active_version %} - - {% else %} - {% if perms.motion.can_manage_motion %} - - {% endif %} - {% if not version.rejected and version.id > motion.active_version.id and perms.motion.can_manage_motion %} - - {% endif %} + {% with versions=motion.versions.all %} + {% if versions|length > 1 %} + {% for version in versions %} + {% if forloop.first %} +

{% trans "Version history" %}:

+
+ + + + + + + + {% endif %} - {% if version.rejected %} - - {% endif %} - - - - - - - - {% if forloop.last %} -
#{% trans "Time" %}{% trans "Actions" %}
{{ version.version_number }}{{ version.creation_time }} - {% ifchanged %} - {{ version.title }} - {% else %} - [{% trans "unchanged" %}] - {% endifchanged %} - - {% ifchanged %} - {{ version.text|linebreaks }} - {% else %} - [{% trans "unchanged" %}] - {% endifchanged %} - - {% ifchanged %} - {{ version.reason|linebreaks }} - {% else %} - [{% trans "unchanged" %}] - {% endifchanged %} -
+
+ {% if version == motion.active_version %} + + {% else %} + {% if perms.motion.can_manage_motion %} + + {% endif %} + {% if not version.rejected and version.id > motion.active_version.id and perms.motion.can_manage_motion %} + + {% endif %} + {% endif %} + {% if version.rejected %} + + {% endif %} + {{ version.version_number }}{{ version.creation_time }} + + + + + + + {# TODO: add delete version function #} + + + +
+ + {% endif %} + {% endfor %} {% endif %} - {% endfor %} - - -
    -{% for motion_version in motion.versions.all %} -
  1. - {% if motion_version.id == motion.version.id %} - {{ motion_version }} - {% else %} - {{ motion_version }} - {% endif %} - {% if motion_version.active %} - (active) - {% endif %} - {% if motion_version.rejected %} - (rejected) - {% endif %} -
  2. -{% endfor %} -
- - + {% endwith %} {% if perms.motion.can_manage_motion %} @@ -247,6 +231,10 @@ {% endif %} {% endwith %} + +
{% trans "Category" %}:
+ {{ motion.category }} +
{% trans "Creation Time" %}:
{# TODO: use creation time of _first_ version #} @@ -287,7 +275,7 @@

{% trans "Manage motion" %}

-
+
{% for state in motion.state.next_states.all %} {{ state }} {% endfor %} @@ -303,5 +291,4 @@
- {% endblock %} diff --git a/openslides/motion/templates/motion/motion_diff.html b/openslides/motion/templates/motion/motion_diff.html new file mode 100644 index 000000000..f03d54b85 --- /dev/null +++ b/openslides/motion/templates/motion/motion_diff.html @@ -0,0 +1,67 @@ +{% extends "base.html" %} + +{% load tags %} +{% load i18n %} +{% load staticfiles %} + +{% block title %}{{ block.super }} – {% trans "Motion" %} {{ motion.identifier }}{% endblock %} + +{% block header %} + +{% endblock %} + + +{% block content %} +

+ {{ motion.title }} +
+ + {% if motion.identifier != None %} + {% trans "Motion" %} {{ motion.identifier }}, + {% else %} + [{% trans "no number" %}], + {% endif %} + {% trans "Diff view" %} + + + + +

+ +{% if version_rev1 and version_rev2 %} + + + + + + + + {% if not version_rev1.text == version_rev2.text %} + + {% else %} + + + {% endif %} + + + + + {% if not version_rev1.reason == version_rev2.reason %} + + {% else %} + + + {% endif %} + +
{% trans "Version" %} {{ version_rev1.version_number }}
+ {% trans "created: " %} {{ version_rev1.creation_time }}
+

{{ version_rev1.title }}

+
{% trans "Version" %} {{ version_rev2.version_number }}
+ {% trans "created: " %} {{ version_rev1.creation_time }}
+

{{ version_rev2.title }}

+
{{ diff_text|safe }}{{ version_rev1.text }}{{ version_rev2.text }}

{% trans "Reason" %}:

{{ diff_reason|safe }}{{ version_rev1.reason }}{{ version_rev2.reason }}
+{% endif %} + +{% endblock %} diff --git a/openslides/motion/templates/motion/motion_list.html b/openslides/motion/templates/motion/motion_list.html index 3bdf74e87..bc5d630c9 100644 --- a/openslides/motion/templates/motion/motion_list.html +++ b/openslides/motion/templates/motion/motion_list.html @@ -10,9 +10,10 @@ {% trans "Motions" %} {% if perms.motion.can_create_motion %} - {% trans "New" %} + {% trans 'New' %} {% endif %} {% if perms.motion.can_manage_motion %} + {% trans 'Category' %} {# {% trans 'Import' %}#} {% endif %} PDF @@ -60,7 +61,7 @@ {% for motion in motion_list %} - {{ motion.number }} + {{ motion.identifier }} {{ motion.title }} {% if min_supporters > 0 %} {# motion.count_supporters #} diff --git a/openslides/motion/templates/motion/poll_form.html b/openslides/motion/templates/motion/poll_form.html index f3bc4aa68..70030bf28 100644 --- a/openslides/motion/templates/motion/poll_form.html +++ b/openslides/motion/templates/motion/poll_form.html @@ -3,7 +3,7 @@ {% load i18n %} {% block title %} - {{ block.super }} - {% trans "Motion" %} {{ motion.number }}, {{ ballot }}. {% trans "Vote" %} + {{ block.super }} - {% trans "Motion" %} {{ motion.identifier }}, {{ ballot }}. {% trans "Vote" %} {% endblock %} {% block content %} @@ -11,7 +11,7 @@ {{ motion }}
- {% trans "Motion" %} {{ motion.number }}, {{ ballot }}. {% trans "Vote" %} + {% trans "Motion" %} {{ motion.identifier }}, {{ ballot }}. {% trans "Vote" %}
diff --git a/openslides/motion/templates/motion/widget.html b/openslides/motion/templates/motion/widget.html index 37302db51..3c9566403 100644 --- a/openslides/motion/templates/motion/widget.html +++ b/openslides/motion/templates/motion/widget.html @@ -17,8 +17,8 @@ {{ motion.public_version.title }} ({% trans "motion" %} - {% if motion.number %} - {{ motion.number }}) + {% if motion.identifier %} + {{ motion.identifier }}) {% else %} [{% trans "no number" %}]) {% endif %} diff --git a/openslides/motion/templates/projector/Motion.html b/openslides/motion/templates/projector/Motion.html index 8d2e6699e..20f2b97be 100644 --- a/openslides/motion/templates/projector/Motion.html +++ b/openslides/motion/templates/projector/Motion.html @@ -4,7 +4,7 @@ {% load i18n %} {% load staticfiles %} -{% block title %}{{ block.super }} - {% trans "Motion" %} {{ motion.number }}{% endblock %} +{% block title %}{{ block.super }} - {% trans "Motion" %} {{ motion.identifier }}{% endblock %} {% block content %}