From 03f08628c7eacb946f2aff786bc3ae8a632c2f67 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Fri, 18 Mar 2016 11:00:31 +0100 Subject: [PATCH] Catch 404 errors in resolve promise if user has not all required permissions. - fix motion detail/list, agenda item detail, assignment list, mediafile list - add fontpage permission check - use agenda item title for motion title if available (to show item number) - fix groupFilter reset in users list - fix users permission string Fixes #2028. Fixes #2038. --- openslides/agenda/static/js/agenda/site.js | 12 ++++++++-- .../static/templates/agenda/item-detail.html | 4 ++-- .../assignments/static/js/assignments/site.js | 6 ++++- openslides/core/static/js/core/site.js | 1 + openslides/core/static/templates/home.html | 6 +++-- .../mediafiles/static/js/mediafiles/site.js | 6 ++++- openslides/motions/static/js/motions/site.js | 23 +++++++++++++------ .../templates/motions/motion-detail.html | 2 +- .../templates/motions/slide_motion.html | 2 +- openslides/users/static/js/users/site.js | 3 ++- .../static/templates/users/user-list.html | 2 +- 11 files changed, 48 insertions(+), 19 deletions(-) diff --git a/openslides/agenda/static/js/agenda/site.js b/openslides/agenda/static/js/agenda/site.js index ccd0cf285..ac14e1af3 100644 --- a/openslides/agenda/static/js/agenda/site.js +++ b/openslides/agenda/static/js/agenda/site.js @@ -41,10 +41,18 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda']) .state('agenda.item.detail', { resolve: { item: function(Agenda, $stateParams) { - return Agenda.find($stateParams.id); + return Agenda.find($stateParams.id).catch( + function () { + return null; + } + ); }, users: function(User) { - return User.findAll(); + return User.findAll().catch( + function () { + return null; + } + ); }, tags: function(Tag) { return Tag.findAll(); diff --git a/openslides/agenda/static/templates/agenda/item-detail.html b/openslides/agenda/static/templates/agenda/item-detail.html index babbcc672..d2622109b 100644 --- a/openslides/agenda/static/templates/agenda/item-detail.html +++ b/openslides/agenda/static/templates/agenda/item-detail.html @@ -1,4 +1,4 @@ -
+
-
+
-

{{ motion.getTitle() }}

+

{{ motion.agenda_item.getTitle() || motion.getTitle() }}

Motion {{ motion.identifier }} | Version {{ motion.getVersion(version).version_number }} diff --git a/openslides/motions/static/templates/motions/slide_motion.html b/openslides/motions/static/templates/motions/slide_motion.html index 901f5ecab..72d0ddabc 100644 --- a/openslides/motions/static/templates/motions/slide_motion.html +++ b/openslides/motions/static/templates/motions/slide_motion.html @@ -62,7 +62,7 @@
-

{{ motion.getTitle() }}

+

{{ motion.agenda_item.getTitle() || motion.getTitle() }}

Motion {{ motion.identifier }} | Version {{ motion.getVersion().version_number }} diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index 3eea33247..96a5eedec 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -383,6 +383,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) User.bindAll({}, $scope, 'users'); Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups'); $scope.alert = {}; + $scope.groupFilter = undefined; // setup table sorting $scope.sortColumn = 'first_name'; //TODO: sort by first OR last name @@ -973,7 +974,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) gettext('Can manage motions'); // users gettext('Can see names of users'); - gettext('Can see extra data of users'); + gettext('Can see extra data of users (e.g. present and comment)'); gettext('Can manage users'); } ]); diff --git a/openslides/users/static/templates/users/user-list.html b/openslides/users/static/templates/users/user-list.html index d19728097..98e1f0898 100644 --- a/openslides/users/static/templates/users/user-list.html +++ b/openslides/users/static/templates/users/user-list.html @@ -69,7 +69,7 @@