From 0b5f75339e39a45faa728b2f24b8b9ddaae121b6 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Thu, 26 Mar 2015 05:36:10 +0100 Subject: [PATCH] Rename apps and permissions * Fixed agenda permissions * Renamed assignment to assignments, fixed assignments permission names * Renamed mediafile to mediafiles * Renamed motion to motions. Fixed motions permission names --- CHANGELOG | 5 + openslides/agenda/main_menu.py | 2 +- openslides/agenda/models.py | 4 +- .../agenda/templates/agenda/item_row.html | 6 +- .../agenda/templates/agenda/overview.html | 16 +- openslides/agenda/templates/agenda/sort.html | 20 +-- openslides/agenda/templates/agenda/view.html | 14 +- .../agenda/templates/agenda/widget_item.html | 2 +- .../agenda/widget_list_of_speakers.html | 2 +- .../templates/search/agenda-results.html | 2 +- openslides/agenda/views.py | 38 ++-- openslides/agenda/widgets.py | 2 +- openslides/assignment/__init__.py | 1 - openslides/assignments/__init__.py | 1 + .../{assignment => assignments}/apps.py | 10 +- .../{assignment => assignments}/forms.py | 0 .../{assignment => assignments}/main_menu.py | 2 +- .../{assignment => assignments}/models.py | 4 +- .../personal_info.py | 0 .../search_indexes.py | 2 +- .../serializers.py | 0 .../{assignment => assignments}/signals.py | 0 .../static/css/assignments.css} | 0 .../static/img/glyphicons_041_charts.png | Bin .../img/glyphicons_041_charts_white.png | Bin .../static/js/assignment.js | 0 .../static/js/assignments/assignments.js | 4 +- .../assignments/assignment-detail.html | 0 .../assignments/assignment-form.html | 0 .../assignments/assignment-list.html | 0 .../{assignment => assignments}/template.py | 0 .../assignments}/assignment_detail.html | 48 ++--- .../assignments}/assignment_form.html | 0 .../assignments}/assignment_list.html | 10 +- .../assignments}/assignmentpoll_form.html | 2 +- .../assignments}/assignmentpoll_slide.html | 0 .../templates/assignments}/slide.html | 0 .../assignments}/widget_assignment.html | 2 +- .../templates/search/assignment-results.html | 2 +- .../indexes/assignments}/assignment_text.txt | 0 .../{assignment => assignments}/urls.py | 0 .../{assignment => assignments}/views.py | 50 +++--- .../{assignment => assignments}/widgets.py | 2 +- openslides/global_settings.py | 6 +- openslides/mediafile/__init__.py | 1 - openslides/mediafiles/__init__.py | 1 + openslides/{mediafile => mediafiles}/apps.py | 6 +- openslides/{mediafile => mediafiles}/forms.py | 0 .../{mediafile => mediafiles}/main_menu.py | 6 +- .../{mediafile => mediafiles}/models.py | 0 .../search_indexes.py | 2 +- .../{mediafile => mediafiles}/serializers.py | 0 .../{mediafile => mediafiles}/slides.py | 2 +- .../static/css/mediafile.css | 0 .../static/css/mediafile_projector.css | 0 .../static/img/glyphicons_062_paperclip.png | Bin .../img/glyphicons_062_paperclip_white.png | Bin .../static/js/pdf.js | 0 .../static/js/pdf.worker.js | 0 .../static/js/pdf_presenter.js | 0 .../{mediafile => mediafiles}/template.py | 0 .../templates/mediafiles}/mediafile_form.html | 0 .../templates/mediafiles}/mediafile_list.html | 8 +- .../mediafiles}/presentation_slide.html | 0 .../mediafiles}/widget_pdfpresentation.html | 0 .../indexes/mediafiles}/mediafile_text.txt | 0 .../templates/search/mediafile-results.html | 2 +- openslides/{mediafile => mediafiles}/urls.py | 0 openslides/{mediafile => mediafiles}/views.py | 30 ++-- .../{mediafile => mediafiles}/widgets.py | 2 +- openslides/motion/__init__.py | 1 - openslides/motions/__init__.py | 1 + openslides/{motion => motions}/apps.py | 12 +- openslides/{motion => motions}/csv_import.py | 0 openslides/{motion => motions}/exceptions.py | 0 openslides/{motion => motions}/forms.py | 2 +- openslides/{motion => motions}/main_menu.py | 2 +- openslides/{motion => motions}/models.py | 24 +-- openslides/{motion => motions}/pdf.py | 0 .../{motion => motions}/personal_info.py | 0 .../{motion => motions}/search_indexes.py | 2 +- openslides/{motion => motions}/serializers.py | 0 openslides/{motion => motions}/signals.py | 0 .../{motion => motions}/static/css/motion.css | 0 .../templates/motions}/category_form.html | 0 .../templates/motions}/category_list.html | 2 +- .../templates/motions}/motion_detail.html | 18 +- .../templates/motions}/motion_diff.html | 0 .../templates/motions}/motion_form.html | 0 .../motions}/motion_form_csv_import.html | 0 .../templates/motions}/motion_list.html | 12 +- .../templates/motions}/motionpoll_form.html | 2 +- .../templates/motions}/motionpoll_slide.html | 0 .../templates/motions}/slide.html | 0 .../templates/motions}/widget_motion.html | 2 +- .../search/indexes/motions}/motion_text.txt | 0 .../templates/search/motion-results.html | 2 +- openslides/{motion => motions}/urls.py | 3 +- openslides/{motion => motions}/views.py | 71 ++++---- openslides/{motion => motions}/widgets.py | 2 +- openslides/urls.py | 8 +- openslides/users/signals.py | 60 +++---- .../{motion => motions}/__init__.py | 0 .../{motion => motions}/test_views.py | 4 +- .../{assignment => assignments}/__init__.py | 0 .../{assignment => assignments}/test_pdf.py | 6 +- .../{assignment => assignments}/test_views.py | 28 +-- .../old/{mediafile => mediafiles}/__init__.py | 0 tests/old/{mediafile => mediafiles}/tests.py | 74 ++++---- tests/old/{motion => motions}/__init__.py | 0 .../{motion => motions}/test_csv_import.py | 4 +- tests/old/{motion => motions}/test_models.py | 10 +- tests/old/{motion => motions}/test_pdf.py | 12 +- tests/old/{motion => motions}/test_views.py | 166 +++++++++--------- 114 files changed, 427 insertions(+), 422 deletions(-) delete mode 100644 openslides/assignment/__init__.py create mode 100644 openslides/assignments/__init__.py rename openslides/{assignment => assignments}/apps.py (79%) rename openslides/{assignment => assignments}/forms.py (100%) rename openslides/{assignment => assignments}/main_menu.py (85%) rename openslides/{assignment => assignments}/models.py (98%) rename openslides/{assignment => assignments}/personal_info.py (100%) rename openslides/{assignment => assignments}/search_indexes.py (79%) rename openslides/{assignment => assignments}/serializers.py (100%) rename openslides/{assignment => assignments}/signals.py (100%) rename openslides/{assignment/static/css/assignment.css => assignments/static/css/assignments.css} (100%) rename openslides/{assignment => assignments}/static/img/glyphicons_041_charts.png (100%) rename openslides/{assignment => assignments}/static/img/glyphicons_041_charts_white.png (100%) rename openslides/{assignment => assignments}/static/js/assignment.js (100%) rename openslides/{assignment => assignments}/static/js/assignments/assignments.js (95%) rename openslides/{assignment => assignments}/static/templates/assignments/assignment-detail.html (100%) rename openslides/{assignment => assignments}/static/templates/assignments/assignment-form.html (100%) rename openslides/{assignment => assignments}/static/templates/assignments/assignment-list.html (100%) rename openslides/{assignment => assignments}/template.py (100%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/assignment_detail.html (87%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/assignment_form.html (100%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/assignment_list.html (91%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/assignmentpoll_form.html (98%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/assignmentpoll_slide.html (100%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/slide.html (100%) rename openslides/{assignment/templates/assignment => assignments/templates/assignments}/widget_assignment.html (95%) rename openslides/{assignment => assignments}/templates/search/assignment-results.html (85%) rename openslides/{assignment/templates/search/indexes/assignment => assignments/templates/search/indexes/assignments}/assignment_text.txt (100%) rename openslides/{assignment => assignments}/urls.py (100%) rename openslides/{assignment => assignments}/views.py (94%) rename openslides/{assignment => assignments}/widgets.py (91%) delete mode 100644 openslides/mediafile/__init__.py create mode 100644 openslides/mediafiles/__init__.py rename openslides/{mediafile => mediafiles}/apps.py (86%) rename openslides/{mediafile => mediafiles}/forms.py (100%) rename openslides/{mediafile => mediafiles}/main_menu.py (67%) rename openslides/{mediafile => mediafiles}/models.py (100%) rename openslides/{mediafile => mediafiles}/search_indexes.py (80%) rename openslides/{mediafile => mediafiles}/serializers.py (100%) rename openslides/{mediafile => mediafiles}/slides.py (91%) rename openslides/{mediafile => mediafiles}/static/css/mediafile.css (100%) rename openslides/{mediafile => mediafiles}/static/css/mediafile_projector.css (100%) rename openslides/{mediafile => mediafiles}/static/img/glyphicons_062_paperclip.png (100%) rename openslides/{mediafile => mediafiles}/static/img/glyphicons_062_paperclip_white.png (100%) rename openslides/{mediafile => mediafiles}/static/js/pdf.js (100%) rename openslides/{mediafile => mediafiles}/static/js/pdf.worker.js (100%) rename openslides/{mediafile => mediafiles}/static/js/pdf_presenter.js (100%) rename openslides/{mediafile => mediafiles}/template.py (100%) rename openslides/{mediafile/templates/mediafile => mediafiles/templates/mediafiles}/mediafile_form.html (100%) rename openslides/{mediafile/templates/mediafile => mediafiles/templates/mediafiles}/mediafile_list.html (88%) rename openslides/{mediafile/templates/mediafile => mediafiles/templates/mediafiles}/presentation_slide.html (100%) rename openslides/{mediafile/templates/mediafile => mediafiles/templates/mediafiles}/widget_pdfpresentation.html (100%) rename openslides/{mediafile/templates/search/indexes/mediafile => mediafiles/templates/search/indexes/mediafiles}/mediafile_text.txt (100%) rename openslides/{mediafile => mediafiles}/templates/search/mediafile-results.html (88%) rename openslides/{mediafile => mediafiles}/urls.py (100%) rename openslides/{mediafile => mediafiles}/views.py (86%) rename openslides/{mediafile => mediafiles}/widgets.py (94%) delete mode 100644 openslides/motion/__init__.py create mode 100644 openslides/motions/__init__.py rename openslides/{motion => motions}/apps.py (76%) rename openslides/{motion => motions}/csv_import.py (100%) rename openslides/{motion => motions}/exceptions.py (100%) rename openslides/{motion => motions}/forms.py (99%) rename openslides/{motion => motions}/main_menu.py (87%) rename openslides/{motion => motions}/models.py (97%) rename openslides/{motion => motions}/pdf.py (100%) rename openslides/{motion => motions}/personal_info.py (100%) rename openslides/{motion => motions}/search_indexes.py (81%) rename openslides/{motion => motions}/serializers.py (100%) rename openslides/{motion => motions}/signals.py (100%) rename openslides/{motion => motions}/static/css/motion.css (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/category_form.html (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/category_list.html (97%) rename openslides/{motion/templates/motion => motions/templates/motions}/motion_detail.html (96%) rename openslides/{motion/templates/motion => motions/templates/motions}/motion_diff.html (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/motion_form.html (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/motion_form_csv_import.html (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/motion_list.html (95%) rename openslides/{motion/templates/motion => motions/templates/motions}/motionpoll_form.html (98%) rename openslides/{motion/templates/motion => motions/templates/motions}/motionpoll_slide.html (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/slide.html (100%) rename openslides/{motion/templates/motion => motions/templates/motions}/widget_motion.html (96%) rename openslides/{motion/templates/search/indexes/motion => motions/templates/search/indexes/motions}/motion_text.txt (100%) rename openslides/{motion => motions}/templates/search/motion-results.html (87%) rename openslides/{motion => motions}/urls.py (98%) rename openslides/{motion => motions}/views.py (93%) rename openslides/{motion => motions}/widgets.py (92%) rename tests/integration/{motion => motions}/__init__.py (100%) rename tests/integration/{motion => motions}/test_views.py (82%) rename tests/old/{assignment => assignments}/__init__.py (100%) rename tests/old/{assignment => assignments}/test_pdf.py (81%) rename tests/old/{assignment => assignments}/test_views.py (84%) rename tests/old/{mediafile => mediafiles}/__init__.py (100%) rename tests/old/{mediafile => mediafiles}/tests.py (83%) rename tests/old/{motion => motions}/__init__.py (100%) rename tests/old/{motion => motions}/test_csv_import.py (97%) rename tests/old/{motion => motions}/test_models.py (97%) rename tests/old/{motion => motions}/test_pdf.py (79%) rename tests/old/{motion => motions}/test_views.py (83%) diff --git a/CHANGELOG b/CHANGELOG index f01e7d1e3..35ba70736 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,11 @@ Agenda: agenda model. No API changes. Assignments: - Massive refactoring and cleanup of assignments app. +- Renamed app from assignment to assignments +Motions: +- Renamed app from motion to motions +Mediafiles: +- Renamed app from mediafile to mediafiles Users: - Massive refactoring of the participant app. Now called 'users'. - Used new anonymous user object instead of an authentification backend. diff --git a/openslides/agenda/main_menu.py b/openslides/agenda/main_menu.py index 00e578e57..db50655a6 100644 --- a/openslides/agenda/main_menu.py +++ b/openslides/agenda/main_menu.py @@ -8,7 +8,7 @@ class AgendaMainMenuEntry(MainMenuEntry): Main menu entry for the agenda app. """ verbose_name = ugettext_lazy('Agenda') - required_permission = 'agenda.can_see_agenda' + required_permission = 'agenda.can_see' default_weight = 20 pattern_name = 'item_overview' icon_css_class = 'glyphicon-calendar' diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 8fc269e52..d9ec490ed 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -114,8 +114,8 @@ class Item(RESTModelMixin, SlideMixin, AbsoluteUrlMixin, MPTTModel): class Meta: permissions = ( - ('can_see_agenda', ugettext_noop("Can see agenda")), - ('can_manage_agenda', ugettext_noop("Can manage agenda")), + ('can_see', ugettext_noop("Can see agenda")), + ('can_manage', ugettext_noop("Can manage agenda")), ('can_see_orga_items', ugettext_noop("Can see orga items and time scheduling of agenda"))) class MPTTMeta: diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index f6a39e51b..dde29ad09 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -2,7 +2,7 @@ {% load tags %}
- {% if perms.agenda.can_manage_agenda or perms.core.can_manage_projector %} + {% if perms.agenda.can_manage or perms.core.can_manage_projector %}
{% if perms.core.can_manage_projector %} @@ -17,7 +17,7 @@ {% endif %} - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %} @@ -56,7 +56,7 @@
{% endif %} - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %}
{% if node.comment %} {{ node.comment|first_line }} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 5d6d6ac40..e4dd49b42 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -17,7 +17,7 @@ {% block content %}

{% trans "Agenda" %} - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %} @@ -31,7 +31,7 @@ {% trans 'Tags' %} {% endif %} - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %} @@ -56,7 +56,7 @@
- {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %}

{% trans 'Number agenda items' %} @@ -95,13 +95,13 @@ - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %} {% endif %} {% if perms.agenda.can_see_orga_items %} {% endif %} - {% if perms.agenda.can_manage_agenda or perms.core.can_manage_projector %} + {% if perms.agenda.can_manage or perms.core.can_manage_projector %} {% endif %} @@ -109,13 +109,13 @@ - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %} {% endif %} {% if perms.agenda.can_see_orga_items %} {% endif %} - {% if perms.agenda.can_manage_agenda or perms.core.can_manage_projector %} + {% if perms.agenda.can_manage or perms.core.can_manage_projector %} {% if items %} -

    +
      {% recursetree items %}
    1. {% include "agenda/item_row.html" %} diff --git a/openslides/agenda/templates/agenda/sort.html b/openslides/agenda/templates/agenda/sort.html index eaee7a1f2..1bb85f3bd 100644 --- a/openslides/agenda/templates/agenda/sort.html +++ b/openslides/agenda/templates/agenda/sort.html @@ -12,7 +12,7 @@ {% block javascript %} - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %} @@ -22,7 +22,7 @@ {% block content %}
      {% csrf_token %} - {% if perms.agenda.can_manage_agenda %} + {% if perms.agenda.can_manage %}