From 9b8bb8f00006224d79b7fd52d9dd9661658a6641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Tue, 21 Apr 2020 11:19:59 +0200 Subject: [PATCH 1/3] add attachments to desc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- src/components/card/AttachmentList.vue | 187 +++++++++++++++++++++++++ src/components/card/CardSidebar.vue | 158 ++++++++++++++++++++- 2 files changed, 340 insertions(+), 5 deletions(-) create mode 100644 src/components/card/AttachmentList.vue diff --git a/src/components/card/AttachmentList.vue b/src/components/card/AttachmentList.vue new file mode 100644 index 000000000..d7c972722 --- /dev/null +++ b/src/components/card/AttachmentList.vue @@ -0,0 +1,187 @@ + + + + + + + diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 6485581a6..eef4cef20 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -127,6 +127,11 @@ href="https://deck.readthedocs.io/en/latest/Markdown/" target="_blank" class="icon icon-info" /> + + + {{ t('deck', 'Add Attachment') }} + + {{ t('deck', 'Edit description') }} @@ -170,11 +175,22 @@ icon="icon-activity"> + + + diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index eef4cef20..6e4174cac 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -183,7 +183,11 @@ {{ t('deck', 'Cancel') }} --> - + @@ -372,6 +376,7 @@ export default { this.modalShow = true }, addAttachment(attachment) { + console.log('hier') const descString = this.$refs.markdownEditor.easymde.value() let embed = '' if (attachment.extendedData.mimetype.includes('image')) { @@ -606,88 +611,4 @@ export default { margin: 40px 3px 3px 0; } - .attachment-list { - &.selector { - padding: 10px; - position: absolute; - width: 30%; - max-width: 500px; - min-width: 200px; - max-height: 50%; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: #eee; - z-index: 2; - border-radius: 3px; - box-shadow: 0 0 3px darkgray; - overflow: scroll; - } - h3.attachment-selector { - margin: 0 0 10px; - padding: 0; - .icon-close { - display: inline-block; - float: right; - } - } - - li.attachment { - display: flex; - padding: 3px; - min-height: 44px; - - &.deleted { - opacity: .5; - } - - .fileicon { - display: inline-block; - min-width: 32px; - width: 32px; - height: 32px; - background-size: contain; - } - .details { - flex-grow: 1; - flex-shrink: 1; - min-width: 0; - flex-basis: 50%; - line-height: 110%; - padding: 2px; - } - .filename { - width: 70%; - display: flex; - .basename { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - padding-bottom: 2px; - } - .extension { - opacity: 0.7; - } - } - .filesize, .filedate { - font-size: 90%; - color: darkgray; - } - .app-popover-menu-utils { - position: relative; - right: -10px; - button { - height: 32px; - width: 42px; - } - } - button.icon-history { - width: 44px; - } - progress { - margin-top: 3px; - } - } - } - diff --git a/src/components/card/CardSidebarTabAttachments.vue b/src/components/card/CardSidebarTabAttachments.vue index c134a8263..5291c59f8 100644 --- a/src/components/card/CardSidebarTabAttachments.vue +++ b/src/components/card/CardSidebarTabAttachments.vue @@ -43,53 +43,28 @@ -
  • - - - - - {{ t('deck', 'Delete Attachment') }} - - - {{ t('deck', 'Restore Attachment') }} - - -
  • + @@ -172,19 +135,6 @@ export default { background-position: 10px center; } - .modal__content { - width: 25vw; - min-width: 250px; - height: 120px; - text-align: center; - margin: 20px 20px 60px 20px; - } - - .modal__content button { - float: right; - margin: 40px 3px 3px 0; - } - .attachment-list { &.selector { padding: 10px; From 7c15a17aa4c28a08fee619d070f9cde9b26fbcad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 27 Apr 2020 12:23:49 +0200 Subject: [PATCH 3/3] Make sure event is properly emitted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- package-lock.json | 8 +++--- src/components/board/Board.vue | 7 ++--- src/components/card/AttachmentList.vue | 28 ++----------------- src/components/card/CardSidebar.vue | 17 +++++------ .../card/CardSidebarTabAttachments.vue | 13 +++++++-- 5 files changed, 30 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index afc203af9..0377f74cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13962,7 +13962,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -13979,7 +13979,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -14181,7 +14181,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -17293,7 +17293,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" diff --git a/src/components/board/Board.vue b/src/components/board/Board.vue index 3d18bdfa2..50e388031 100644 --- a/src/components/board/Board.vue +++ b/src/components/board/Board.vue @@ -24,12 +24,12 @@
    -
    +

    {{ t('deck', 'Loading board') }}

    -
    +
    -
    +

    {{ t('deck', 'Board not found') }}

    -
    diff --git a/src/components/card/AttachmentList.vue b/src/components/card/AttachmentList.vue index 57999fd8f..67ae39117 100644 --- a/src/components/card/AttachmentList.vue +++ b/src/components/card/AttachmentList.vue @@ -38,16 +38,16 @@
    - + {{ t('deck', 'Add this attachment') }} - + {{ t('deck', 'Delete Attachment') }} - + {{ t('deck', 'Restore Attachment') }} @@ -73,10 +73,6 @@ export default { type: Number, required: true, }, - editor: { - type: Object, - required: false, - }, selectable: { type: Boolean, required: false, @@ -114,24 +110,6 @@ export default { watch: { }, - methods: { - addAttachment(attachment) { - const descString = this.editor.easymde.value() - let embed = '' - if (attachment.extendedData.mimetype.includes('image')) { - embed = '!' - } - const attachmentString = embed + '[📎 ' + attachment.data + '](' + this.attachmentUrl(attachment) + ')' - this.editor.easymde.value(descString + '\n' + attachmentString) - this.modalShow = false - }, - deleteAttachment(attachment) { - this.$store.dispatch('deleteAttachment', attachment) - }, - restoreAttachment(attachment) { - this.$store.dispatch('restoreAttachment', attachment) - }, - }, } diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 6e4174cac..7d253230f 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -178,15 +178,9 @@ @@ -376,7 +370,6 @@ export default { this.modalShow = true }, addAttachment(attachment) { - console.log('hier') const descString = this.$refs.markdownEditor.easymde.value() let embed = '' if (attachment.extendedData.mimetype.includes('image')) { @@ -511,7 +504,7 @@ export default { margin-bottom: 5px; color: var(--color-text-maxcontrast); - .icon-info, .icon-attach { + .icon-info { display: inline-block; width: 32px; height: 16px; @@ -519,6 +512,13 @@ export default { opacity: .7; } + .icon-attach { + background-size: 16px; + float: right; + margin-top: -14px; + opacity: .7; + } + .icon-toggle, .icon-rename { float: right; margin-top: -14px; @@ -604,6 +604,7 @@ export default { height: 120px; text-align: center; margin: 20px 20px 60px 20px; + padding-bottom: 20px; } .modal__content button { diff --git a/src/components/card/CardSidebarTabAttachments.vue b/src/components/card/CardSidebarTabAttachments.vue index 5291c59f8..819423aa3 100644 --- a/src/components/card/CardSidebarTabAttachments.vue +++ b/src/components/card/CardSidebarTabAttachments.vue @@ -44,7 +44,11 @@
    - +
    @@ -124,7 +128,12 @@ export default { clickAddNewAttachmment() { this.$refs.localAttachments.click() }, - + deleteAttachment(attachment) { + this.$store.dispatch('deleteAttachment', attachment) + }, + restoreAttachment(attachment) { + this.$store.dispatch('restoreAttachment', attachment) + }, }, }