mirror of
https://github.com/documize/community.git
synced 2025-07-23 15:19:42 +02:00
Spaces view
This commit is contained in:
parent
95323c90ee
commit
a453052087
7 changed files with 88 additions and 94 deletions
|
@ -10,11 +10,11 @@
|
|||
// https://documize.com
|
||||
|
||||
import $ from 'jquery';
|
||||
import Component from '@ember/component';
|
||||
import { schedule } from '@ember/runloop';
|
||||
import { notEmpty } from '@ember/object/computed';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(NotifierMixin, AuthMixin, {
|
||||
spaceName: '',
|
||||
|
@ -24,11 +24,6 @@ export default Component.extend(NotifierMixin, AuthMixin, {
|
|||
hasClone: notEmpty('clonedSpace.id'),
|
||||
clonedSpace: null,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
// this.clonedSpace = { id: '' };
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
|
|
@ -26,7 +26,9 @@
|
|||
{{#if (eq appMeta.edition 'Enterprise')}}
|
||||
{{#link-to 'customize.archive' activeClass='selected' class="tab tab-vertical" tagName="li" }}Archive{{/link-to}}
|
||||
{{/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>
|
||||
</div>
|
||||
{{/layout/middle-zone-sidebar}}
|
||||
|
|
|
@ -13,6 +13,7 @@ import { inject as service } from '@ember/service';
|
|||
import Controller from '@ember/controller';
|
||||
|
||||
export default Controller.extend({
|
||||
appMeta: service(),
|
||||
folderService: service('folder'),
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -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}}
|
|
@ -36,8 +36,6 @@
|
|||
<div class="dropdown-menu" aria-labelledby="top-nav-hamburger">
|
||||
{{#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}}
|
||||
{{/if}}
|
||||
{{#if (eq appMeta.edition 'Enterprise')}}
|
||||
{{#link-to "folders" class="dropdown-item"}}Spaces{{/link-to}}
|
||||
|
|
|
@ -1,49 +1,39 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-4 mb-5">
|
||||
<div class="view-spaces">
|
||||
<div class="heading">EVERYONE <div class="counter">({{publicFolders.length}})</div></div>
|
||||
{{#unless hasPublicFolders}}
|
||||
<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">
|
||||
<div class="heading">EVERYONE <div class="counter">({{publicFolders.length}})</div></div>
|
||||
{{#unless hasPublicFolders}}
|
||||
<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>
|
||||
{{#if session.authenticated}}
|
||||
<div class="heading">TEAM <div class="counter">({{protectedFolders.length}})</div></div>
|
||||
{{#unless hasProtectedFolders}}
|
||||
<p class="empty">No team spaces</p>
|
||||
{{/unless}}
|
||||
<ul class="list clearfix">
|
||||
{{#each protectedFolders as |folder|}}
|
||||
{{#link-to 'folder.index' folder.id folder.slug}}
|
||||
<li class="item">{{ folder.name }}</li>
|
||||
{{/link-to}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
{{#if session.authenticated}}
|
||||
<div class="heading">TEAM <div class="counter">({{protectedFolders.length}})</div></div>
|
||||
{{#unless hasProtectedFolders}}
|
||||
<p class="empty">No team spaces</p>
|
||||
{{/unless}}
|
||||
<ul class="list clearfix">
|
||||
{{#each protectedFolders as |folder|}}
|
||||
{{#link-to 'folder.index' folder.id folder.slug}}
|
||||
<li class="item">{{ folder.name }}</li>
|
||||
{{/link-to}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<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 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>
|
||||
|
|
|
@ -1,40 +1,34 @@
|
|||
{{#toolbar/t-toolbar}}
|
||||
{{#toolbar/t-links selectItem="spaces"}}
|
||||
{{/toolbar/t-links}}
|
||||
{{#toolbar/t-actions}}
|
||||
{{#if session.isEditor}}
|
||||
<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" tabindex="-1" role="dialog" id="add-space-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Add Space</div>
|
||||
<div class="modal-body">
|
||||
<form onsubmit={{action 'onAddSpace'}}>
|
||||
<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>
|
||||
{{#if session.isEditor}}
|
||||
<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>
|
||||
<div class="modal" tabindex="-1" role="dialog" id="add-space-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Add Space</div>
|
||||
<div class="modal-body">
|
||||
<form onsubmit={{action 'onAddSpace'}}>
|
||||
<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="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 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>
|
||||
</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>
|
||||
{{/if}}
|
||||
{{/toolbar/t-actions}}
|
||||
{{/toolbar/t-toolbar}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue