1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-04 21:15:24 +02:00

switch between docs and wiki layout

Closes #60
This commit is contained in:
Harvey Kandola 2016-11-20 19:55:52 -08:00
parent 0819e04c03
commit 7e14651998
18 changed files with 704 additions and 620 deletions

View file

@ -28,6 +28,10 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
didReceiveAttrs() {
this.set('saveTemplate.name', this.get('document.name'));
this.set('saveTemplate.description', this.get('document.excerpt'));
let doc = this.get('document');
this.set('layoutLabel', doc.get('layout') === 'doc' ? 'Wiki style' : 'Document style');
},
didRender() {
@ -53,6 +57,17 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
window.print();
},
changeLayout() {
let doc = this.get('document');
let layout = doc.get('layout') === 'doc' ? 'wiki' : 'doc';
doc.set('layout', layout);
this.attrs.onSaveMeta(doc);
this.set('layoutLabel', doc.get('layout') === 'doc' ? 'Wiki style' : 'Document style');
},
saveTemplate() {
var name = this.get('saveTemplate.name');
var excerpt = this.get('saveTemplate.description');

View file

@ -48,6 +48,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
title: "Empty",
description: "An empty canvas for your words",
img: "template-blank",
layout: "doc",
locked: true
};

View file

@ -25,6 +25,7 @@ export default Model.extend({
userId: attr('string'),
tags: attr('string'),
template: attr('boolean'),
layout: attr('string'),
// client-side property
selected: attr('boolean', { defaultValue: false }),

View file

@ -15,6 +15,10 @@
display: none !important;
}
.zone-content {
padding: 0 !important;
}
.document-view {
.attachment-zone,
.document-summary,
@ -28,4 +32,10 @@
display: block !important;
}
}
.doc-layout {
padding: 0 !important;
box-shadow: none !important;
margin: 0 !important;
}
}

View file

@ -1,3 +1,13 @@
.wiki-layout {
}
.doc-layout {
padding: 60px 50px;
box-shadow: 0 0 0 0.75pt $color-stroke,0 0 3pt 0.75pt $color-stroke;
margin: 30px 40px 50px 40px;
}
.document-view {
.print-title {
display: none;

View file

@ -38,7 +38,13 @@
{{#dropdown-menu target="document-toolbar-menu" position="bottom right" open="click" onOpenCallback=(action 'onMenuOpen') onCloseCallback=(action 'onMenuOpen')}}
<ul class="menu">
{{#if isEditor}}
<li class="item" {{action 'changeLayout'}} >{{layoutLabel}}</li>
<li class="divider"></li>
{{/if}}
<li class="item" id="print-document-button" {{action 'printDocument'}}>Print</li>
{{#if isEditor}}
<li class="divider"></li>
<li class="item" id="delete-document-button">Delete</li>

View file

@ -1,4 +1,4 @@
<div class="document-view">
<div class="document-view {{document.layout}}-layout">
{{#if document.template}}
<div class="is-template">TEMPLATE</div>
{{/if}}

View file

@ -1,11 +1,11 @@
// 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
@ -14,5 +14,10 @@ export default {
Public: 1,
Private: 2,
Protected: 3
}
};
},
DisplayLayout: {
DisplayLayoutDoc: "doc",
DisplayLayoutWiki: "wiki"
}
};

View file

@ -1,6 +1,6 @@
{
"name": "documize",
"version": "0.32.0",
"version": "0.33.0",
"description": "The Document IDE",
"private": true,
"directories": {