diff --git a/gui/app/components/toolbar/for-spaces.js b/gui/app/components/toolbar/for-spaces.js new file mode 100644 index 00000000..33403da0 --- /dev/null +++ b/gui/app/components/toolbar/for-spaces.js @@ -0,0 +1,70 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// 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 . +// +// https://documize.com + +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'; + +export default Component.extend(NotifierMixin, AuthMixin, { + spaceName: '', + copyTemplate: true, + copyPermission: true, + copyDocument: false, + clonedSpace: { id: '' }, + hasClone: notEmpty('clonedSpace.id'), + + didInsertElement() { + this._super(...arguments); + + $('#add-space-modal').on('show.bs.modal', function(event) { // eslint-disable-line no-unused-vars + schedule('afterRender', () => { + $("#new-space-name").focus(); + }); + }); + }, + + actions: { + onCloneSpaceSelect(sp) { + this.set('clonedSpace', sp) + }, + + onAddSpace(e) { + e.preventDefault(); + + let spaceName = this.get('spaceName'); + let clonedId = this.get('clonedSpace.id'); + + if (is.empty(spaceName)) { + $("#new-space-name").addClass("is-invalid").focus(); + return false; + } + + let payload = { + name: spaceName, + CloneID: clonedId, + copyTemplate: this.get('copyTemplate'), + copyPermission: this.get('copyPermission'), + copyDocument: this.get('copyDocument'), + } + + this.set('spaceName', ''); + this.set('clonedSpace.id', ''); + $("#new-space-name").removeClass("is-invalid"); + + $('#add-space-modal').modal('hide'); + $('#add-space-modal').modal('dispose'); + + this.attrs.onAddSpace(payload); + } + } +}); diff --git a/gui/app/pods/folders/controller.js b/gui/app/pods/folders/controller.js index 82ec9826..99708121 100644 --- a/gui/app/pods/folders/controller.js +++ b/gui/app/pods/folders/controller.js @@ -10,21 +10,16 @@ // https://documize.com import { inject as service } from '@ember/service'; - import Controller from '@ember/controller'; -import NotifierMixin from '../../mixins/notifier'; -export default Controller.extend(NotifierMixin, { +export default Controller.extend({ folderService: service('folder'), actions: { onAddSpace(m) { - let self = this; - this.showNotification("Added"); - - this.get('folderService').add(m).then(function (newFolder) { - self.get('folderService').setCurrentFolder(newFolder); - self.transitionToRoute('folder', newFolder.get('id'), newFolder.get('slug')); + this.get('folderService').add(m).then((sp) => { + this.get('folderService').setCurrentFolder(sp); + this.transitionToRoute('folder', sp.get('id'), sp.get('slug')); }); } } diff --git a/gui/app/pods/folders/template.hbs b/gui/app/pods/folders/template.hbs index b81f7696..49d36e2f 100644 --- a/gui/app/pods/folders/template.hbs +++ b/gui/app/pods/folders/template.hbs @@ -1,22 +1,6 @@ {{layout/nav-bar}}
-
-
-
- {{spaces/space-list spaces=model}} -
-
-
-
- -
-{{#layout/zone-container}} - - {{#layout/zone-sidebar}} - {{folder/sidebar-zone folders=model noFolder=true onAddSpace=(action 'onAddSpace')}} - {{/layout/zone-sidebar}} - {{#layout/zone-content}} - {{/layout/zone-content}} -{{/layout/zone-container}} + {{toolbar/for-spaces spaces=model onAddSpace=(action 'onAddSpace')}} + {{spaces/space-list spaces=model}}
diff --git a/gui/app/styles/app.scss b/gui/app/styles/app.scss index e8fdb3df..5c5d2d58 100644 --- a/gui/app/styles/app.scss +++ b/gui/app/styles/app.scss @@ -13,8 +13,9 @@ @import "mixins.scss"; @import "base.scss"; @import "bootstrap.scss"; + @import "widget/widget.scss"; -@import "view/layout.scss"; +@import "view/layout.scss"; // junk? @import "view/page-search.scss"; @import "view/page-profile.scss"; @import "view/page-customize.scss"; @@ -25,10 +26,11 @@ @import "view/document/all.scss"; @import "view/common.scss"; +@import "view/navigation.scss"; +@import "view/toolbar.scss"; @import "view/views.scss"; @import "vendor.scss"; -@import "responsive.scss"; @import "print.scss"; @import "section/trello.scss"; @import "section/gemini.scss"; diff --git a/gui/app/styles/bootstrap.scss b/gui/app/styles/bootstrap.scss index 7f272c3c..e9716779 100644 --- a/gui/app/styles/bootstrap.scss +++ b/gui/app/styles/bootstrap.scss @@ -48,6 +48,9 @@ $modal-footer-border-color: $color-white; $border-radius: .125rem; $border-radius-lg: .15rem; $border-radius-sm: .1rem; +$border-radius: 0; +$border-radius-lg: 0; +$border-radius-sm: 0; // dropdown $dropdown-link-color: $color-off-black; diff --git a/gui/app/styles/color.scss b/gui/app/styles/color.scss index 53291f01..2a7b1692 100644 --- a/gui/app/styles/color.scss +++ b/gui/app/styles/color.scss @@ -10,7 +10,7 @@ // https://documize.com // Theme colors -$color-primary: #351056; +$color-primary: #290F3F; //#351056; $color-primary-light: #F7F2FF; $color-link: #1b701e; diff --git a/gui/app/styles/mixins.scss b/gui/app/styles/mixins.scss index b0334188..676c4eb8 100644 --- a/gui/app/styles/mixins.scss +++ b/gui/app/styles/mixins.scss @@ -39,7 +39,7 @@ box-shadow: 1px 1px 3px 0px rgba(211,211,211,1); &:hover { - background-color: darken($color-card, 3%); + background-color: darken($color-card, 5%); color: $color-link; } } diff --git a/gui/app/styles/responsive.scss b/gui/app/styles/responsive.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/gui/app/styles/view/layout.scss b/gui/app/styles/view/layout.scss index 520ecffe..f3ee3ff3 100644 --- a/gui/app/styles/view/layout.scss +++ b/gui/app/styles/view/layout.scss @@ -1,33 +1,3 @@ -.nav-bar { - background-color: $color-primary; - padding: 10px 20px; - color: $color-white; - font-size: 1rem; - - .nav-link, .nav-link:visited { - color: $color-white; - - &:hover { - color: darken($color-white, 15%); - } - } - - .nav-title { - font-size: 1.4rem; - font-weight: bold; - } - - .nav-msg { - font-size: 0.875rem; - } - - .nav-right { - float: right; - } -} - - - // pre-nov17 UX $sidebar-width: 400px; @@ -82,15 +52,6 @@ $sidebar-width: 400px; } } -@media(min-width:768px) { - #wrapper { - padding-left: $sidebar-width; - } - - #sidebar-wrapper { - width: $sidebar-width; - } -} .sidebar-common { display: inline-block; @@ -152,36 +113,6 @@ $sidebar-width: 400px; } } -.navigation { - margin: 0 0 0 0; - padding: 10px 0; - text-align: center; - background-color: $color-sidebar-navigation; - border-bottom: 1px solid $color-sidebar-navigation-border; - - .round-button-mono { - > .material-icons { - color: $color-gray; - @include ease-in(); - } - - &:hover { - > .material-icons { - color: $color-link; - } - } - } - - .profile-link { - color: $color-primary; - text-align: center; - font-size: 1rem; - font-style: normal; - font-family: $font-regular; - vertical-align: top; - } -} - .document-sidebar-toolbar { margin: 10px 0 0 0; padding: 10px 0; diff --git a/gui/app/styles/view/navigation.scss b/gui/app/styles/view/navigation.scss new file mode 100644 index 00000000..b3ffff40 --- /dev/null +++ b/gui/app/styles/view/navigation.scss @@ -0,0 +1,27 @@ +.nav-bar { + background-color: $color-primary; + padding: 10px 20px; + color: $color-white; + font-size: 1rem; + + .nav-link, .nav-link:visited { + color: $color-white; + + &:hover { + color: darken($color-white, 15%); + } + } + + .nav-title { + font-size: 1.4rem; + font-weight: bold; + } + + .nav-msg { + font-size: 1rem; + } + + .nav-right { + float: right; + } +} diff --git a/gui/app/styles/view/toolbar.scss b/gui/app/styles/view/toolbar.scss new file mode 100644 index 00000000..2c6dac9e --- /dev/null +++ b/gui/app/styles/view/toolbar.scss @@ -0,0 +1,28 @@ +.toolbar { + margin: 30px 0 0 0; + + > .links { + display: inlne-block; + + > .link { + color: $color-gray; + font-size: 1.1rem; + font-weight: bold; + display: inline-block; + margin-right: 30px; + cursor: pointer; + + &:hover { + color: $color-link; + } + } + + > .selected { + color: $color-link; + } + } + + > .buttons { + float: right; + } +} diff --git a/gui/app/templates/components/layout/nav-bar.hbs b/gui/app/templates/components/layout/nav-bar.hbs index cb31a688..d88c1a6a 100644 --- a/gui/app/templates/components/layout/nav-bar.hbs +++ b/gui/app/templates/components/layout/nav-bar.hbs @@ -1,7 +1,7 @@