diff --git a/gui/app/components/customize/user-admin.js b/gui/app/components/customize/user-admin.js index b8ee2474..ec4ae92d 100644 --- a/gui/app/components/customize/user-admin.js +++ b/gui/app/components/customize/user-admin.js @@ -12,9 +12,10 @@ import $ from 'jquery'; import AuthProvider from '../../mixins/auth'; import ModalMixin from '../../mixins/modal'; +import Notifier from '../../mixins/notifier'; import Component from '@ember/component'; -export default Component.extend(AuthProvider, ModalMixin, { +export default Component.extend(AuthProvider, ModalMixin, Notifier, { bulkUsers: '', newUser: null, @@ -51,6 +52,7 @@ export default Component.extend(AuthProvider, ModalMixin, { this.get('onAddUser')(user).then(() => { this.set('newUser', { firstname: '', lastname: '', email: '', active: true }); + this.notifySuccess('Added user'); }); this.modalClose("#add-user-modal"); @@ -65,6 +67,7 @@ export default Component.extend(AuthProvider, ModalMixin, { this.get('onAddUsers')(this.get('bulkUsers')).then(() => { this.set('bulkUsers', ''); + this.notifySuccess('Added users'); }); this.modalClose("#add-user-modal"); diff --git a/gui/app/components/customize/user-list.js b/gui/app/components/customize/user-list.js index 2e90a8d7..d19fb411 100644 --- a/gui/app/components/customize/user-list.js +++ b/gui/app/components/customize/user-list.js @@ -15,9 +15,10 @@ import { inject as service } from '@ember/service'; import { schedule, debounce } from '@ember/runloop'; import AuthProvider from '../../mixins/auth'; import ModalMixin from '../../mixins/modal'; +import Notifier from '../../mixins/notifier'; import Component from '@ember/component'; -export default Component.extend(AuthProvider, ModalMixin, { +export default Component.extend(AuthProvider, ModalMixin, Notifier, { groupSvc: service('group'), editUser: null, deleteUser: null, @@ -171,9 +172,15 @@ export default Component.extend(AuthProvider, ModalMixin, { let cb = this.get('onDelete'); cb(this.get('deleteUser.id')); + this.notifySuccess("Deleted user"); + return true; }, + onShowDeleteBulk() { + this.modalOpen("#admin-user-delete-modal", {"show": true}); + }, + onBulkDelete() { let su = this.get('selectedUsers'); @@ -185,6 +192,8 @@ export default Component.extend(AuthProvider, ModalMixin, { this.set('selectedUsers', []); this.set('hasSelectedUsers', false); + this.notifySuccess("Deleted selected users"); + this.modalClose('#admin-user-delete-modal'); }, diff --git a/gui/app/components/ui/ui-dialog.js b/gui/app/components/ui/ui-dialog.js index 8e6447a5..c4391ee6 100644 --- a/gui/app/components/ui/ui-dialog.js +++ b/gui/app/components/ui/ui-dialog.js @@ -19,7 +19,6 @@ export default Component.extend({ confirmCaption: 'OK', title: 'Confirm', show: false, - buttonType: 'btn-secondary', size: '', // modal-lg, modal-sm didInsertElement() { diff --git a/gui/app/components/ui/ui-toolbar-icon.js b/gui/app/components/ui/ui-toolbar-icon.js index 3d5189e4..e1c497c4 100644 --- a/gui/app/components/ui/ui-toolbar-icon.js +++ b/gui/app/components/ui/ui-toolbar-icon.js @@ -40,8 +40,7 @@ export default Component.extend({ return; } if (is.not.undefined(this.linkTo)) { - // TODO: - // Pass in linkModel, linkOptions + // TODO: pass in linkModel, linkOptions // https://emberjs.com/api/ember/3.5/classes/RouterService/methods/transitionTo?anchor=transitionTo this.router.transitionTo(this.linkTo); } diff --git a/gui/app/components/ui/ui-toolbar-label.js b/gui/app/components/ui/ui-toolbar-label.js new file mode 100644 index 00000000..a940d019 --- /dev/null +++ b/gui/app/components/ui/ui-toolbar-label.js @@ -0,0 +1,44 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import { inject as service } from '@ember/service'; +import { computed } from '@ember/object'; +import Component from '@ember/component'; + +export default Component.extend({ + router: service(), + tagName: 'div', + classNames: ['label'], + classNameBindings: ['calcClass'], + + color: '', + label: '', + tooltip: '', + + calcClass: computed(function() { + let c = ''; + if (this.color !== '') c += this.color + ' '; + + return c.trim(); + }), + + click(e) { + if (is.not.undefined(this.onClick)) { + this.onClick(e); + return; + } + if (is.not.undefined(this.linkTo)) { + // TODO: pass in linkModel, linkOptions + // https://emberjs.com/api/ember/3.5/classes/RouterService/methods/transitionTo?anchor=transitionTo + this.router.transitionTo(this.linkTo); + } + } +}); diff --git a/gui/app/components/ui/ui-toolbar.js b/gui/app/components/ui/ui-toolbar.js index 2cad3a46..85f69921 100644 --- a/gui/app/components/ui/ui-toolbar.js +++ b/gui/app/components/ui/ui-toolbar.js @@ -24,7 +24,5 @@ export default Component.extend({ bordered: false, dark: false, light: false, - - actions: { - } + tooltip: '' }); diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index ff9a8a22..288e1375 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -206,6 +206,8 @@ let constants = EmberObject.extend({ BarChart: 'dicon-chart-bar-2', Bookmark: 'dicon-bookmark', ButtonAction: 'button-2', + Checkbox: 'dicon-shape-rectangle', + CheckboxChecked: 'dicon-i-check', Database: 'dicon-database', Download: 'dicon-download', Delete: 'dicon-bin', @@ -220,6 +222,7 @@ let constants = EmberObject.extend({ Integrations: 'dicon-geometry', ListBullet: 'dicon-list-bullet-2', Locked: 'dicon-lock', + NotAllowed: 'dicon-ban', Print: 'dicon-print', Pulse: 'dicon-pulse', Plus: 'dicon-e-add', @@ -250,7 +253,8 @@ let constants = EmberObject.extend({ Delete: 'Delete', Export: 'Export', Insert: 'Insert', - Join : 'Join', + Join: 'Join', + Leave: 'Leave', Next: 'Next', Remove: 'Remove', Reset: 'Reset', diff --git a/gui/app/styles/core/icon.scss b/gui/app/styles/core/icon.scss index 6b785b52..e32da72a 100644 --- a/gui/app/styles/core/icon.scss +++ b/gui/app/styles/core/icon.scss @@ -427,3 +427,14 @@ icons content: "\ea50"; } + .dicon-i-check::before { + content: "\ea51"; + } + + .dicon-shape-rectangle::before { + content: "\ea52"; + } + + .dicon-ban::before { + content: "\ea53"; + } diff --git a/gui/app/styles/core/ui/ui-toolbar.scss b/gui/app/styles/core/ui/ui-toolbar.scss index a3611d69..5ee5b8ba 100644 --- a/gui/app/styles/core/ui/ui-toolbar.scss +++ b/gui/app/styles/core/ui/ui-toolbar.scss @@ -3,13 +3,16 @@ } .dmz-toolbar { - display: inline-block; + display: inline-flex; + // flex: 0 1 auto; + flex-basis: auto; text-align: center; white-space: nowrap; vertical-align: middle; border: 1px solid transparent; height: 30px; - padding: 5px 10px; + width: auto; + padding: 6px 10px; line-height: 24px; @extend .no-select; @include border-radius(6px); @@ -18,7 +21,7 @@ font-size: 16px; font-weight: 500; color: map-get($gray-shades, 600); - padding: 0 0.25rem; + padding: 0 0.5rem; cursor: pointer; &:hover { @@ -26,6 +29,16 @@ } } + > .label { + // display: inline-block; + font-size: 14px; + font-weight: 500; + color: map-get($gray-shades, 600); + padding: 0 0.5rem; + align-self: center; + cursor: pointer; + } + > .red { color: map-get($red-shades, 500); @@ -53,7 +66,7 @@ .dmz-toolbar-large { height: 40px; - padding: 7px 10px; + padding: 9px 10px; line-height: 33px; > .dicon { diff --git a/gui/app/styles/core/util.scss b/gui/app/styles/core/util.scss index 07341552..d8b978d1 100644 --- a/gui/app/styles/core/util.scss +++ b/gui/app/styles/core/util.scss @@ -10,25 +10,13 @@ // https://documize.com a { - // @include ease-in(); + cursor: pointer; color: $color-link; text-decoration: none; - cursor: pointer; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - a:focus, - a:hover { - text-decoration: none; - } -} - -a.admin-link { - text-decoration: none; - font-weight: bold; - - a:focus, - a:hover { + a:focus, a:hover { text-decoration: none; } } @@ -86,3 +74,34 @@ a.broken-link { border: 1px solid map-get($gray-shades, 300); } +.hide { + display: none; +} + +.display-block { + display: block; +} + +.display-inline-block { + display: inline-block; +} + +.visible { + visibility: visible; +} + +.invisible { + visibility: none; +} + +.align-top { + vertical-align: top!important; +} + +.align-middle { + vertical-align: middle!important; +} + +.text-center { + text-align: center; +} diff --git a/gui/app/styles/core/view/customize.scss b/gui/app/styles/core/view/customize.scss index 6c393e66..09f1e3c1 100644 --- a/gui/app/styles/core/view/customize.scss +++ b/gui/app/styles/core/view/customize.scss @@ -1,4 +1,31 @@ .view-customize { + + > .explain-user-perms { + padding: 15px 25px; + background-color: map-get($yellow-shades, 100); + border: 1px solid map-get($yellow-shades, 300); + @include border-radius(3px); + + > .title { + font-weight: 700; + font-size: 1.1rem; + color: map-get($yellow-shades, 800); + } + + > .perm-name { + font-size: 1rem; + font-weight: 600; + color: map-get($gray-shades, 800); + margin-top: 10px; + } + + > .perm-desc { + font-size: 0.9rem; + font-weight: 300; + color: map-get($gray-shades, 800); + } + } + .user-table { tbody tr td, thead tr th { border-top: none !important; @@ -6,49 +33,53 @@ } .name { - font-size: 1.2rem; - font-weight: bold; - color: $color-link; + font-size: 1.1rem; + font-weight: 500; + color: map-get($gray-shades, 900); margin: 0 0 0 10px; display: inline-block; cursor: pointer; > .email { - font-size: 0.9rem; - color: $color-black-light-1; + font-size: 1rem; + font-weight: 400; + color: map-get($gray-shades, 800); margin: 0; - display: inline-block; - font-weight: normal; + display: block; } } .groups { - cursor: pointer; - margin: 5px 0 0 10px; font-size: 1rem; - color: map-get($gray-shades, 600); + font-weight: 300; + color: map-get($yellow-shades, 900); + cursor: pointer; + margin: 0 0 0 10px; &:hover { color: $color-link; } } - .inactive-user - { - color: map-get($red-shades, 600); - font-weight: normal; - text-decoration: line-through; + .inactive-user { + > .name, > .name > .email, > .groups { + color: map-get($red-shades, 600) !important; + font-weight: normal !important; + text-decoration: line-through !important; + } } - .admin-user - { - color: map-get($green-shades, 600); - font-weight: normal; + .admin-user { + > .name, > .name > .email, > .groups { + color: map-get($green-shades, 600); + font-weight: 600; + } } - .checkbox { - color: map-get($gray-shades, 900); + .user-checkbox { + color: map-get($green-shades, 700); cursor: pointer; + font-weight: 600; } } @@ -119,8 +150,11 @@ // used for group admin > .group-users-members { + text-align: center; + > .item { - margin: 5px 0; + margin: 7px; + display: inline-block; > .fullname { color: map-get($gray-shades, 800); @@ -135,10 +169,11 @@ margin: 10px 0; > .group-name { - color: $theme-500; - font-size: 1.2rem; + color: map-get($gray-shades, 800); + font-size: 1rem; > .group-purpose { + color: map-get($gray-shades, 700); font-size: 0.9rem; } } @@ -169,10 +204,6 @@ } } - > .max-results { - float: right; - } - > .backup-restore { margin: 20px 0; font-size: 1.1rem; diff --git a/gui/app/templates/components/customize/user-admin.hbs b/gui/app/templates/components/customize/user-admin.hbs index 6c50b2d7..3dd6ccce 100644 --- a/gui/app/templates/components/customize/user-admin.hbs +++ b/gui/app/templates/components/customize/user-admin.hbs @@ -3,11 +3,10 @@
{{#if isAuthProviderDocumize}} {{ui/ui-button color=constants.Color.Green light=true icon=constants.Icon.Person label=constants.Label.Add onClick=(action "onOpenUserModal")}} - {{/if}} -
diff --git a/gui/app/templates/components/customize/user-groups.hbs b/gui/app/templates/components/customize/user-groups.hbs index 520f574d..48e1c131 100644 --- a/gui/app/templates/components/customize/user-groups.hbs +++ b/gui/app/templates/components/customize/user-groups.hbs @@ -103,15 +103,13 @@