1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 21:29:42 +02:00

Refactoring fof nav elements across both editions

This commit is contained in:
McMatts 2018-04-05 20:01:10 +01:00
parent 5fb41e9fb1
commit c92ab3a589
15 changed files with 40 additions and 24 deletions

View file

@ -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: '',
});

View file

@ -1,14 +1,17 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
// by contacting <sales@documize.com>.
//
// https://documize.com
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
export default Controller.extend({});
export default Controller.extend({
appMeta: service()
});

View file

@ -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) {

View file

@ -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}}
</ul>
</div>
</div>

View file

@ -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')

View file

@ -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}}

View file

@ -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}}

View file

@ -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}}

View file

@ -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';
}
}

View file

@ -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;
}
}

View file

@ -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}}

View file

@ -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}}

View file

@ -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}}

View file

@ -141,7 +141,7 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>

View file

@ -1,5 +1,15 @@
<div class="toolbar">
<ul class="links">
{{#if (eq appMeta.edition 'Community')}}
{{#link-to "folders" class=(if (eq selectItem 'spaces') 'link selected' 'link') tagName="li"}}Spaces{{/link-to}}
{{/if}}
{{#if (eq appMeta.edition 'Enterprise')}}
{{#if session.isEditor}}
{{#link-to "dashboard" class=(if (eq selectItem 'dashboard') 'link selected' 'link') tagName="li"}}Actions{{/link-to}}
{{#link-to "analytics" class=(if (eq selectItem 'analytics') 'link selected' 'link') tagName="li"}}Insights{{/link-to}}
{{/if}}
{{#link-to "folders" class=(if (eq selectItem 'spaces') 'link selected' 'link') tagName="li"}}Spaces{{/link-to}}
{{/if}}
{{yield}}
</ul>
</div>