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

Spaces view

This commit is contained in:
Harvey Kandola 2018-05-23 15:57:30 +01:00
parent 95323c90ee
commit a453052087
7 changed files with 88 additions and 94 deletions

View file

@ -10,11 +10,11 @@
// https://documize.com // https://documize.com
import $ from 'jquery'; import $ from 'jquery';
import Component from '@ember/component';
import { schedule } from '@ember/runloop'; import { schedule } from '@ember/runloop';
import { notEmpty } from '@ember/object/computed'; import { notEmpty } from '@ember/object/computed';
import NotifierMixin from '../../mixins/notifier'; import NotifierMixin from '../../mixins/notifier';
import AuthMixin from '../../mixins/auth'; import AuthMixin from '../../mixins/auth';
import Component from '@ember/component';
export default Component.extend(NotifierMixin, AuthMixin, { export default Component.extend(NotifierMixin, AuthMixin, {
spaceName: '', spaceName: '',
@ -24,11 +24,6 @@ export default Component.extend(NotifierMixin, AuthMixin, {
hasClone: notEmpty('clonedSpace.id'), hasClone: notEmpty('clonedSpace.id'),
clonedSpace: null, clonedSpace: null,
init() {
this._super(...arguments);
// this.clonedSpace = { id: '' };
},
didInsertElement() { didInsertElement() {
this._super(...arguments); this._super(...arguments);

View file

@ -26,7 +26,9 @@
{{#if (eq appMeta.edition 'Enterprise')}} {{#if (eq appMeta.edition 'Enterprise')}}
{{#link-to 'customize.archive' activeClass='selected' class="tab tab-vertical" tagName="li" }}Archive{{/link-to}} {{#link-to 'customize.archive' activeClass='selected' class="tab tab-vertical" tagName="li" }}Archive{{/link-to}}
{{/if}} {{/if}}
{{#link-to 'customize.license' activeClass='selected' class="tab tab-vertical" tagName="li" }}Product{{/link-to}} {{#if session.isGlobalAdmin}}
{{#link-to 'customize.license' activeClass='selected' class="tab tab-vertical" tagName="li" }}Product{{/link-to}}
{{/if}}
</ul> </ul>
</div> </div>
{{/layout/middle-zone-sidebar}} {{/layout/middle-zone-sidebar}}

View file

@ -13,6 +13,7 @@ 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(),
folderService: service('folder'), folderService: service('folder'),
actions: { actions: {

View file

@ -1,5 +1,19 @@
{{toolbar/nav-bar}} {{#layout/top-bar}}
{{/layout/top-bar}}
{{toolbar/for-spaces spaces=model onAddSpace=(action 'onAddSpace')}} {{#layout/middle-zone}}
{{#layout/middle-zone-content}}
{{spaces/space-list spaces=model}}
{{/layout/middle-zone-content}}
{{spaces/space-list spaces=model}} {{#layout/middle-zone-sidebar}}
<div id="sidebar" class="sidebar">
<h1>{{appMeta.title}}</h1>
<p>{{appMeta.message}}</p>
{{toolbar/for-spaces spaces=model onAddSpace=(action 'onAddSpace')}}
</div>
{{/layout/middle-zone-sidebar}}
{{/layout/middle-zone}}
{{#layout/bottom-bar}}
{{/layout/bottom-bar}}

View file

@ -36,8 +36,6 @@
<div class="dropdown-menu" aria-labelledby="top-nav-hamburger"> <div class="dropdown-menu" aria-labelledby="top-nav-hamburger">
{{#if (eq appMeta.edition 'Community')}} {{#if (eq appMeta.edition 'Community')}}
{{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}} {{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}}
{{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}}
{{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}}
{{/if}} {{/if}}
{{#if (eq appMeta.edition 'Enterprise')}} {{#if (eq appMeta.edition 'Enterprise')}}
{{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}} {{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}}

View file

@ -1,49 +1,39 @@
<div class="container"> <div class="view-spaces">
<div class="row"> <div class="heading">EVERYONE <div class="counter">({{publicFolders.length}})</div></div>
<div class="col"> {{#unless hasPublicFolders}}
<div class="mt-4 mb-5"> <p class="empty">No global spaces</p>
{{/unless}}
<ul class="list clearfix">
{{#each publicFolders as |folder|}}
{{#link-to 'folder.index' folder.id folder.slug}}
<li class="item">{{ folder.name }}</li>
{{/link-to}}
{{/each}}
</ul>
<div class="view-spaces"> {{#if session.authenticated}}
<div class="heading">EVERYONE <div class="counter">({{publicFolders.length}})</div></div> <div class="heading">TEAM <div class="counter">({{protectedFolders.length}})</div></div>
{{#unless hasPublicFolders}} {{#unless hasProtectedFolders}}
<p class="empty">No global spaces</p> <p class="empty">No team spaces</p>
{{/unless}} {{/unless}}
<ul class="list clearfix"> <ul class="list clearfix">
{{#each publicFolders as |folder|}} {{#each protectedFolders as |folder|}}
{{#link-to 'folder.index' folder.id folder.slug}} {{#link-to 'folder.index' folder.id folder.slug}}
<li class="item">{{ folder.name }}</li> <li class="item">{{ folder.name }}</li>
{{/link-to}} {{/link-to}}
{{/each}} {{/each}}
</ul> </ul>
{{#if session.authenticated}} <div class="heading">PERSONAL <div class="counter">({{privateFolders.length}})</div></div>
<div class="heading">TEAM <div class="counter">({{protectedFolders.length}})</div></div> {{#unless hasPrivateFolders}}
{{#unless hasProtectedFolders}} <p class="empty">No personal spaces</p>
<p class="empty">No team spaces</p> {{/unless}}
{{/unless}} <ul class="list clearfix">
<ul class="list clearfix"> {{#each privateFolders as |folder|}}
{{#each protectedFolders as |folder|}} {{#link-to 'folder.index' folder.id folder.slug}}
{{#link-to 'folder.index' folder.id folder.slug}} <li class="item">{{ folder.name }}</li>
<li class="item">{{ folder.name }}</li> {{/link-to}}
{{/link-to}} {{/each}}
{{/each}} </ul>
</ul> {{/if}}
<div class="heading">PERSONAL <div class="counter">({{privateFolders.length}})</div></div>
{{#unless hasPrivateFolders}}
<p class="empty">No personal spaces</p>
{{/unless}}
<ul class="list clearfix">
{{#each privateFolders as |folder|}}
{{#link-to 'folder.index' folder.id folder.slug}}
<li class="item">{{ folder.name }}</li>
{{/link-to}}
{{/each}}
</ul>
{{/if}}
</div>
</div>
</div>
</div>
</div> </div>

View file

@ -1,40 +1,34 @@
{{#toolbar/t-toolbar}} {{#if session.isEditor}}
{{#toolbar/t-links selectItem="spaces"}} <button type="button" class="btn btn-success font-weight-bold my-3" data-toggle="modal" data-target="#add-space-modal" data-backdrop="static">+ SPACE</button>
{{/toolbar/t-links}} <div class="modal" tabindex="-1" role="dialog" id="add-space-modal">
{{#toolbar/t-actions}} <div class="modal-dialog" role="document">
{{#if session.isEditor}} <div class="modal-content">
<button type="button" class="btn btn-success font-weight-bold" data-toggle="modal" data-target="#add-space-modal" data-backdrop="static">+ SPACE</button> <div class="modal-header">Add Space</div>
<div class="modal" tabindex="-1" role="dialog" id="add-space-modal"> <div class="modal-body">
<div class="modal-dialog" role="document"> <form onsubmit={{action 'onAddSpace'}}>
<div class="modal-content"> <div class="form-group">
<div class="modal-header">Add Space</div> <label for="new-space-name">Space Name</label>
<div class="modal-body"> {{input type='text' id="new-space-name" class="form-control mousetrap" placeholder="Space name" value=spaceName}}
<form onsubmit={{action 'onAddSpace'}}> <small id="emailHelp" class="form-text text-muted">Characters and numbers only</small>
<div class="form-group">
<label for="new-space-name">Space Name</label>
{{input type='text' id="new-space-name" class="form-control mousetrap" placeholder="Space name" value=spaceName}}
<small id="emailHelp" class="form-text text-muted">Characters and numbers only</small>
</div>
<div class="form-group">
<label for="clone-space-dropdown">Clone Space</label>
{{ui-select id="clone-space-dropdown" content=spaces prompt="select space" action=(action 'onCloneSpaceSelect') optionValuePath="id" optionLabelPath="name" selection=clonedSpace}}
<small id="emailHelp" class="form-text text-muted">Copy templates, permissions, documents from existing space</small>
<div class="margin-top-10" />
{{#if hasClone}}
{{#ui/ui-checkbox selected=copyTemplate}}Copy templates{{/ui/ui-checkbox}}
{{#ui/ui-checkbox selected=copyPermission}}Copy permissions{{/ui/ui-checkbox}}
{{#ui/ui-checkbox selected=copyDocument}}Copy documents{{/ui/ui-checkbox}}
{{/if}}
</div>
</form>
</div> </div>
<div class="modal-footer"> <div class="form-group">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button> <label for="clone-space-dropdown">Clone Space</label>
<button type="button" class="btn btn-success" onclick={{action 'onAddSpace'}}>Add</button> {{ui-select id="clone-space-dropdown" content=spaces prompt="select space" action=(action 'onCloneSpaceSelect') optionValuePath="id" optionLabelPath="name" selection=clonedSpace}}
<small id="emailHelp" class="form-text text-muted">Copy templates, permissions, documents from existing space</small>
<div class="margin-top-10" />
{{#if hasClone}}
{{#ui/ui-checkbox selected=copyTemplate}}Copy templates{{/ui/ui-checkbox}}
{{#ui/ui-checkbox selected=copyPermission}}Copy permissions{{/ui/ui-checkbox}}
{{#ui/ui-checkbox selected=copyDocument}}Copy documents{{/ui/ui-checkbox}}
{{/if}}
</div> </div>
</div> </form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" onclick={{action 'onAddSpace'}}>Add</button>
</div> </div>
</div> </div>
{{/if}} </div>
{{/toolbar/t-actions}} </div>
{{/toolbar/t-toolbar}} {{/if}}