1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-30 10:39:44 +02:00

Bring new UX to each admin view

This commit is contained in:
Harvey Kandola 2018-12-14 11:52:31 +00:00
parent ff1d737c68
commit edb256e754
26 changed files with 357 additions and 324 deletions

View file

@ -24,7 +24,7 @@ export default Component.extend(Notifier, {
testSMTP: null,
actions: {
saveSMTP(e) {
saveSMTP() {
if (this.get('SMTPHostEmptyError')) {
$("#smtp-host").focus();
return;

View file

@ -33,13 +33,11 @@ export default Component.extend(Notifier, Modals, {
init() {
this._super(...arguments);
this.loadData();
},
didReceiveAttrs() {
this._super(...arguments);
this.deleteSpace = {
id: '',
name: ''
@ -55,6 +53,7 @@ export default Component.extend(Notifier, Modals, {
actions: {
onShow(id) {
this.set('deleteSpace.id', id);
this.modalOpen("#space-delete-modal", {"show": true}, '#delete-space-name');
},
onDelete() {
@ -91,13 +90,13 @@ export default Component.extend(Notifier, Modals, {
this.get('documentSvc').export(spec).then((htmlExport) => {
this.get('browserSvc').downloadFile(htmlExport, 'documize.html');
this.notifySuccess('Exported');
this.notifySuccess('Export completed');
});
},
onOwner(spaceId) {
this.get('spaceSvc').grantOwnerPermission(spaceId).then(() => { /* jshint ignore:line */
this.notifySuccess('Saved');
this.notifySuccess('Added as owner');
});
}
}

View file

@ -195,6 +195,7 @@ let constants = EmberObject.extend({
},
Icon: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects
AddUser: 'dicon-add-27',
All: 'dicon-menu-8',
Announce: 'dicon-notification',
ArrowUp: 'dicon-arrow-up-2',
@ -225,6 +226,7 @@ let constants = EmberObject.extend({
Person: 'dicon-single-01',
People: 'dicon-multiple-19',
Remove: 'dicon-i-remove',
RemoveUser: 'dicon-delete-28',
Search: 'dicon-magnifier',
Send: 'dicon-send',
Settings: 'dicon-settings-gear',
@ -248,7 +250,9 @@ let constants = EmberObject.extend({
Delete: 'Delete',
Export: 'Export',
Insert: 'Insert',
Join : 'Join',
Next: 'Next',
Remove: 'Remove',
Reset: 'Reset',
Restore: 'Restore',
Save: 'Save',

View file

@ -9,7 +9,6 @@
//
// https://documize.com
import $ from 'jquery';
import { inject as service } from '@ember/service';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
import Route from '@ember/routing/route';
@ -37,10 +36,5 @@ export default Route.extend(AuthenticatedRouteMixin, {
activate() {
this.get('browser').setTitle('Share Space');
// $('body').addClass('background-color-gray-200');
},
deactivate() {
// $('body').removeClass('background-color-gray-200');
}
});

View file

@ -1,5 +1,5 @@
{{layout/logo-heading
title="Customize"
title="General"
desc="Options to help you customize Documize"
icon=constants.Icon.Settings}}

View file

@ -1,6 +1,6 @@
{{layout/logo-heading
title=(concat appMeta.edition " Edition " appMeta.version)
desc="Enterprise Edition provides premium features and comprehensive product support"
title="Documize Changelog"
desc=(concat "You are running "appMeta.edition " Edition " appMeta.version)
icon=constants.Icon.Announce}}
{{customize/change-log}}

View file

@ -60,7 +60,7 @@
{{/if}}
{{#link-to "customize.product" activeClass="selected" class="item" tagName="div"}}
<i class={{concat "dicon " constants.Icon.Announce}} />
<div class="name">Changelog</div>
<div class="name">Documize Changelog</div>
{{/link-to}}
</div>
</div>

View file

@ -414,3 +414,16 @@ icons
.dicon-notification::before {
content: "\ea4d";
}
.dicon-handshake::before {
content: "\ea4e";
}
.dicon-add-27::before {
content: "\ea4f";
}
.dicon-delete-28::before {
content: "\ea50";
}

View file

@ -10,7 +10,7 @@
@media (max-width: $display-break-1) {
div[class^="spacer-"] {
height: 1px;
height: 10px;
}
}

View file

@ -4,38 +4,39 @@
> .update-status {
padding: 25px;
background-color: map-get($yellow-shades, 100);
border: 1px solid map-get($yellow-shades, 200);
@include shadow();
border: 1px solid map-get($yellow-shades, 300);
@include border-radius(3px);
> .title {
font-weight: bold;
font-size: 1.5rem;
color: map-get($yellow-shades, 600);
margin-bottom: 15px;
color: map-get($yellow-shades, 800);
margin-bottom: 5px;
display:block;
}
> .instructions {
font-weight: 500;
font-size: 1.3rem;
font-size: 1.1rem;
color: map-get($gray-shades, 800);
margin-bottom: 30px;
}
> .links {
margin: 30px 0 0 0;
margin: 10px 0 0 0;
> p {
margin: 0.3rem 0;
> .edition-name {
font-size: 1.3rem;
font-size: 1.1rem;
font-weight: 400;
color: map-get($yellow-shades, 900);
}
> .link {
font-size: 1.3rem;
color: map-get($yellow-shades, 800);
font-size: 1.1rem;
color: map-get($yellow-shades, 600);
font-weight: 600;
}
}
@ -46,13 +47,12 @@
padding: 25px;
background-color: map-get($gray-shades, 100);
border: 1px solid map-get($gray-shades, 200);
@include shadow();
@include border-radius(3px);
> .version {
font-weight: 700;
font-size: 1.2rem;
color: map-get($yellow-shades, 700);
color: map-get($gray-shades, 700);
margin: 10px 0;
display: block;
}

View file

@ -53,14 +53,41 @@
}
> .space-list {
padding: 0;
margin: 3rem 0;
margin: 0;
padding: 0;
> .space {
margin: 15px 0;
padding: 15px 0;
font-size: 1.2rem;
color: $theme-500;
@include card();
list-style-type: none;
margin: 0 0 2rem 0;
padding: 15px 20px;
width: 100%;
> .info {
padding: 0;
> a {
> .name {
font-size: 1.3rem;
font-weight: 700;
color: map-get($gray-shades, 800);
> .dicon {
color: map-get($gray-shades, 600);
font-size: 20px;
vertical-align: middle;
margin-right: 10px;
}
}
> .desc {
font-size: 1.1rem;
font-weight: 400;
margin-top: 0.4rem;
color: $color-black-light-3;
}
}
}
}
}
@ -69,17 +96,23 @@
margin: 0;
> .group {
margin: 15px 0;
@include card();
list-style-type: none;
margin: 0 0 2rem 0;
padding: 15px 20px;
width: 100%;
.name {
color: $color-black-light-1;
> .name {
font-size: 1.3rem;
font-weight: 600;
font-weight: 700;
color: map-get($gray-shades, 800);
}
> .purpose {
font-size: 1rem;
color: map-get($gray-shades, 600);
}
> .desc {
font-size: 1.1rem;
font-weight: 400;
margin-top: 0.4rem;
color: $color-black-light-3;
}
}
}
@ -87,11 +120,11 @@
// used for group admin
> .group-users-members {
> .item {
margin: 10px 0;
margin: 5px 0;
> .fullname {
color: $theme-500;
font-size: 1.2rem;
color: map-get($gray-shades, 800);
font-size: 1rem;
}
}
}
@ -149,7 +182,7 @@
border: 1px solid map-get($green-shades, 200);
padding: 20px 20px;
background-color: map-get($green-shades, 100);
color: $color-black-light-1;
color: map-get($green-shades, 700);
> .backup-fail {
margin: 10px 0;
@ -168,7 +201,7 @@
margin: 50px 0;
padding: 20px 20px;
background-color: map-get($red-shades, 100);
color: $color-black-light-1;
color: map-get($red-shades, 700);
> .restore-fail {
margin: 10px 0;

View file

@ -10,9 +10,9 @@
@include border-radius(3px);
margin: 0 0 15px 0;
padding: 10px 15px;
color: map-get($gray-shades, 600);
color: map-get($gray-shades, 700);
background-color: map-get($gray-shades, 100);
border: 1px solid map-get($gray-shades, 600);
border: 1px solid map-get($gray-shades, 200);
cursor: pointer;
position: relative;
list-style-type: none;
@ -20,13 +20,12 @@
&:hover {
> .text-header, > .text {
color: $color-black-light-1;
color: map-get($gray-shades, 800);
}
}
> .text-header {
@include ease-in();
color: map-get($gray-shades, 600);
font-size: 1.3rem;
font-weight: 600;
margin-bottom: 5px;
@ -38,9 +37,8 @@
> .text {
@include ease-in();
color: map-get($gray-shades, 600);
font-size: 1rem;
font-weight: 500;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -51,7 +49,7 @@
position: absolute;
top: 10px;
right: 10px;
color: map-get($green-shades, 600);
color: map-get($yellow-shades, 800);
font-weight: 700;
font-size: 1.3rem;
}
@ -59,11 +57,11 @@
> .selected {
> .text-header, > .text {
color: $color-black-light-1;
color: map-get($yellow-shades, 800) !important;
}
background-color: map-get($yellow-shades, 700) !important;
border: 1px solid map-get($yellow-shades, 700) !important;
background-color: map-get($yellow-shades, 100) !important;
border: 1px solid map-get($yellow-shades, 300) !important;
}
}
}

View file

@ -163,7 +163,7 @@
{{ui/ui-button-gap}}
{{/if}}
{{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Activate onClick=(action "onSave")}}
{{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Locked label=constants.Label.Activate onClick=(action "onSave")}}
</form>
{{#if (gt keycloakFailure.length 0)}}

View file

@ -26,10 +26,10 @@
{{#if backupRunning}}
<h3 class="text-success">Backup running, please wait...</h3>
{{else}}
{{ui/ui-button color=constants.Color.Yellow light=true label=(concat "TENANT BACKUP (" appMeta.appHost ")") onClick=(action "onBackup")}}
{{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Database label=(concat "BACKUP TENANT (" appMeta.appHost ")") onClick=(action "onBackup")}}
{{#if session.isGlobalAdmin}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Green light=true label="SYSTEM BACKUP" onClick=(action "onSystemBackup")}}
{{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Database label="BACKUP SYSTEM" onClick=(action "onSystemBackup")}}
{{/if}}
{{/if}}
{{#if backupFailed}}
@ -44,7 +44,7 @@
<div class="backup-restore">
<div class="restore-zone">
{{#if session.isGlobalAdmin}}
<p class="text-danger">Restore from a <b>system backup</b> should only be performed on an <b>empty Documize database.</b></p>
<p>Restore from a <b>system backup</b> should only be performed on an <b>empty Documize database.</b></p>
{{/if}}
<p>Restore operation will <b>re-create</b> users, groups, permissions, spaces, categories and content.</p>
<p>It can take <b>several minutes</b> to complete the restore process &mdash; please be patient while the restore operation is in progress.</p>
@ -63,7 +63,7 @@
<div class="restore-success">Restore completed &mdash; restart your browser and log in</div>
{{else}}
{{#if restoreUploadReady}}
{{ui/ui-button color=constants.Color.Red light=false label=restoreButtonLabel onClick=(action "onShowRestoreModal")}}
{{ui/ui-button color=constants.Color.Red light=false icon=constants.Icon.Database label=restoreButtonLabel onClick=(action "onShowRestoreModal")}}
{{/if}}
{{/if}}
</div>

View file

@ -11,13 +11,13 @@
<small class="form-text text-muted">Provide short message explaining this Documize instance</small>
</div>
<div class="form-group">
<label>Anonymous Access</label>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="allowAnonymousAccess" checked={{model.general.allowAnonymousAccess}}>
<label class="form-check-label" for="allowAnonymousAccess">
Make content marked as "Everyone" available to anonymous users
</label>
</div>
<label>Site Theme</label>
{{ui/theme-picker onChange=(action "onThemeChange")}}
<small class="form-text text-muted">Users can set their own theme under Profile</small>
</div>
<div class="form-group">
<label>Public Spaces Viewable By Anonymous Users</label>
{{x-toggle value=model.general.allowAnonymousAccess size="medium" theme="light" onToggle=(action (mut model.general.allowAnonymousAccess))}}
</div>
<div class="form-group">
<label for="conversionEndpoint">Conversion Service URL</label>
@ -41,12 +41,7 @@
</select>
<small class="form-text text-muted">How many tags can be assigned to a document (between 3 and 10 tags)</small>
</div>
<div class="form-group">
<label>Default Site Theme</label>
{{ui/theme-picker onChange=(action "onThemeChange")}}
<small class="form-text text-muted">Users can set their own theme under Profile</small>
</div>
{{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Save onClick=(action "save")}}
{{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Settings label=constants.Label.Save onClick=(action "save")}}
</form>
</div>

View file

@ -28,6 +28,6 @@
</div>
{{/if}}
{{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Save onClick=(action "onSave")}}
{{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Integrations label=constants.Label.Save onClick=(action "onSave")}}
</form>
</div>

View file

@ -2,7 +2,7 @@
<form>
<div class="form-group">
<p>It can take up to 30 minutes to rebuild the search index.</p>
{{ui/ui-button color=constants.Color.Yellow light=true label=buttonLabel onClick=(action "reindex")}}
{{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Search label=buttonLabel onClick=(action "reindex")}}
</div>
</form>
</div>

View file

@ -31,26 +31,17 @@
<small class="form-text text-muted">e.g. Documize</small>
</div>
<div class="form-group">
<label>Anonymous</label>
<div class="form-check">
{{input id="smtp-anonymous" type="checkbox" checked=model.smtp.anonymous class="form-check-input"}}
<label class="form-check-label" for="smtp-anonymous">Anonymous authentication, ignore Username and Password fields</label>
</div>
<label>Anonymous Authentication (Ignore Credentials)</label>
{{x-toggle value=model.smtp.anonymous size="medium" theme="light" onToggle=(action (mut model.smtp.anonymous))}}
</div>
<div class="form-group">
<label>Base64</label>
<div class="form-check">
{{input id="smtp-base64creds" type="checkbox" checked=model.smtp.base64creds class="form-check-input"}}
<label class="form-check-label" for="smtp-base64creds">Base64 encode Username and Password fields</label>
</div>
<label>Base64 Encode Credentials</label>
{{x-toggle value=model.smtp.base64creds size="medium" theme="light" onToggle=(action (mut model.smtp.base64creds))}}
</div>
<div class="form-group">
<label>SSL</label>
<div class="form-check">
{{input id="smtp-usessl" type="checkbox" checked=model.smtp.usessl class="form-check-input"}}
<label class="form-check-label" for="smtp-usessl">Use SSL</label>
</div>
<label>Use SSL</label>
{{x-toggle value=model.smtp.usessl size="medium" theme="light" onToggle=(action (mut model.smtp.usessl))}}
</div>
{{ui/ui-button color=constants.Color.Green light=true label=buttonText onClick=(action "saveSMTP")}}
{{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Send label=buttonText onClick=(action "saveSMTP")}}
</form>
</div>

View file

@ -1,53 +1,68 @@
<div class="view-customize">
{{#if spaces}}
{{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Export label=constants.Label.Export onClick=(action "onExport")}}
{{#if spaces}}
{{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.Export label="Export All Content" onClick=(action "onExport")}}
{{ui/ui-spacer size=300}}
<div class="space-list">
<div class="view-customize">
<ul class="space-list">
{{#each spaces as |space|}}
<div class="space row">
<div class="col-12 col-sm-8">
{{#link-to "folder" space.id space.slug class="alt"}}{{space.name}}{{/link-to}}
</div>
<div class="col-12 col-sm-4 text-right">
<div id="space-ownership-button-{{space.id}}" class="button-icon-gray align-middle" {{action "onOwner" space.id}}>
<i class="material-icons" data-toggle="modal">person_add</i>
{{#attach-tooltip showDelay=1000}}Add myself as space owner{{/attach-tooltip}}
</div>
<div class="button-icon-gap" />
<div id="space-delete-button-{{space.id}}" class="button-icon-danger align-middle" {{action "onShow" space.id}}>
<i class="material-icons" data-toggle="modal" data-target="#space-delete-modal" data-backdrop="static">delete</i>
{{#attach-tooltip showDelay=1000}}Delete space and all content{{/attach-tooltip}}
</div>
</div>
</div>
{{/each}}
</div>
<div id="space-delete-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Space Deletion</div>
<div class="modal-body">
<form onsubmit={{action "onDelete"}}>
<p>Are you sure you want to delete this space and all documents?</p>
<div class="form-group">
<label for="delete-space-name">Please type space name to confirm</label>
{{input type="text" id="delete-space-name" class="form-control mousetrap" placeholder="Space name" value=deleteSpace.name}}
<small class="form-text text-muted">This will delete all documents and templates within this space!</small>
<li class="space">
<div class="info">
{{#link-to "folder.index" space.id space.slug}}
<div class="name">
{{#if (eq space.spaceType constants.SpaceType.Public)}}
<i class={{concat "dicon " constants.Icon.World}}>
{{#attach-tooltip showDelay=1000}}Public space{{/attach-tooltip}}
</i>
{{/if}}
{{#if (eq space.spaceType constants.SpaceType.Protected)}}
<i class={{concat "dicon " constants.Icon.People}}>
{{#attach-tooltip showDelay=1000}}Protected space{{/attach-tooltip}}
</i>
{{/if}}
{{#if (eq space.spaceType constants.SpaceType.Private)}}
<i class={{concat "dicon " constants.Icon.Person}}>
{{#attach-tooltip showDelay=1000}}Personal space{{/attach-tooltip}}
</i>
{{/if}}
{{space.name}}
</div>
</form>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Cancel dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Delete onClick=(action "onDelete")}}
<div class="desc">Some description that is to be wired up to the backend</div>
{{/link-to}}
{{ui/ui-spacer size=200}}
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}}
{{ui/ui-toolbar-icon icon=constants.Icon.AddUser color=constants.Color.Green tooltip="Add myself as owner" onClick=(action "onOwner" space.id)}}
{{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip="Delete space" onClick=(action "onShow" space.id)}}
{{/ui/ui-toolbar}}
</div>
</li>
{{/each}}
</ul>
</div>
<div id="space-delete-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Space Deletion</div>
<div class="modal-body">
<form onsubmit={{action "onDelete"}}>
<p>Are you sure you want to delete this space and all documents?</p>
<div class="form-group">
<label for="delete-space-name">Please type space name to confirm</label>
{{input type="text" id="delete-space-name" class="form-control mousetrap" placeholder="Space name" value=deleteSpace.name}}
<small class="form-text text-muted">This will delete all documents and templates within this space!</small>
</div>
</form>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Cancel dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Delete onClick=(action "onDelete")}}
</div>
</div>
</div>
{{else}}
<p>There are no shared spaces to manage</p>
{{/if}}
</div>
</div>
{{else}}
<p>There are no shared spaces to manage</p>
{{/if}}

View file

@ -1,213 +1,196 @@
<div class="row">
<div class="col">
<div class="view-customize">
{{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.People label=constants.Label.Add onClick=(action "onShowAddGroupModal")}}
{{ui/ui-spacer size=300}}
<div id="add-group-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Add Group</div>
<div class="modal-body">
<form onsubmit= {{action "onAddGroup"}}>
<div class="form-group">
<label for="new-group-name">Name</label>
{{focus-input id="new-group-name" type="text" class="form-control mousetrap" placeholder="Enter group name" value=newGroup.name}}
<small class="form-text text-muted">e.g. Managers, Developers, Acme Team</small>
</div>
<div class="form-group">
<label for="new-group-desc">Description (optional)</label>
{{textarea id="new-group-desc" value=newGroup.purpose class="form-control" rows="3"}}
</div>
</form>
<div class="view-customize">
{{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.People label=constants.Label.Add onClick=(action "onShowAddGroupModal")}}
<div id="add-group-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Add Group</div>
<div class="modal-body">
<form onsubmit= {{action "onAddGroup"}}>
<div class="form-group">
<label for="new-group-name">Name</label>
{{focus-input id="new-group-name" type="text" class="form-control mousetrap" placeholder="Enter group name" value=newGroup.name}}
<small class="form-text text-muted">e.g. Managers, Developers, Acme Team</small>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Add onClick=(action "onAddGroup")}}
<div class="form-group">
<label for="new-group-desc">Description (optional)</label>
{{textarea id="new-group-desc" value=newGroup.purpose class="form-control" rows="3"}}
</div>
</div>
</form>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Add onClick=(action "onAddGroup")}}
</div>
</div>
</div>
</div>
<p>Put these as cards with nice action CTAs</p>
<div class="groups-list">
{{#each groups as |group|}}
<div class="row group">
<div class="col-8">
<div class="name">
{{group.name}} ({{group.members}})
{{#if group.purpose}}
<div class="purpose">{{group.purpose}}</div>
{{/if}}
</div>
</div>
<div class="col-4 buttons text-right">
<button class="btn btn-primary" {{action "onShowAddMemberModal" group.id}}>Add Member</button>
{{#if (gt group.members 0)}}
<div class="button-icon-gap" />
<button class="btn btn-danger" {{action "onShowRemoveMemberModal" group.id}}>Remove Member</button>
{{/if}}
<div class="button-icon-gap" />
<div class="button-icon-gray align-middle" {{action "onShowEditModal" group.id}}>
<i class="material-icons">edit</i>
{{#attach-tooltip showDelay=1000}}Edit group{{/attach-tooltip}}
</div>
<div class="button-icon-gap" />
<div class="button-icon-danger align-middle" {{action "onShowDeleteModal" group.id}}>
<i class="material-icons">delete</i>
{{#attach-tooltip showDelay=1000}}Delete group{{/attach-tooltip}}
</div>
</div>
</div>
{{else}}
<div class="margin-top-30">
<i>No groups</i>
</div>
{{/each}}
{{ui/ui-spacer size=300}}
<div class="groups-list">
{{#each groups as |group|}}
<div class="group">
<div class="name">
{{group.name}} ({{group.members}})
</div>
<div class="desc">{{group.purpose}}</div>
{{ui/ui-spacer size=200}}
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}}
{{ui/ui-toolbar-icon icon=constants.Icon.AddUser color=constants.Color.Gray tooltip="Add members" onClick=(action "onShowAddMemberModal" group.id)}}
{{#if (gt group.members 0)}}
{{ui/ui-toolbar-icon icon=constants.Icon.RemoveUser color=constants.Color.Gray tooltip="Remove members" onClick=(action "onShowRemoveMemberModal" group.id)}}
{{/if}}
{{ui/ui-toolbar-icon icon=constants.Icon.Edit color=constants.Color.Gray tooltip="Edit group" onClick=(action "onShowEditModal" group.id)}}
{{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red tooltip="Delete group" onClick=(action "onShowDeleteModal" group.id)}}
{{/ui/ui-toolbar}}
</div>
{{/each}}
</div>
<div id="delete-group-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Delete Group</div>
<div class="modal-body">
<form onsubmit= {{action "onDeleteGroup"}}>
<p>Are you sure you want to delete this group?</p>
<div class="form-group">
<label for="delete-group-name">Please type group name to confirm</label>
{{input id="delete-group-name" type="text" class="form-control mousetrap" placeholder="Group name" value=deleteGroup.name}}
<small class="form-text text-muted">This will remove group membership information and associated permissions!</small>
</div>
</form>
<div id="delete-group-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Delete Group</div>
<div class="modal-body">
<form onsubmit= {{action "onDeleteGroup"}}>
<p>Are you sure you want to delete this group?</p>
<div class="form-group">
<label for="delete-group-name">Please type group name to confirm</label>
{{input id="delete-group-name" type="text" class="form-control mousetrap" placeholder="Group name" value=deleteGroup.name}}
<small class="form-text text-muted">This will remove group membership information and associated permissions!</small>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Delete onClick=(action "onDeleteGroup")}}
</div>
</div>
</form>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Red light=true label=constants.Label.Delete onClick=(action "onDeleteGroup")}}
</div>
</div>
</div>
</div>
<div id="edit-group-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Edit Group</div>
<div class="modal-body">
<form onsubmit= {{action "onEditGroup"}}>
<div class="form-group">
<label for="edit-group-name">Name</label>
{{input id="edit-group-name" type="text" class="form-control mousetrap" placeholder="Enter group name" value=editGroup.name}}
<small class="form-text text-muted">e.g. Managers, Developers, Acme Team</small>
</div>
<div class="form-group">
<label for="edit-group-desc">Description (optional)</label>
{{textarea id="edit-group-desc" value=editGroup.purpose class="form-control" rows="3"}}
</div>
</form>
<div id="edit-group-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Edit Group</div>
<div class="modal-body">
<form onsubmit= {{action "onEditGroup"}}>
<div class="form-group">
<label for="edit-group-name">Name</label>
{{input id="edit-group-name" type="text" class="form-control mousetrap" placeholder="Enter group name" value=editGroup.name}}
<small class="form-text text-muted">e.g. Managers, Developers, Acme Team</small>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Save onClick=(action "onEditGroup")}}
<div class="form-group">
<label for="edit-group-desc">Description (optional)</label>
{{textarea id="edit-group-desc" value=editGroup.purpose class="form-control" rows="3"}}
</div>
</div>
</form>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{ui/ui-button-gap}}
{{ui/ui-button color=constants.Color.Green light=true label=constants.Label.Save onClick=(action "onEditGroup")}}
</div>
</div>
</div>
</div>
<div id="group-remove-member-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">Remove Member &mdash; {{membersGroup.name}} ({{members.length}})</div>
<div class="modal-body">
<div class="view-customize">
<div class="group-users-members my-5">
{{#each members as |member|}}
<div class="row item">
<div class="col-10 fullname">{{member.fullname}}</div>
<div class="col-2 text-right">
<button class="btn btn-danger" {{action "onLeaveGroup" member.userId}}>Remove</button>
</div>
</div>
{{/each}}
</div>
</div>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
</div>
</div>
</div>
</div>
<div id="group-add-member-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">Add Member &mdash; {{membersGroup.name}} ({{members.length}})</div>
<div class="modal-body">
<div class="form-group">
<label for="group-members-search">Search users to join this group</label>
{{input id="group-members-search" type="text" class="form-control mousetrap" placeholder="Search members and users..." value=searchText key-up=(action "onSearch")}}
<small class="form-text text-muted">search firstname, lastname, email</small>
</div>
<div class="view-customize">
<div class="text-center">
<div class="btn-group btn-group-toggle">
{{#attach-tooltip showDelay=1000}}Number of users to display{{/attach-tooltip}}
<label class="btn btn-outline-secondary {{if (eq userLimit 1) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 1}}>1
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 10) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 10}}>10
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 25) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 25}}>25
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 50) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 50}}>50
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 100) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 100}}>100
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 250) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 250}}>250
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 500) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 500}}>500
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 1000) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 1000}}>1,000
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 99999) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 99999}}>all
</label>
<div id="group-remove-member-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">Remove Member &mdash; {{membersGroup.name}} ({{members.length}})</div>
<div class="modal-body">
<div class="view-customize">
<div class="group-users-members my-5">
{{#each members as |member|}}
<div class="row item">
<div class="col-10 fullname">{{member.fullname}}</div>
<div class="col-2 text-right">
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}}
{{ui/ui-toolbar-icon icon=constants.Icon.RemoveUser color=constants.Color.Red tooltip="Remove member" onClick=(action "onLeaveGroup" member.userId)}}
{{/ui/ui-toolbar}}
</div>
</div>
<div class="clearfix" />
<div class="group-users-members my-5">
{{#each users as |user|}}
<div class="row item">
<div class="col-10 fullname">{{user.firstname}} {{user.lastname}}</div>
<div class="col-2 text-right">
{{#if user.isMember}}
<button class="btn btn-danger" {{action "onLeaveGroup" user.id}}>Remove</button>
{{else}}
<button class="btn btn-success" {{action "onJoinGroup" user.id}}>Add</button>
{{/if}}
</div>
</div>
{{/each}}
</div>
</div>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
{{/each}}
</div>
</div>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
</div>
</div>
</div>
</div>
<div id="group-add-member-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">Add Member &mdash; {{membersGroup.name}} ({{members.length}})</div>
<div class="modal-body">
<div class="form-group">
<label for="group-members-search">Search users to join this group</label>
{{input id="group-members-search" type="text" class="form-control mousetrap" placeholder="Search members and users..." value=searchText key-up=(action "onSearch")}}
<small class="form-text text-muted">search firstname, lastname, email</small>
</div>
<div class="view-customize">
<div class="text-center">
<div class="btn-group btn-group-toggle">
{{#attach-tooltip showDelay=1000}}Number of users to display{{/attach-tooltip}}
<label class="btn btn-outline-secondary {{if (eq userLimit 1) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 1}}>1
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 10) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 10}}>10
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 25) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 25}}>25
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 50) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 50}}>50
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 100) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 100}}>100
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 250) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 250}}>250
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 500) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 500}}>500
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 1000) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 1000}}>1,000
</label>
<label class="btn btn-outline-secondary {{if (eq userLimit 99999) "active"}}">
<input type="radio" name="options" autocomplete="off" {{action "onLimit" 99999}}>all
</label>
</div>
</div>
<div class="clearfix" />
<div class="group-users-members my-5">
{{#each users as |user|}}
<div class="row item">
<div class="col-10 fullname">{{user.firstname}} {{user.lastname}}</div>
<div class="col-2 text-right">
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}}
{{#if user.isMember}}
{{ui/ui-toolbar-icon icon=constants.Icon.RemoveUser color=constants.Color.Red tooltip="Remove member" onClick=(action "onLeaveGroup" user.id)}}
{{else}}
{{ui/ui-toolbar-icon icon=constants.Icon.AddUser color=constants.Color.Green tooltip="Add member" onClick=(action "onJoinGroup" user.id)}}
{{/if}}
{{/ui/ui-toolbar}}
</div>
</div>
{{/each}}
</div>
</div>
</div>
<div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
</div>
</div>
</div>
</div>
</div>

View file

@ -6,7 +6,6 @@
{{yield}}
</div>
<div class="modal-footer">
{{outlet "buttons"}}
</div>
</div>
</div>