Преглед на файлове

If there is no Custom Field label at minicard, show value full width.

Thanks to koluka and xet7 !

Fixes #4988
Lauri Ojansivu преди 1 година
родител
ревизия
ffea7aff99
променени са 2 файла, в които са добавени 42 реда и са изтрити 15 реда
  1. 7 0
      client/components/cards/minicard.css
  2. 35 15
      client/components/cards/minicard.jade

+ 7 - 0
client/components/cards/minicard.css

@@ -120,6 +120,13 @@
   max-width: 100px;
   margin-right: 4px;
 }
+.minicard .minicard-custom-field-item-fullwidth {
+  flex-grow: 1;
+  display: block;
+  word-wrap: break-word;
+  max-width: 100%;
+  margin-right: 4px;
+}
 .minicard .handle {
   width: 20px;
   height: 20px;

+ 35 - 15
client/components/cards/minicard.jade

@@ -71,25 +71,45 @@ template(name="minicard")
         if definition.showOnCard
           if trueValue
             .minicard-custom-field
+              // If there is custom field label, show label at left,
+              // and value at right
               if definition.showLabelOnMiniCard
                 .minicard-custom-field-item
                   +viewer
                     = definition.name
-              .minicard-custom-field-item
-                if $eq definition.type "currency"
-                  +viewer
-                    = formattedCurrencyCustomFieldValue(definition)
-                else if $eq definition.type "date"
-                  .date
-                    +minicardCustomFieldDate
-                else if $eq definition.type "checkbox"
-                  .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
-                else if $eq definition.type "stringtemplate"
-                  +viewer
-                    = formattedStringtemplateCustomFieldValue(definition)
-                else
-                  +viewer
-                    = trueValue
+                .minicard-custom-field-item
+                  if $eq definition.type "currency"
+                    +viewer
+                      = formattedCurrencyCustomFieldValue(definition)
+                  else if $eq definition.type "date"
+                    .date
+                      +minicardCustomFieldDate
+                  else if $eq definition.type "checkbox"
+                    .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
+                  else if $eq definition.type "stringtemplate"
+                    +viewer
+                      = formattedStringtemplateCustomFieldValue(definition)
+                  else
+                    +viewer
+                      = trueValue
+              else
+                // If there is no custom field label,
+                // show value full width
+                .minicard-custom-field-item-fullwidth
+                  if $eq definition.type "currency"
+                    +viewer
+                      = formattedCurrencyCustomFieldValue(definition)
+                  else if $eq definition.type "date"
+                    .date
+                      +minicardCustomFieldDate
+                  else if $eq definition.type "checkbox"
+                    .materialCheckBox(class="{{#if value }}is-checked{{/if}}")
+                  else if $eq definition.type "stringtemplate"
+                    +viewer
+                      = formattedStringtemplateCustomFieldValue(definition)
+                  else
+                    +viewer
+                      = trueValue
 
     if showAssignee
       if getAssignees