Merge pull request #3414 from FinnStutzenstein/Fixes

Motion comments fix and close open dialogs if a relogin is necessary
This commit is contained in:
Emanuel Schütze 2017-09-21 16:29:32 +02:00 committed by GitHub
commit c68688c2ff
4 changed files with 19 additions and 9 deletions

View File

@ -14,7 +14,9 @@ angular.module('OpenSlidesApp.core.start', [])
'operator',
'Group',
'mainMenu',
function($http, $rootScope, $state, $q, DS, autoupdate, operator, Group, mainMenu) {
'ngDialog',
'LoginDialog',
function($http, $rootScope, $state, $q, DS, autoupdate, operator, Group, mainMenu, ngDialog, LoginDialog) {
var OpenSlides = {
bootup: function () {
$rootScope.openslidesBootstrapDone = false;
@ -41,6 +43,12 @@ angular.module('OpenSlidesApp.core.start', [])
operator.setUser(null);
$rootScope.openslidesBootstrapDone = false;
$rootScope.operator = operator;
// close all open dialogs (except the login dialog)
_.forEach(ngDialog.getOpenDialogs(), function (id) {
if (id !== LoginDialog.id) {
ngDialog.close(id);
}
});
},
reboot: function () {
this.shutdown();

View File

@ -987,7 +987,7 @@ angular.module('OpenSlidesApp.motions.site', [
function (motion) {return motion.category ? motion.category.name : '';},
function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';},
function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';},
function (motion) {return motion.comments.join(' ');},
function (motion) {return _.filter(motion.comments, function (comment) {return !!comment;}).join(' ');},
];
$scope.filter.propertyDict = {
'submitters': function (submitter) {

View File

@ -161,10 +161,10 @@
</div>
<div os-perms="motions.can_manage" class="input-group spacer"
ng-show="motion.state.show_state_extension_field">
<label class="sr-only" for="stateExtensionField">{{ commentsFields[commentFieldForStateId] }}</label>
<label class="sr-only" for="stateExtensionField">{{ motion.comments[commentFieldForStateId] }}</label>
<input type="text" ng-model="stateExtension"
id="stateNameExtensionField" class="form-control input-sm"
placeholder="{{ commentsFields[commentFieldForStateId] }}">
placeholder="{{ motion.comments[commentFieldForStateId] }}">
<span class="input-group-btn">
<button ng-click="saveAdditionalStateField(stateExtension)" class="btn btn-default btn-sm">
<i class="fa fa-check"></i>
@ -204,11 +204,11 @@
<div class="input-group spacer"
ng-if="motion.recommendation.show_recommendation_extension_field">
<label class="sr-only" for="recommendationExtensionField">
{{ commentsFields[commentFieldForRecommendationId] }}
{{ motion.comments[commentFieldForRecommendationId] }}
</label>
<input type="text" ng-model="recommendationExtension"
id="recommendationExtensionField" class="form-control input-sm"
placeholder="{{ commentsFields[commentFieldForRecommendationId] }}">
placeholder="{{ motion.comments[commentFieldForRecommendationId] }}">
<span class="input-group-btn">
<button ng-click="saveAdditionalRecommendationField(recommendationExtension)" class="btn btn-default btn-sm">
<i class="fa fa-check"></i>

View File

@ -93,14 +93,14 @@ angular.module('OpenSlidesApp.users.site', [
guest_enabled: false,
msg: null,
},
onEnter: ['$state', '$stateParams', 'ngDialog', function($state, $stateParams, ngDialog) {
ngDialog.open({
onEnter: ['$state', '$stateParams', 'ngDialog', 'LoginDialog', function($state, $stateParams, ngDialog, LoginDialog) {
LoginDialog.id = ngDialog.open({
template: 'static/templates/core/login-form.html',
controller: 'LoginFormCtrl',
showClose: $stateParams.guest_enabled,
closeByEscape: $stateParams.guest_enabled,
closeByDocument: $stateParams.guest_enabled,
});
}).id;
}],
data: {
title: 'Login',
@ -109,6 +109,8 @@ angular.module('OpenSlidesApp.users.site', [
}
])
.value('LoginDialog', {id: undefined})
/*
* Directive to check for permissions
*