Fix translations in group detail template.

This commit is contained in:
Emanuel Schuetze 2016-02-24 20:50:32 +01:00
parent 88b2e8a73e
commit d3d73a019d
2 changed files with 18 additions and 4 deletions

View File

@ -105,6 +105,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
resolve: {
group: function(Group, $stateParams) {
return Group.find($stateParams.id);
},
permissions: function(Group) {
return Group.getPermissions();
}
}
})
@ -854,8 +857,19 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
'$scope',
'Group',
'group',
function($scope, Group, group) {
'permissions',
function($scope, Group, group, permissions) {
Group.bindOne(group.id, $scope, 'group');
$scope.groupPermissionNames = [];
// get display names of group permissions
// from an object array with all available permissions [{display_name, value}]
angular.forEach(group.permissions, function(permValue) {
angular.forEach(permissions, function(p) {
if (p.value == permValue) {
$scope.groupPermissionNames.push(p.display_name);
}
});
});
}
])

View File

@ -6,14 +6,14 @@
<translate>Back to overview</translate>
</a>
</div>
<h1>{{ group.name }}</h1>
<h1>{{ group.name | translate }}</h1>
<h2 translate>Group</h2>
</div>
</div>
<div class="details">
<p class="lead" translate>Permissions:</p>
<ul ng-repeat="perm in group.permissions">
<li>{{ perm }}
<ul ng-repeat="permission in groupPermissionNames">
<li>{{ permission | translate }}
</ul>
</div>