diff --git a/app/app/components/dropdown-dialog.js b/app/app/components/dropdown-dialog.js index 1974c8a3c..12ccd8c02 100644 --- a/app/app/components/dropdown-dialog.js +++ b/app/app/components/dropdown-dialog.js @@ -47,6 +47,10 @@ export default Ember.Component.extend({ // TODO: refactor to eliminate self let self = this; + if (is.null(self.get('target'))) { + return; + } + let drop = this.get('tether').createDrop({ target: document.getElementById(self.get('target')), content: self.$(".dropdown-dialog")[0], diff --git a/app/app/components/folder/folder-toolbar.js b/app/app/components/folder/folder-toolbar.js index d8a06bc56..466087cf2 100644 --- a/app/app/components/folder/folder-toolbar.js +++ b/app/app/components/folder/folder-toolbar.js @@ -44,7 +44,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('movedFolderOptions', targets); }, - didRender() { + didRender() { if (this.get('hasSelectedDocuments')) { this.addTooltip(document.getElementById("move-documents-button")); this.addTooltip(document.getElementById("delete-documents-button")); @@ -57,52 +57,14 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.addTooltip(document.getElementById("import-document-button")); } } - - if (this.get('folderService').get('canEditCurrentFolder')) { - let self = this; - let folderId = this.get('folder.id'); - let url = this.get('appMeta.endpoint'); - let importUrl = `${url}/import/folder/${folderId}`; - - let dzone = new Dropzone("#import-document-button > i", { - headers: { - 'Authorization': 'Bearer ' + self.get('session.session.content.authenticated.token') - }, - url: importUrl, - method: "post", - paramName: 'attachment', - acceptedFiles: ".doc,.docx,.txt,.md,.markdown", - clickable: true, - maxFilesize: 10, - parallelUploads: 3, - uploadMultiple: false, - addRemoveLinks: false, - autoProcessQueue: true, - - init: function () { - this.on("success", function (document) { - self.send('onDocumentImported', document.name, document); - }); - - this.on("error", function (x) { - console.log("Conversion failed for ", x.name, " obj ", x); // TODO proper error handling - }); - - this.on("queuecomplete", function () {}); - - this.on("addedfile", function (file) { - self.send('onDocumentImporting', file.name); - self.audit.record('converted-document'); - }); - } - }); - - dzone.on("complete", function (file) { - dzone.removeFile(file); - }); - - this.set('drop', dzone); - } + }, + + didUpdate() { + this.setupImport(); + }, + + didInsertElement() { + // this.setupImport(); }, willDestroyElement() { @@ -114,6 +76,65 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.destroyTooltips(); }, + setupImport() { + // guard against unecessary file upload component init + if (this.get('hasSelectedDocuments') || !this.get('folderService').get('canEditCurrentFolder')) { + return; + } + + // already done init? + if (is.not.null(this.get('drop'))) { + if (is.not.null(this.get('drop'))) { + this.get('drop').destroy(); + this.set('drop', null); + } + } + + let self = this; + let folderId = this.get('folder.id'); + let url = this.get('appMeta.endpoint'); + let importUrl = `${url}/import/folder/${folderId}`; + + let dzone = new Dropzone("#import-document-button > i", { + headers: { + 'Authorization': 'Bearer ' + self.get('session.session.content.authenticated.token') + }, + url: importUrl, + method: "post", + paramName: 'attachment', + acceptedFiles: ".doc,.docx,.txt,.md,.markdown", + clickable: true, + maxFilesize: 10, + parallelUploads: 3, + uploadMultiple: false, + addRemoveLinks: false, + autoProcessQueue: true, + + init: function () { + this.on("success", function (document) { + self.send('onDocumentImported', document.name, document); + }); + + this.on("error", function (x) { + console.log("Conversion failed for ", x.name, " obj ", x); // TODO proper error handling + }); + + this.on("queuecomplete", function () {}); + + this.on("addedfile", function (file) { + self.send('onDocumentImporting', file.name); + self.audit.record('converted-document'); + }); + } + }); + + dzone.on("complete", function (file) { + dzone.removeFile(file); + }); + + this.set('drop', dzone); + }, + actions: { onDocumentImporting(filename) { this.send("showNotification", `Importing ${filename}`); diff --git a/app/app/components/onboard/share-folder.js b/app/app/components/onboard/share-folder.js index 0429b897e..b9f4fa19c 100644 --- a/app/app/components/onboard/share-folder.js +++ b/app/app/components/onboard/share-folder.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . 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 . +// by contacting . // // https://documize.com @@ -29,9 +29,9 @@ export default Ember.Component.extend({ // Stage 1 - person name keypress handler $("#stage-1-firstname, #stage-1-lastname").keyup(function() { if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val()) { - $(".name-status").attr("src", "assets/img/onboard/person-red.png"); + $(".name-status").attr("src", "/assets/img/onboard/person-red.png"); } else { - $(".name-status").attr("src", "assets/img/onboard/person-green.png"); + $(".name-status").attr("src", "/assets/img/onboard/person-green.png"); } }); @@ -40,14 +40,14 @@ export default Ember.Component.extend({ if (!$("#stage-1-firstname").val()) { $("#stage-1-firstname").focus(); $("#stage-1-firstname").addClass("error"); - $(".name-status").attr("src", "assets/img/onboard/person-red.png"); + $(".name-status").attr("src", "/assets/img/onboard/person-red.png"); return; } if (!$("#stage-1-lastname").val()) { $("#stage-1-lastname").focus(); $("#stage-1-lastname").addClass("error"); - $(".name-status").attr("src", "assets/img/onboard/person-red.png"); + $(".name-status").attr("src", "/assets/img/onboard/person-red.png"); return; } @@ -67,9 +67,9 @@ export default Ember.Component.extend({ $("#stage-2-password-confirm").keyup(function() { if ($("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50 || ($("#stage-2-password").val() !== $("#stage-2-password-confirm").val())) { - $(".password-status").attr("src", "assets/img/onboard/lock-red.png"); + $(".password-status").attr("src", "/assets/img/onboard/lock-red.png"); } else { - $(".password-status").attr("src", "assets/img/onboard/lock-green.png"); + $(".password-status").attr("src", "/assets/img/onboard/lock-green.png"); } }); }); @@ -91,7 +91,7 @@ export default Ember.Component.extend({ if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val()) { $(".mismatch").show(); - $(".password-status").attr("src", "assets/img/onboard/lock-red.png"); + $(".password-status").attr("src", "/assets/img/onboard/lock-red.png"); return; } @@ -121,4 +121,4 @@ export default Ember.Component.extend({ }); }); }, -}); \ No newline at end of file +}); diff --git a/app/app/styles/view/document/content.scss b/app/app/styles/view/document/content.scss index 6d3d74813..dc64b7d43 100644 --- a/app/app/styles/view/document/content.scss +++ b/app/app/styles/view/document/content.scss @@ -112,7 +112,7 @@ .no-sections { text-align: center; - opacity: 0.4; + opacity: 0.5; > .box { padding: 35px; diff --git a/app/app/styles/view/document/wysiwyg.scss b/app/app/styles/view/document/wysiwyg.scss index 2baebd3aa..a50ad0153 100644 --- a/app/app/styles/view/document/wysiwyg.scss +++ b/app/app/styles/view/document/wysiwyg.scss @@ -6,7 +6,6 @@ table { - margin: 10px 20px 0 20px !important; // width: auto !important; @include border(1px); @@ -43,37 +42,45 @@ font-family: "open_sanssemibold"; } + h1.doc-name { + font-size: 2em; + font-family: open_sansregular; + } + h1 { font-size: 1.6em; - font-family: open_sansregular; + font-family: open_sanslight; color:$color-off-black; margin: 30px 0 20px 0; } h2 { - font-size: 2rem; + font-size: 1.5em; margin: 30px 0 20px 0; - font-family: open_sansregular; + font-family: open_sanslight; } h3 { - font-size: 1.6rem; + font-size: 1.4rem; margin: 30px 0 20px 0; + font-family: open_sanslight; } h4 { - font-size: 1.6rem; + font-size: 1.3rem; margin: 30px 0 20px 0; + font-family: open_sanslight; } h5, h6, h7, h8, h9 { - font-size: 1.4rem; + font-size: 1.2rem; margin: 30px 0 20px 0; + font-family: open_sanslight; } h2, h3, h4, h5, h6, h7, h8, h9 @@ -118,7 +125,7 @@ } td, th { - border: 1px solid #dddddd; + border: 1px solid #f3f5f8; padding: 5px 7px !important; } td:empty, @@ -134,7 +141,7 @@ border-width: 2px; } th { - background: #efefef; + background: #f7f6f6; } } } diff --git a/app/app/styles/view/page-auth.scss b/app/app/styles/view/page-auth.scss index a0112460b..0d6d9cfab 100644 --- a/app/app/styles/view/page-auth.scss +++ b/app/app/styles/view/page-auth.scss @@ -14,7 +14,7 @@ margin: 0 auto; > img { - height: 40px; + height: 60px; margin: 40px 0; } } diff --git a/app/app/styles/view/page-documents.scss b/app/app/styles/view/page-documents.scss index 175cd9402..183b8534d 100644 --- a/app/app/styles/view/page-documents.scss +++ b/app/app/styles/view/page-documents.scss @@ -174,20 +174,24 @@ } .no-documents { - margin-top: 50px; + margin-top: 150px; text-align: center; - opacity: 0.4; + opacity: 0.5; + background-image: url("/assets/img/no-documents.png"); + background-repeat: no-repeat; + background-position: center; > .box { - padding: 35px; - width: 300px; - display: inline-block; - margin: 0 20px; + max-width: 400px; + margin: 0 auto; + border: 1px dashed #b3adad; + padding: 20px; > .message { font-size: 14px; color: $color-off-black; margin-top: 20px; + line-height: 50px; } > .regular-button { diff --git a/app/app/styles/view/page-onboard.scss b/app/app/styles/view/page-onboard.scss index 27e2fb9ea..4aa30cd71 100644 --- a/app/app/styles/view/page-onboard.scss +++ b/app/app/styles/view/page-onboard.scss @@ -2,7 +2,7 @@ { width: 100%; text-align: left; - color: $color-primary; + color: $color-off-black; letter-spacing: 1px; .stage-1 @@ -145,17 +145,18 @@ .sidebar { - padding: 50px 50px 0 50px; + margin-left: -15px; + padding: 100px 50px 50px 50px; overflow: auto; .logo { - height: 100px; + height: 62px; margin-bottom: 15px; margin-top: 20px; } - h1 + h2 { font-size: 2rem;; color: $color-primary; @@ -165,6 +166,7 @@ p { font-size: 1.3rem; + color: $color-primary; } p.note @@ -179,8 +181,11 @@ height: 400px; width: 500px; margin-top: 200px; - background-color: #eaeaea; + background-color: #f6f9fc; position: relative; + border-radius: 10px; + background-color: #fff; + box-shadow: 0 6px 20px 0 rgba(30,71,101,.1); } input[type='email'], input[type='text'], input[type='password'] { diff --git a/app/app/templates/components/document/document-view.hbs b/app/app/templates/components/document/document-view.hbs index 3298ed502..9365454ce 100644 --- a/app/app/templates/components/document/document-view.hbs +++ b/app/app/templates/components/document/document-view.hbs @@ -1,7 +1,7 @@
- +
-

{{document.name}}

+

{{document.name}}

{{#if document.template}} @@ -64,11 +64,12 @@ {{#if noSections}}
-
- add -
section
-
-
Add a new section to this document
+
Click the +
+ add +
section
+
+ to add a new section to this document
{{/if}} diff --git a/app/app/templates/components/folder/documents-list.hbs b/app/app/templates/components/folder/documents-list.hbs index 37e797c84..fdd7d6acc 100644 --- a/app/app/templates/components/folder/documents-list.hbs +++ b/app/app/templates/components/folder/documents-list.hbs @@ -22,18 +22,16 @@ {{#if emptyState}}
-
- add -
space
+

This space is empty

+
Click the +
+ add +
button to add a new document
or +
+ file_upload +
+ to import .doc .docx, .txt .md files
-
Create a new space for
all your content
-
-
-
- add -
content
-
-
Start with a content template or
import .doc .docx, .txt .md files
{{/if}} diff --git a/app/app/templates/components/onboard/share-folder.hbs b/app/app/templates/components/onboard/share-folder.hbs index eae84fb6d..ace49dbec 100644 --- a/app/app/templates/components/onboard/share-folder.hbs +++ b/app/app/templates/components/onboard/share-folder.hbs @@ -1,11 +1,10 @@
- diff --git a/app/public/assets/img/no-documents.png b/app/public/assets/img/no-documents.png new file mode 100644 index 000000000..3b05a83cf Binary files /dev/null and b/app/public/assets/img/no-documents.png differ