mirror of
https://github.com/documize/community.git
synced 2025-08-09 07:25:23 +02:00
Print document
This commit is contained in:
parent
f57f24e633
commit
8e79f98fe1
9 changed files with 68 additions and 14 deletions
|
@ -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');
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -113,9 +113,9 @@ ul {
|
|||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
|
|
30
app/app/styles/print.scss
Normal file
30
app/app/styles/print.scss
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
@ -64,7 +79,6 @@
|
|||
> .wysiwyg {
|
||||
> .is-a-page {
|
||||
.page-title {
|
||||
|
||||
> .page-toolbar {
|
||||
opacity: 0.3;
|
||||
@extend .transition-all;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
{{#if isEditor}}
|
||||
<div class="button-gap"></div>
|
||||
<div class="square-button button-gray" id="set-meta-button" data-tooltip="Set owner, title, excerpt" data-tooltip-position="top center">
|
||||
<div class="square-button button-gray" id="set-meta-button" data-tooltip="Set meta" data-tooltip-position="top center">
|
||||
<i class="material-icons">settings</i>
|
||||
</div>
|
||||
<div class="button-gap"></div>
|
||||
|
@ -62,13 +62,13 @@
|
|||
{{/if}}
|
||||
|
||||
<div class="button-gap"></div>
|
||||
<div class="square-button button-gray" id="print-document-button" data-tooltip="Print this document" data-tooltip-position="top center">
|
||||
<div class="square-button button-gray" id="print-document-button" data-tooltip="Print document" data-tooltip-position="top center" {{action 'printDocument'}}>
|
||||
<i class="material-icons">print</i>
|
||||
</div>
|
||||
|
||||
{{#if isEditor}}
|
||||
<div class="button-gap"></div>
|
||||
<div class="square-button button-red" id="delete-document-button" data-tooltip="Delete this document" data-tooltip-position="top center">
|
||||
<div class="square-button button-red" id="delete-document-button" data-tooltip="Delete document" data-tooltip-position="top center">
|
||||
<i class="material-icons">delete</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
{{document/tag-editor documentTags=document.tags isEditor=isEditor onChange=(action 'onTagChange')}}
|
||||
</div>
|
||||
|
||||
<div class="print-title">
|
||||
{{document.name}}
|
||||
</div>
|
||||
|
||||
{{#if attachments}}
|
||||
<div class="attachment-zone">
|
||||
<ul class="list">
|
||||
|
@ -28,9 +32,7 @@
|
|||
{{#each pages key="id" as |page index|}}
|
||||
<div class="wysiwyg">
|
||||
<div id="page-{{ page.id }}" class="is-a-page" data-id="{{ page.id }}" data-type="{{ page.contentType }}">
|
||||
|
||||
{{document/page-heading tagName=page.tagName document=document folder=folder page=page isEditor=isEditor onDeletePage=(action 'onDeletePage') }}
|
||||
|
||||
{{#if page.firstPage }}
|
||||
{{#if document.template}}
|
||||
<div class="is-template">TEMPLATE</div>
|
||||
|
|
|
@ -14,7 +14,8 @@ package trello
|
|||
import "strings"
|
||||
|
||||
const renderTemplate = `
|
||||
<div class="section-trello-render">
|
||||
<p class="non-printable-message">Non-printable</p>
|
||||
<div class="section-trello-render non-printable">
|
||||
<p>There are {{ .CardCount }} cards across {{ .ListCount }} lists for board <a href="{{ .Board.URL }}">{{.Board.Name}}.</a></p>
|
||||
<div class="trello-board" style="background-color: {{.Board.Prefs.BackgroundColor}}">
|
||||
<a href="{{ .Board.URL }}"><div class="trello-board-title">{{.Board.Name}}</div></a>
|
||||
|
|
|
@ -129,7 +129,6 @@ func (*Provider) Command(w http.ResponseWriter, r *http.Request) {
|
|||
AppKey string `json:"appKey"`
|
||||
}
|
||||
|
||||
fmt.Println(appKey)
|
||||
config.AppKey = appKey
|
||||
provider.WriteJSON(w, config)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue