Fixed group default selection of existing users.

This commit is contained in:
Martin Edenhofer 2016-08-21 01:35:33 +02:00
parent ea9c5a12b8
commit 42fea8bc1f
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ class App.UiElement.user_permission
attribute.options = {}
# take defaults users selected, select all groups
if _.isEmpty(params) && !_.isEmpty(attribute.value)
if _.isEmpty(params.group_ids) && _.isEmpty(params.role_ids) && !_.isEmpty(attribute.value)
params.role_ids = attribute.value
selectAllGroups = false
for localRoleId in params.role_ids

View file

@ -5,7 +5,7 @@
<input type="checkbox" value="<%= permission.id %>" name="permission_ids" <% if _.contains(@params.permission_ids, permission.id): %>checked<% end %> <% if permission.preferences.disabled: %>disabled<% end %>/>
<%- @Icon('checkbox', 'icon-unchecked') %>
<%- @Icon('checkbox-checked', 'icon-checked') %>
<span class="label-text"><%= permission.displayName() %> - <span class="help-text"><%- @T(permission.note) %></span></span>
<span class="label-text"><%= permission.displayName() %> - <span class="help-text"><%- @T.apply(@, [permission.note].concat(permission.preferences.translations)) %></span></span>
</label>
<% else: %>
<div style="padding-left: 20px;" class="js-subPermissionList">
@ -13,7 +13,7 @@
<input type="checkbox" value="<%= permission.id %>" name="permission_ids" <% if _.contains(@params.permission_ids, permission.id): %>checked<% end %> <% if permission.preferences.disabled: %>disabled<% end %>/>
<%- @Icon('checkbox', 'icon-unchecked') %>
<%- @Icon('checkbox-checked', 'icon-checked') %>
<span class="label-text"><%= permission.displayName().replace(/^.+?\./, '') %> - <span class="help-text"><%- @T(permission.note) %></span></span>
<span class="label-text"><%= permission.displayName().replace(/^.+?\./, '') %> - <span class="help-text"><%- @T.apply(@, [permission.note].concat(permission.preferences.translations)) %></span></span>
</label>
</div>
<% end %>