Forráskód Böngészése

Merge branch 'attachment-cover-show-minicard'

helioguardabaxo 2 éve
szülő
commit
7df32ff4ac

+ 2 - 1
client/components/cards/minicard.jade

@@ -28,7 +28,8 @@ template(name="minicard")
         .date
           +cardSpentTime
     if cover
-      .minicard-cover(style="background-image: url('{{cover.link 'original'}}?dummyReloadAfterSessionEstablished={{sess}}');")
+      if currentBoard.allowsCoverAttachmentOnMinicard
+        .minicard-cover(style="background-image: url('{{cover.link 'original'}}?dummyReloadAfterSessionEstablished={{sess}}');")
     .minicard-title
       if $eq 'prefix-with-full-path' currentBoard.presentParentTask
         .parent-prefix

+ 6 - 0
client/components/sidebar/sidebar.jade

@@ -302,6 +302,12 @@ template(name="boardMinicardSettingsPopup")
         span
           i.fa.fa-align-left
           | {{_ 'description-on-minicard'}}
+    div.check-div
+      a.flex.js-field-has-cover-attachment-on-minicard(class="{{#if allowsCoverAttachmentOnMinicard}}is-checked{{/if}}")
+        .materialCheckBox(class="{{#if allowsCoverAttachmentOnMinicard}}is-checked{{/if}}")
+        span
+          i.fa.fa-paperclip
+          | {{_ 'cover-attachment-on-minicard'}}
 
 template(name="boardSubtaskSettingsPopup")
   form.board-subtask-settings

+ 20 - 0
client/components/sidebar/sidebar.js

@@ -1326,6 +1326,10 @@ BlazeComponent.extendComponent({
     return this.currentBoard.allowsDescriptionTextOnMinicard;
   },
 
+  allowsCoverAttachmentOnMinicard() {
+    return this.currentBoard.allowsCoverAttachmentOnMinicard;
+  },
+
  lists() {
     return Lists.find(
       {
@@ -1367,6 +1371,22 @@ BlazeComponent.extendComponent({
             this.currentBoard.allowsDescriptionTextOnMinicard,
           );
         },
+        'click .js-field-has-cover-attachment-on-minicard'(evt) {
+          evt.preventDefault();
+          this.currentBoard.allowsCoverAttachmentOnMinicard = !this.currentBoard
+            .allowsCoverAttachmentOnMinicard;
+          this.currentBoard.setallowsCoverAttachmentOnMinicard(
+            this.currentBoard.allowsCoverAttachmentOnMinicard,
+          );
+          $(`.js-field-has-cover-attachment-on-minicard ${MCB}`).toggleClass(
+            CKCLS,
+            this.currentBoard.allowsCoverAttachmentOnMinicard,
+          );
+          $('.js-field-has-cover-attachment-on-minicard').toggleClass(
+            CKCLS,
+            this.currentBoard.allowsCoverAttachmentOnMinicard,
+          );
+        },
       },
     ];
   },

+ 1 - 0
imports/i18n/data/en.i18n.json

@@ -728,6 +728,7 @@
   "deposit-subtasks-list": "Landing list for subtasks deposited here:",
   "show-parent-in-minicard": "Show parent in minicard:",
   "description-on-minicard": "Description on minicard",
+  "cover-attachment-on-minicard": "Cover attachment on minicard",
   "prefix-with-full-path": "Prefix with full path",
   "prefix-with-parent": "Prefix with parent",
   "subtext-with-full-path": "Subtext with full path",

+ 12 - 0
models/boards.js

@@ -407,6 +407,14 @@ Boards.attachSchema(
       defaultValue: false,
     },
 
+    allowsCoverAttachmentOnMinicard: {
+      /**
+       * Does the board allows cover attachment on minicard?
+       */
+      type: Boolean,
+      defaultValue: false,
+    },
+
     allowsCardNumber: {
       /**
        * Does the board allows card numbers?
@@ -1459,6 +1467,10 @@ Boards.mutations({
     return { $set: { allowsDescriptionTextOnMinicard } };
   },
 
+  setallowsCoverAttachmentOnMinicard(allowsCoverAttachmentOnMinicard) {
+    return { $set: { allowsCoverAttachmentOnMinicard } };
+  },
+
   setAllowsActivities(allowsActivities) {
     return { $set: { allowsActivities } };
   },

+ 4 - 0
public/api/wekan.yml

@@ -3006,6 +3006,10 @@ definitions:
         description: |
            Does the board allows description text on minicard?
         type: boolean
+      allowsCoverAttachmentOnMinicard:
+        description: |
+           Does the board allows cover attachment on minicard?
+        type: boolean
       allowsCardNumber:
         description: |
            Does the board allows card numbers?