From 04468559202a3c143170a87f38dae8c37f2b10a9 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 25 Nov 2016 09:46:33 +0100 Subject: [PATCH] Use pugin verbose name in permission matrix (fixes #2341) --- openslides/users/static/js/users/site.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index c7284915d..ffa3650c0 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -1158,8 +1158,9 @@ angular.module('OpenSlidesApp.users.site', [ 'Motion', 'User', 'ngDialog', - function($scope, $http, operator, Group, permissions, gettext, Agenda, Assignment, Mediafile, Motion, User, ngDialog) { - //Group.bindAll({}, $scope, 'groups'); + 'OpenSlidesPlugins', + function($scope, $http, operator, Group, permissions, gettext, Agenda, Assignment, Mediafile, + Motion, User, ngDialog, OpenSlidesPlugins) { $scope.permissions = permissions; $scope.$watch(function() { @@ -1181,6 +1182,11 @@ angular.module('OpenSlidesApp.users.site', [ $scope.group_danger = groups_danger.length == 1 ? groups_danger[0] : null; }); + // Dict to map plugin name -> display_name + var pluginTranslation = {}; + _.forEach(OpenSlidesPlugins.getAll(), function (plugin) { + pluginTranslation[plugin.name] = plugin.display_name; + }); $scope.apps = []; // Create the main clustering with appname->permissions angular.forEach(permissions, function(perm) { @@ -1222,7 +1228,8 @@ angular.module('OpenSlidesApp.users.site', [ insert(5, perm, User.verboseNamePlural); break; default: // plugins: id>5 - var display_name = permissionApp.charAt(0).toUpperCase() + permissionApp.slice(1); + var display_name = pluginTranslation[permissionApp] || permissionApp.charAt(0).toUpperCase() + + permissionApp.slice(1); // does the app exists? var result = -1; angular.forEach($scope.apps, function (app, index) {