1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 14:49:42 +02:00
documize/gui/app/templates/components/folder/permission-admin.hbs

121 lines
4.6 KiB
Handlebars
Raw Normal View History

2017-11-24 12:50:06 +00:00
<div id="space-permission-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-80">
<div class="modal-content">
<div class="modal-header">Space Permissions</div>
<div class="modal-body" style="overflow-x: auto;">
2017-12-15 13:41:20 +00:00
<div class="space-admin table-responsive">
2018-03-05 12:47:42 +00:00
<table class="table table-hover permission-table mb-3">
2017-11-24 12:50:06 +00:00
<thead>
<tr>
<th></th>
<th colspan="3">Spaces</th>
2017-12-24 15:51:43 +00:00
<th colspan="7" class="text-info">Documents</th>
2017-11-24 12:50:06 +00:00
</tr>
<tr>
<th></th>
<th>View</th>
<th>Manage</th>
<th>Owner</th>
<th class="text-info">Create</th>
<th class="text-info">Edit</th>
<th class="text-info">Delete</th>
<th class="text-info">Move</th>
<th class="text-info">Copy</th>
<th class="text-info">Templates</th>
2017-12-24 15:51:43 +00:00
<th class="text-info">Approval</th>
2017-11-24 12:50:06 +00:00
</tr>
</thead>
<tbody>
{{#each spacePermissions as |permission|}}
2017-11-24 12:50:06 +00:00
<tr>
<td>
{{#if (eq permission.who "role")}}
2018-03-05 12:47:42 +00:00
<span class="button-icon-blue button-icon-small align-middle">
<i class="material-icons">people</i>
</span>
2018-03-05 12:47:42 +00:00
<span class="color-blue">&nbsp;{{permission.name}}
<small class="form-text text-muted d-inline-block">({{permission.members}})</small>
</span>
2018-03-05 12:47:42 +00:00
{{else}}
{{#if (eq permission.whoId constants.EveryoneUserId)}}
<span class="button-icon-green button-icon-small align-middle">
<i class="material-icons">language</i>
</span>
<span class="color-green">&nbsp;{{permission.name}}</span>
{{else}}
<span class="button-icon-gray button-icon-small align-middle">
<i class="material-icons">person</i>
</span>
<span class="">&nbsp;{{permission.name}}
{{#if (eq permission.whoId session.user.id)}}
<small class="form-text text-muted d-inline-block">(you)</small>
{{/if}}
</span>
{{/if}}
{{/if}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'space-role-view-' permission.whoId) checked=permission.spaceView}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'space-role-manage-' permission.whoId) checked=permission.spaceManage}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'space-role-owner-' permission.whoId) checked=permission.spaceOwner}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'doc-role-add-' permission.whoId) checked=permission.documentAdd}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'doc-role-edit-' permission.whoId) checked=permission.documentEdit}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'doc-role-delete-' permission.whoId) checked=permission.documentDelete}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'doc-role-move-' permission.whoId) checked=permission.documentMove}}
2017-11-24 12:50:06 +00:00
</td>
<td>
{{input type="checkbox" id=(concat 'doc-role-copy-' permission.whoId) checked=permission.documentCopy}}
2017-11-24 12:50:06 +00:00
</td>
2017-12-24 15:51:43 +00:00
<td>
{{input type="checkbox" id=(concat 'doc-role-template-' permission.whoId) checked=permission.documentTemplate}}
</td>
<td>
{{input type="checkbox" id=(concat 'doc-role-approve-' permission.whoId) checked=permission.documentApprove}}
2017-12-24 15:51:43 +00:00
</td>
2017-11-24 12:50:06 +00:00
</tr>
{{/each}}
</tbody>
</table>
2018-03-05 12:47:42 +00:00
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-6">
<div class="form-group">
{{focus-input id="user-search" type="text" class="form-control mousetrap" placeholder="Search users..." value=searchText key-up=(action 'onSearch')}}
<small class="form-text text-muted">firstname, lastname, email</small>
</div>
{{#each filteredUsers as |user|}}
<div class="row my-3">
<div class="col-10">{{user.fullname}}</div>
<div class="col-2 text-right">
<button class="btn btn-primary" {{action 'onAdd' user}}>Add</button>
</div>
</div>
{{/each}}
</div>
</div>
</div>
</div>
</div>
2017-11-24 12:50:06 +00:00
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" onclick={{action 'setPermissions'}}>Save</button>
2017-09-13 19:22:38 +01:00
</div>
</div>
</div>
</div>