From 8e79f98fe149c09b238aa432312b34defca865e6 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Wed, 22 Jun 2016 10:43:07 -0700 Subject: [PATCH] Print document --- .../components/document/document-toolbar.js | 7 +++++ app/app/styles/app.scss | 1 + app/app/styles/base.scss | 6 ++-- app/app/styles/print.scss | 30 +++++++++++++++++++ app/app/styles/view/document/content.scss | 22 +++++++++++--- .../components/document/document-toolbar.hbs | 6 ++-- .../components/document/document-view.hbs | 6 ++-- documize/section/trello/model.go | 3 +- documize/section/trello/trello.go | 1 - 9 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 app/app/styles/print.scss diff --git a/app/app/components/document/document-toolbar.js b/app/app/components/document/document-toolbar.js index bbeb1471..bbd26949 100644 --- a/app/app/components/document/document-toolbar.js +++ b/app/app/components/document/document-toolbar.js @@ -27,8 +27,11 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.addTooltip(document.getElementById("attachment-button")); this.addTooltip(document.getElementById("save-template-button")); this.addTooltip(document.getElementById("set-meta-button")); + this.addTooltip(document.getElementById("delete-document-button")); } + this.addTooltip(document.getElementById("print-document-button")); + if (this.session.authenticated) { this.addTooltip(document.getElementById("owner-avatar")); } @@ -91,6 +94,10 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.attrs.onDocumentDelete(); }, + printDocument() { + window.print(); + }, + saveTemplate() { var templateName = this.get('saveTemplate.name'); var templateDescription = this.get('saveTemplate.description'); diff --git a/app/app/styles/app.scss b/app/app/styles/app.scss index f0837c73..237930c0 100644 --- a/app/app/styles/app.scss +++ b/app/app/styles/app.scss @@ -29,6 +29,7 @@ @import "view/document/wizard.scss"; @import "vendor.scss"; @import "responsive.scss"; +@import "print.scss"; @import "section/trello.scss"; @import "section/gemini.scss"; diff --git a/app/app/styles/base.scss b/app/app/styles/base.scss index 218e79d1..575e7ac5 100644 --- a/app/app/styles/base.scss +++ b/app/app/styles/base.scss @@ -113,9 +113,9 @@ ul { .clearfix:before, .clearfix:after { - content: " "; - display: table; + content: " "; + display: table; } .clearfix:after { - clear: both; + clear: both; } diff --git a/app/app/styles/print.scss b/app/app/styles/print.scss new file mode 100644 index 00000000..aa072c8c --- /dev/null +++ b/app/app/styles/print.scss @@ -0,0 +1,30 @@ +// 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 + +@media print { + .header, .sidebar, .non-printable { + display: none !important; + } + + .document-container { + > .content { + padding: 20px 0 !important; + + .page-toolbar { + display: none !important; + } + + .print-title, .non-printable-message, .document-summary, .attachment-zone { + display: block !important; + } + } + } +} diff --git a/app/app/styles/view/document/content.scss b/app/app/styles/view/document/content.scss index 028b8515..cae06a19 100644 --- a/app/app/styles/view/document/content.scss +++ b/app/app/styles/view/document/content.scss @@ -2,6 +2,22 @@ > .content { padding: 40px 40px 40px 20px; + .print-title { + display: none; + font-size: 2.3em; + font-weight: bold; + color:$color-off-black; + margin-bottom: 20px; + margin-top: 0; + } + + .non-printable-message { + display: none; + font-size: 1em; + font-style: italic; + color: $color-gray; + } + .attachment-zone { margin: 20px 0 30px 0; @@ -15,7 +31,7 @@ padding: 0; list-style-type: none; border-bottom: 1px solid $color-gray2; - padding-bottom: 10px; + padding-bottom: 10px; > .icon { vertical-align: text-top; @@ -34,7 +50,6 @@ color: $color-stroke; } - &:hover { .file { text-decoration: underline; @@ -59,12 +74,11 @@ } > .pages { - margin: 20px 0 50px 0; + margin: 20px 0 50px 0; > .wysiwyg { > .is-a-page { .page-title { - > .page-toolbar { opacity: 0.3; @extend .transition-all; diff --git a/app/app/templates/components/document/document-toolbar.hbs b/app/app/templates/components/document/document-toolbar.hbs index 0ab7a7c0..fbc3b647 100644 --- a/app/app/templates/components/document/document-toolbar.hbs +++ b/app/app/templates/components/document/document-toolbar.hbs @@ -48,7 +48,7 @@ {{#if isEditor}}
-
+
settings
@@ -62,13 +62,13 @@ {{/if}}
-