mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
Refactoring fof nav elements across both editions
This commit is contained in:
parent
5fb41e9fb1
commit
c92ab3a589
15 changed files with 40 additions and 24 deletions
|
@ -9,8 +9,11 @@
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ['col', 'col-sm-8']
|
appMeta: service(),
|
||||||
|
classNames: ['col', 'col-sm-8'],
|
||||||
|
selectItem: '',
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
|
|
||||||
export default Controller.extend({});
|
export default Controller.extend({
|
||||||
|
appMeta: service()
|
||||||
|
});
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
import Route from '@ember/routing/route';
|
|
||||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||||
|
import Route from '@ember/routing/route';
|
||||||
|
|
||||||
export default Route.extend(AuthenticatedRouteMixin, {
|
export default Route.extend(AuthenticatedRouteMixin, {
|
||||||
beforeModel: function (transition) {
|
beforeModel: function (transition) {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links}}
|
||||||
{{#link-to "folders" class="link" tagName="li" }}Spaces{{/link-to}}
|
|
||||||
{{/toolbar/t-links}}
|
{{/toolbar/t-links}}
|
||||||
{{#toolbar/t-actions}}
|
{{#toolbar/t-actions}}
|
||||||
{{/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.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.auth' activeClass='selected' class="tab" tagName="li" }}Authentication{{/link-to}}
|
||||||
{{#link-to 'customize.search' activeClass='selected' class="tab" tagName="li" }}Search{{/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}}
|
{{/if}}
|
||||||
{{#link-to 'customize.archive' activeClass='selected' class="tab" tagName="li" }}Archive{{/link-to}}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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
|
permissions=permissions roles=roles tab=tab versions=versions
|
||||||
onDocumentDelete=(action 'onDocumentDelete')
|
onDocumentDelete=(action 'onDocumentDelete')
|
||||||
onSaveTemplate=(action 'onSaveTemplate')
|
onSaveTemplate=(action 'onSaveTemplate')
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links}}
|
||||||
{{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}}
|
{{#link-to "folder" model.folder.id model.folder.slug class="link selected" tagName="li"}}{{model.folder.name}}{{/link-to}}
|
||||||
{{#link-to "folder" model.folder.id model.folder.slug class="link" tagName="li"}}{{model.folder.name}}{{/link-to}}
|
|
||||||
{{/toolbar/t-links}}
|
{{/toolbar/t-links}}
|
||||||
{{/toolbar/t-toolbar}}
|
{{/toolbar/t-toolbar}}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links}}
|
||||||
{{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}}
|
|
||||||
{{/toolbar/t-links}}
|
{{/toolbar/t-links}}
|
||||||
{{#toolbar/t-actions}}
|
{{#toolbar/t-actions}}
|
||||||
{{/toolbar/t-actions}}
|
{{/toolbar/t-actions}}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links}}
|
||||||
{{#link-to "folders" class="link" tagName="li" }}Spaces{{/link-to}}
|
|
||||||
{{/toolbar/t-links}}
|
{{/toolbar/t-links}}
|
||||||
{{#toolbar/t-actions}}
|
{{#toolbar/t-actions}}
|
||||||
{{/toolbar/t-actions}}
|
{{/toolbar/t-actions}}
|
||||||
|
|
|
@ -47,7 +47,7 @@ export default AjaxService.extend({
|
||||||
if (is.not.empty(userUpdate)) {
|
if (is.not.empty(userUpdate)) {
|
||||||
let latest = JSON.parse(userUpdate);
|
let latest = JSON.parse(userUpdate);
|
||||||
|
|
||||||
if (!latest.active || user.editor !== latest.editor || user.admin !== latest.admin || user.viewUsers !== latest.viewUsers) {
|
if (!latest.active || user.editor !== latest.editor || user.admin !== latest.admin || user.analytics !== latest.analytics || user.viewUsers !== latest.viewUsers) {
|
||||||
this.get('localStorage').clearAll();
|
this.get('localStorage').clearAll();
|
||||||
window.location.href = 'auth/login';
|
window.location.href = 'auth/login';
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
> .links {
|
> .links {
|
||||||
display: inlne-block;
|
display: inlne-block;
|
||||||
|
|
||||||
> .link {
|
> .link, div > .link {
|
||||||
color: $color-gray;
|
color: $color-gray;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .selected {
|
> .selected, div > .link {
|
||||||
color: $color-link;
|
color: $color-link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
|
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links}}
|
||||||
{{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}}
|
{{#link-to "folder" space.id space.slug class="link selected" tagName="li"}}{{space.name}}{{/link-to}}
|
||||||
{{#link-to "folder" space.id space.slug class="link" tagName="li"}}{{space.name}}{{/link-to}}
|
|
||||||
{{#if showDocumentLink}}
|
{{#if showDocumentLink}}
|
||||||
{{#link-to 'document.index' space.id space.slug document.id document.slug class="link"}}{{document.name}}{{/link-to}}
|
{{#link-to 'document.index' space.id space.slug document.id document.slug class="link"}}{{document.name}}{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
|
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links selectItem="spaces"}}
|
||||||
{{#link-to "folders" class="link" tagName="li"}}Spaces{{/link-to}}
|
|
||||||
{{/toolbar/t-links}}
|
{{/toolbar/t-links}}
|
||||||
|
|
||||||
{{#toolbar/t-actions}}
|
{{#toolbar/t-actions}}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{{#toolbar/t-toolbar}}
|
{{#toolbar/t-toolbar}}
|
||||||
{{#toolbar/t-links}}
|
{{#toolbar/t-links selectItem="spaces"}}
|
||||||
{{#link-to "folders" class="link selected" tagName="li"}}Spaces{{/link-to}}
|
|
||||||
{{/toolbar/t-links}}
|
{{/toolbar/t-links}}
|
||||||
{{#toolbar/t-actions}}
|
{{#toolbar/t-actions}}
|
||||||
{{#if session.isEditor}}
|
{{#if session.isEditor}}
|
||||||
|
|
|
@ -141,7 +141,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<ul class="links">
|
<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}}
|
{{yield}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue