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.
This commit is contained in:
parent
4fc95e5f19
commit
03f08628c7
@ -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();
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="header">
|
||||
<div ng-if="item" class="header">
|
||||
<div class="title">
|
||||
<div class="submenu">
|
||||
<a ui-sref="agenda.item.list" class="btn btn-sm btn-default">
|
||||
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="details listOfSpeakers">
|
||||
<div ng-if="item" class="details listOfSpeakers">
|
||||
<div class="pull-right">
|
||||
<span os-perms="agenda.can_manage">
|
||||
<button ng-if="item.speaker_list_closed" ng-click="closeList(false)"
|
||||
|
@ -37,7 +37,11 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
||||
return Assignment.findAll();
|
||||
},
|
||||
items: function(Agenda) {
|
||||
return Agenda.findAll();
|
||||
return Agenda.findAll().catch(
|
||||
function () {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
},
|
||||
phases: function(Assignment) {
|
||||
return Assignment.getPhases();
|
||||
|
@ -73,6 +73,7 @@ angular.module('OpenSlidesApp.core.site', [
|
||||
'img_class': 'home',
|
||||
'title': gettext('Home'),
|
||||
'weight': 100,
|
||||
'perm': 'core.can_see_frontpage',
|
||||
});
|
||||
|
||||
mainMenuProvider.register({
|
||||
|
@ -1,7 +1,9 @@
|
||||
<div class="header">
|
||||
<div os-perms="core.can_see_frontpage" class="header">
|
||||
<div class="title">
|
||||
<h1>{{ config('general_event_welcome_title') }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="details" ng-bind-html="config('general_event_welcome_text')"></div>
|
||||
<div os-perms="core.can_see_frontpage" class="details"
|
||||
ng-bind-html="config('general_event_welcome_text')">
|
||||
</div>
|
||||
|
@ -37,7 +37,11 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
||||
return Mediafile.findAll();
|
||||
},
|
||||
users: function(User) {
|
||||
return User.findAll();
|
||||
return User.findAll().catch(
|
||||
function () {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
@ -39,7 +39,6 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
||||
Motion.loadRelations(motion, 'agenda_item');
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
categories: function(Category) {
|
||||
return Category.findAll();
|
||||
@ -48,7 +47,11 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
||||
return Tag.findAll();
|
||||
},
|
||||
users: function(User) {
|
||||
return User.findAll();
|
||||
return User.findAll().catch(
|
||||
function () {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
},
|
||||
workflows: function(Workflow) {
|
||||
return Workflow.findAll();
|
||||
@ -58,18 +61,24 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
||||
.state('motions.motion.detail', {
|
||||
resolve: {
|
||||
motion: function(Motion, $stateParams) {
|
||||
return Motion.find($stateParams.id).then(function(motion) {
|
||||
return Motion.loadRelations(motion, 'agenda_item');
|
||||
});
|
||||
return Motion.find($stateParams.id);
|
||||
},
|
||||
categories: function(Category) {
|
||||
return Category.findAll();
|
||||
},
|
||||
users: function(User) {
|
||||
return User.findAll();
|
||||
return User.findAll().catch(
|
||||
function () {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
},
|
||||
mediafiles: function(Mediafile) {
|
||||
return Mediafile.findAll();
|
||||
return Mediafile.findAll().catch(
|
||||
function () {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
},
|
||||
tags: function(Tag) {
|
||||
return Tag.findAll();
|
||||
|
@ -28,7 +28,7 @@
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
<h1>{{ motion.getTitle() }}</h1>
|
||||
<h1>{{ motion.agenda_item.getTitle() || motion.getTitle() }}</h1>
|
||||
<h2>
|
||||
<translate>Motion</translate> {{ motion.identifier }}
|
||||
<span ng-if="motion.versions.length > 1" >| Version {{ motion.getVersion(version).version_number }}</span>
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
<!-- Title -->
|
||||
<div id="title">
|
||||
<h1>{{ motion.getTitle() }}</h1>
|
||||
<h1>{{ motion.agenda_item.getTitle() || motion.getTitle() }}</h1>
|
||||
<h2>
|
||||
<translate>Motion</translate> {{ motion.identifier }}
|
||||
<span ng-if="motion.versions.length > 1" >| Version {{ motion.getVersion().version_number }}</span>
|
||||
|
@ -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');
|
||||
}
|
||||
]);
|
||||
|
@ -69,7 +69,7 @@
|
||||
<div class="col-sm-6 text-right form-inline">
|
||||
<!-- group filter -->
|
||||
<select ng-model="groupFilter" class="form-control" id="groupFilter">
|
||||
<option value="" translate>--- Select group ---</option>
|
||||
<option ng-click="groupFilter = undefined" value="" translate>--- Select group ---</option>
|
||||
<option ng-repeat="group in groups" value="{{ group.id }}">{{ group.name | translate }}</option>
|
||||
</select>
|
||||
<!-- isPresent filter -->
|
||||
|
Loading…
Reference in New Issue
Block a user