diff --git a/gui/app/components/toolbar/t-links.js b/gui/app/components/toolbar/t-links.js index 90d1dbad..25e46cde 100644 --- a/gui/app/components/toolbar/t-links.js +++ b/gui/app/components/toolbar/t-links.js @@ -9,8 +9,11 @@ // // https://documize.com +import { inject as service } from '@ember/service'; import Component from '@ember/component'; export default Component.extend({ - classNames: ['col', 'col-sm-8'] + appMeta: service(), + classNames: ['col', 'col-sm-8'], + selectItem: '', }); diff --git a/gui/app/pods/customize/controller.js b/gui/app/pods/customize/controller.js index f0b1abcb..92741c49 100644 --- a/gui/app/pods/customize/controller.js +++ b/gui/app/pods/customize/controller.js @@ -1,14 +1,17 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// 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 . +// by contacting . // // https://documize.com +import { inject as service } from '@ember/service'; import Controller from '@ember/controller'; -export default Controller.extend({}); \ No newline at end of file +export default Controller.extend({ + appMeta: service() +}); diff --git a/gui/app/pods/customize/route.js b/gui/app/pods/customize/route.js index eb97c753..235b5fc5 100644 --- a/gui/app/pods/customize/route.js +++ b/gui/app/pods/customize/route.js @@ -9,8 +9,8 @@ // // https://documize.com -import Route from '@ember/routing/route'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; +import Route from '@ember/routing/route'; export default Route.extend(AuthenticatedRouteMixin, { beforeModel: function (transition) { diff --git a/gui/app/pods/customize/template.hbs b/gui/app/pods/customize/template.hbs index cf9e826d..4c920632 100644 --- a/gui/app/pods/customize/template.hbs +++ b/gui/app/pods/customize/template.hbs @@ -2,7 +2,6 @@ {{#toolbar/t-toolbar}} {{#toolbar/t-links}} - {{#link-to "folders" class="link" tagName="li" }}Spaces{{/link-to}} {{/toolbar/t-links}} {{#toolbar/t-actions}} {{/toolbar/t-actions}} @@ -21,8 +20,13 @@ {{#link-to 'customize.license' activeClass='selected' class="tab" tagName="li" }}License{{/link-to}} {{#link-to 'customize.auth' activeClass='selected' class="tab" tagName="li" }}Authentication{{/link-to}} {{#link-to 'customize.search' activeClass='selected' class="tab" tagName="li" }}Search{{/link-to}} + {{#if (eq appMeta.edition 'Enterprise')}} + {{#link-to 'customize.audit' activeClass='selected' class="tab" tagName="li" }}Audit{{/link-to}} + {{/if}} + {{/if}} + {{#if (eq appMeta.edition 'Enterprise')}} + {{#link-to 'customize.archive' activeClass='selected' class="tab" tagName="li" }}Archive{{/link-to}} {{/if}} - {{#link-to 'customize.archive' activeClass='selected' class="tab" tagName="li" }}Archive{{/link-to}} diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index 3107d076..d8e2487c 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -1,4 +1,6 @@ -{{toolbar/nav-bar}} {{toolbar/for-document document=document spaces=folders space=folder +{{toolbar/nav-bar}} + +{{toolbar/for-document document=document spaces=folders space=folder permissions=permissions roles=roles tab=tab versions=versions onDocumentDelete=(action 'onDocumentDelete') onSaveTemplate=(action 'onSaveTemplate') diff --git a/gui/app/pods/folder/category/template.hbs b/gui/app/pods/folder/category/template.hbs index 3d5398e6..288561b5 100644 --- a/gui/app/pods/folder/category/template.hbs +++ b/gui/app/pods/folder/category/template.hbs @@ -2,8 +2,7 @@ {{#toolbar/t-toolbar}} {{#toolbar/t-links}} - {{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}} - {{#link-to "folder" model.folder.id model.folder.slug class="link" tagName="li"}}{{model.folder.name}}{{/link-to}} + {{#link-to "folder" model.folder.id model.folder.slug class="link selected" tagName="li"}}{{model.folder.name}}{{/link-to}} {{/toolbar/t-links}} {{/toolbar/t-toolbar}} diff --git a/gui/app/pods/profile/template.hbs b/gui/app/pods/profile/template.hbs index db3ccf63..6628943c 100644 --- a/gui/app/pods/profile/template.hbs +++ b/gui/app/pods/profile/template.hbs @@ -2,7 +2,6 @@ {{#toolbar/t-toolbar}} {{#toolbar/t-links}} - {{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}} {{/toolbar/t-links}} {{#toolbar/t-actions}} {{/toolbar/t-actions}} diff --git a/gui/app/pods/search/template.hbs b/gui/app/pods/search/template.hbs index 5f2fc3fa..a9261804 100644 --- a/gui/app/pods/search/template.hbs +++ b/gui/app/pods/search/template.hbs @@ -2,7 +2,6 @@ {{#toolbar/t-toolbar}} {{#toolbar/t-links}} - {{#link-to "folders" class="link" tagName="li" }}Spaces{{/link-to}} {{/toolbar/t-links}} {{#toolbar/t-actions}} {{/toolbar/t-actions}} diff --git a/gui/app/services/ajax.js b/gui/app/services/ajax.js index 989dfe33..02172260 100644 --- a/gui/app/services/ajax.js +++ b/gui/app/services/ajax.js @@ -40,15 +40,15 @@ export default AjaxService.extend({ // when unauthorized on local API AJAX calls, redirect to app root if (status === 401 && is.not.undefined(appVersion) && is.not.includes(window.location.href, '/auth')) { - this.get('localStorage').clearAll(); + this.get('localStorage').clearAll(); window.location.href = 'auth/login'; } if (is.not.empty(userUpdate)) { let latest = JSON.parse(userUpdate); - if (!latest.active || user.editor !== latest.editor || user.admin !== latest.admin || user.viewUsers !== latest.viewUsers) { - this.get('localStorage').clearAll(); + if (!latest.active || user.editor !== latest.editor || user.admin !== latest.admin || user.analytics !== latest.analytics || user.viewUsers !== latest.viewUsers) { + this.get('localStorage').clearAll(); window.location.href = 'auth/login'; } } diff --git a/gui/app/styles/view/toolbar.scss b/gui/app/styles/view/toolbar.scss index b7ce4e8b..e067dbef 100644 --- a/gui/app/styles/view/toolbar.scss +++ b/gui/app/styles/view/toolbar.scss @@ -4,7 +4,7 @@ > .links { display: inlne-block; - > .link { + > .link, div > .link { color: $color-gray; font-size: 1.1rem; font-weight: bold; @@ -20,7 +20,7 @@ } } - > .selected { + > .selected, div > .link { color: $color-link; } } diff --git a/gui/app/templates/components/toolbar/for-document.hbs b/gui/app/templates/components/toolbar/for-document.hbs index f6fde5c7..81c112ac 100644 --- a/gui/app/templates/components/toolbar/for-document.hbs +++ b/gui/app/templates/components/toolbar/for-document.hbs @@ -1,8 +1,7 @@ {{#toolbar/t-toolbar}} {{#toolbar/t-links}} - {{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}} - {{#link-to "folder" space.id space.slug class="link" tagName="li"}}{{space.name}}{{/link-to}} + {{#link-to "folder" space.id space.slug class="link selected" tagName="li"}}{{space.name}}{{/link-to}} {{#if showDocumentLink}} {{#link-to 'document.index' space.id space.slug document.id document.slug class="link"}}{{document.name}}{{/link-to}} {{/if}} diff --git a/gui/app/templates/components/toolbar/for-space.hbs b/gui/app/templates/components/toolbar/for-space.hbs index fd8a2fd2..7ac56115 100644 --- a/gui/app/templates/components/toolbar/for-space.hbs +++ b/gui/app/templates/components/toolbar/for-space.hbs @@ -1,7 +1,6 @@ {{#toolbar/t-toolbar}} - {{#toolbar/t-links}} - {{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}} + {{#toolbar/t-links selectItem="spaces"}} {{/toolbar/t-links}} {{#toolbar/t-actions}} diff --git a/gui/app/templates/components/toolbar/for-spaces.hbs b/gui/app/templates/components/toolbar/for-spaces.hbs index e300a0c5..f196abaf 100644 --- a/gui/app/templates/components/toolbar/for-spaces.hbs +++ b/gui/app/templates/components/toolbar/for-spaces.hbs @@ -1,6 +1,5 @@ {{#toolbar/t-toolbar}} - {{#toolbar/t-links}} - {{#link-to "folders" class="link selected" tagName="li"}}Spaces{{/link-to}} + {{#toolbar/t-links selectItem="spaces"}} {{/toolbar/t-links}} {{#toolbar/t-actions}} {{#if session.isEditor}} diff --git a/gui/app/templates/components/toolbar/nav-bar.hbs b/gui/app/templates/components/toolbar/nav-bar.hbs index 6effa031..ebcea609 100644 --- a/gui/app/templates/components/toolbar/nav-bar.hbs +++ b/gui/app/templates/components/toolbar/nav-bar.hbs @@ -141,7 +141,7 @@ diff --git a/gui/app/templates/components/toolbar/t-links.hbs b/gui/app/templates/components/toolbar/t-links.hbs index 1e1adf4f..c032c86e 100644 --- a/gui/app/templates/components/toolbar/t-links.hbs +++ b/gui/app/templates/components/toolbar/t-links.hbs @@ -1,5 +1,15 @@