1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +02:00

Change space settings management into tab views

This commit is contained in:
Harvey Kandola 2018-06-05 14:04:14 +01:00
parent 738b3d94b6
commit 92f8fe550e
38 changed files with 683 additions and 411 deletions

View file

@ -1,104 +0,0 @@
<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;">
<div class="space-admin table-responsive">
<table class="table table-hover permission-table mb-3">
<thead>
<tr>
<th></th>
<th colspan="3">Spaces</th>
<th colspan="9" class="text-info">Documents</th>
</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>
<th class="text-info">Approval</th>
<th class="text-info">Lifecycle</th>
<th class="text-info">Versions</th>
</tr>
</thead>
<tbody>
{{#each spacePermissions as |permission|}}
<tr>
<td>
{{#if (eq permission.who "role")}}
<span class="button-icon-blue button-icon-small align-middle">
<i class="material-icons">people</i>
</span>
<span class="color-blue">&nbsp;{{permission.name}}
<small class="form-text text-muted d-inline-block">({{permission.members}})</small>
</span>
{{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}}
</td>
<td>{{input type="checkbox" id=(concat 'space-role-view-' permission.whoId) checked=permission.spaceView}}</td>
<td>{{input type="checkbox" id=(concat 'space-role-manage-' permission.whoId) checked=permission.spaceManage}}</td>
<td>{{input type="checkbox" id=(concat 'space-role-owner-' permission.whoId) checked=permission.spaceOwner}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-add-' permission.whoId) checked=permission.documentAdd}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-edit-' permission.whoId) checked=permission.documentEdit}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-delete-' permission.whoId) checked=permission.documentDelete}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-move-' permission.whoId) checked=permission.documentMove}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-copy-' permission.whoId) checked=permission.documentCopy}}</td>
<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}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-lifecycle-' permission.whoId) checked=permission.documentLifecycle}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-version-' permission.whoId) checked=permission.documentVersion}}</td>
</tr>
{{/each}}
</tbody>
</table>
<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>
<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>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,18 @@
<div class="content-zone">
<div class="explainer-header explainer-gap">Content blocks provide re-usable content that can be inserted into any document</div>
{{#each blocks as |block|}}
<div class="mb-5">
<h1>{{block.title}}</h1>
<p>{{block.excerpt}}</p>
<button type="button" class="btn btn-outline-success" onclick={{action 'onEdit' block.id}}>Edit</button>
<div class="button-gap" />
<button type="button" class="btn btn-outline-danger" onclick={{action 'onShowDeleteDialog' block.id}}>Delete</button>
</div>
{{/each}}
</div>
{{#if isSpaceAdmin}}
    {{#ui/ui-dialog title="Delete Content Block" confirmCaption="Delete" buttonType="btn-danger" show=showDeleteDialog onAction=(action 'onDeleteBlock')}}
        <p>Are you sure you want to delete this re-usable content block?</p>
    {{/ui/ui-dialog}}
{{/if}}

View file

@ -0,0 +1,25 @@
<div class="content-zone">
<div class="explainer-header explainer-gap">General options for this space</div>
<form>
<div class="form-group">
<label>Space Type</label>
{{ui-select id="spacetypes-dropdown" content=spaceTypeOptions optionValuePath="id" optionLabelPath="label" selection=spaceType action=(action 'onSetSpaceType')}}
</div>
<div class="form-group">
<label>Content Liking</label>
{{#if allowLikes}}
{{input type='text' id="space-likes-prompt" class="form-control" placeholder="Did this help you?" value=likes}}
<small class="form-text text-muted">Specify the prompt, e.g. Did this help you? Was this helpful? Did you find what you needed?</small>
<div class="mt-4">
<button type="button" class="btn btn-outline-danger" onclick={{action 'onSetLikes' false}}>Do not allow users to like content</button>
</div>
{{else}}
<div>
<button type="button" class="btn btn-outline-success" onclick={{action 'onSetLikes' true}}>Allow users to like content</button>
</div>
{{/if}}
</div>
</form>
<button type="button" class="btn btn-success mt-3" onclick={{action 'onSave'}}>Save</button>
</div>

View file

@ -0,0 +1,16 @@
<div class="content-zone">
<div class="explainer-header">Invite new users to this space</div>
<p class="explainer-text explainer-gap">Email invite leads to a smooth onboarding process</p>
<form onsubmit={{action 'onSpaceInvite'}}>
<div class="form-group">
<label for="space-invite-email">Email for space invitation</label>
{{input id="space-invite-email" type='email' class="form-control mousetrap" placeholder="Enter email" value=inviteEmail}}
<small class="form-text text-muted">Comma separate multiple email addresses</small>
</div>
<div class="form-group">
<label for="space-invite-msg">Message explaining space invitation</label>
{{textarea id="space-invite-msg" value=inviteMessage class="form-control" rows="5"}}
</div>
</form>
<button type="button" class="btn btn-success mt-3" onclick={{action 'onSpaceInvite'}}>Invite</button>
</div>

View file

@ -0,0 +1,113 @@
<div class="content-zone">
<div class="explainer-header">Space and document permissions for both users and groups</div>
<p class="explainer-text">Space level permissions:</p>
<ul class="explainer-list">
<li>View &mdash; see content within this space</li>
<li>Manage &mdash; manage all aspects of space except deletion</li>
<li>Owner &mdash; manage and delete space</li>
</ul>
<p class="explainer-text">Document level permissions:</p>
<ul class="explainer-list explainer-gap">
<li>Create &mdash; create new documents</li>
<li>Edit &mdash; edit documents</li>
<li>Delete &mdash; delete documents</li>
<li>Move &mdash; move content between documents</li>
<li>Copy &mdash; copy content between documents</li>
<li>Templates &mdash; create, edit, delete document templates and content blocks</li>
<li>Approval &mdash; approve or reject content changes</li>
<li>Lifecycle &mdash; mark documents as Draft, Live or Archived</li>
<li>Versions &mdash; create versions of documents (baselining)</li>
</ul>
</div>
<div class="space-admin table-responsive">
<table class="table table-hover permission-table mb-3">
<thead>
<tr>
<th></th>
<th colspan="3">Spaces</th>
<th colspan="9" class="text-info">Documents</th>
</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>
<th class="text-info">Approval</th>
<th class="text-info">Lifecycle</th>
<th class="text-info">Versions</th>
</tr>
</thead>
<tbody>
{{#each spacePermissions as |permission|}}
<tr>
<td>
{{#if (eq permission.who "role")}}
<span class="button-icon-blue button-icon-small align-middle">
<i class="material-icons">people</i>
</span>
<span class="color-blue">&nbsp;{{permission.name}}
<small class="form-text text-muted d-inline-block">({{permission.members}})</small>
</span>
{{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}}
</td>
<td>{{input type="checkbox" id=(concat 'space-role-view-' permission.whoId) checked=permission.spaceView}}</td>
<td>{{input type="checkbox" id=(concat 'space-role-manage-' permission.whoId) checked=permission.spaceManage}}</td>
<td>{{input type="checkbox" id=(concat 'space-role-owner-' permission.whoId) checked=permission.spaceOwner}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-add-' permission.whoId) checked=permission.documentAdd}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-edit-' permission.whoId) checked=permission.documentEdit}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-delete-' permission.whoId) checked=permission.documentDelete}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-move-' permission.whoId) checked=permission.documentMove}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-copy-' permission.whoId) checked=permission.documentCopy}}</td>
<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}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-lifecycle-' permission.whoId) checked=permission.documentLifecycle}}</td>
<td>{{input type="checkbox" id=(concat 'doc-role-version-' permission.whoId) checked=permission.documentVersion}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
<button type="button" class="btn btn-success my-3" onclick= {{action 'onSave'}}>Save</button>
<div class="container-fluid mt-5">
<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 for users by firstname, lastname, email" value=searchText key-up=(action 'onSearch')}}
<small class="form-text text-muted">Find and add users to this space</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>

View file

@ -0,0 +1,10 @@
<div class="content-zone">
<div class="explainer-header explainer-gap">Content Templates provide the basis for new documentation</div>
{{#each templates as |item|}}
<div class="mb-5">
<h1>{{item.title}}</h1>
<p>{{item.description}}</p>
<button type="button" class="btn btn-outline-success" onclick={{action 'onOpenTemplate' item.id}}>Open</button>
</div>
{{/each}}
</div>