Fix edit current slide button.

This commit is contained in:
Emanuel Schuetze 2016-03-19 13:41:03 +01:00
parent 5e08e073f4
commit 2af38f75bb
3 changed files with 23 additions and 0 deletions

View File

@ -811,6 +811,7 @@ angular.module('OpenSlidesApp.core.site', [
if (value.name == 'agenda/list-of-speakers') {
$state.go('agenda.item.detail', {id: value.id});
} else if (
value.name != 'agenda/item-list' &&
value.name != 'core/clock' &&
value.name != 'core/countdown' &&
value.name != 'core/message' ) {

View File

@ -17,6 +17,8 @@
</a>
<!-- projector control buttons -->
<div os-perms="core.can_manage_projector">
<!-- edit -->
<a ng-click="editCurrentSlide()"
class="btn btn-default btn-sm"
title="{{ 'Edit current slide' | translate}}">

View File

@ -58,6 +58,26 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
}
}
})
// Redirects to user detail view and opens user edit form dialog, uses edit url.
// Used by $state.go(..) from core/site.js only (for edit current slide button).
// (from users list controller use UserForm factory instead to open dialog in front of
// current view without redirect)
.state('users.user.detail.update', {
onEnter: ['$stateParams', '$state', 'ngDialog', 'User',
function($stateParams, $state, ngDialog, User) {
ngDialog.open({
template: 'static/templates/users/user-form.html',
controller: 'UserUpdateCtrl',
className: 'ngdialog-theme-default wide-form',
closeByEscape: false,
closeByDocument: false,
resolve: {
user: function() {return User.find($stateParams.id);}
}
});
}
]
})
.state('users.user.detail.profile', {
views: {
'@users.user': {},