mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Fix custom date to display short version on minicard
This commit is contained in:
parent
855151a8d1
commit
b09d656636
4 changed files with 49 additions and 5 deletions
|
@ -8,3 +8,7 @@ template(name="dateBadge")
|
||||||
time(datetime="{{showISODate}}")
|
time(datetime="{{showISODate}}")
|
||||||
| {{showDate}}
|
| {{showDate}}
|
||||||
|
|
||||||
|
template(name="dateCustomField")
|
||||||
|
a(title="{{showTitle}}" class="{{classes}}")
|
||||||
|
time(datetime="{{showISODate}}")
|
||||||
|
| {{showDate}}
|
||||||
|
|
|
@ -363,6 +363,33 @@ class CardEndDate extends CardDate {
|
||||||
}
|
}
|
||||||
CardEndDate.register('cardEndDate');
|
CardEndDate.register('cardEndDate');
|
||||||
|
|
||||||
|
class CardCustomFieldDate extends CardDate {
|
||||||
|
template() {
|
||||||
|
return 'dateCustomField';
|
||||||
|
}
|
||||||
|
|
||||||
|
onCreated() {
|
||||||
|
super.onCreated();
|
||||||
|
const self = this;
|
||||||
|
self.autorun(() => {
|
||||||
|
self.date.set(moment(self.data().value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
classes() {
|
||||||
|
return 'customfield-date';
|
||||||
|
}
|
||||||
|
|
||||||
|
showTitle() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
events() {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CardCustomFieldDate.register('cardCustomFieldDate');
|
||||||
|
|
||||||
(class extends CardReceivedDate {
|
(class extends CardReceivedDate {
|
||||||
showDate() {
|
showDate() {
|
||||||
return this.date.get().format('l');
|
return this.date.get().format('l');
|
||||||
|
@ -387,6 +414,12 @@ CardEndDate.register('cardEndDate');
|
||||||
}
|
}
|
||||||
}.register('minicardEndDate'));
|
}.register('minicardEndDate'));
|
||||||
|
|
||||||
|
(class extends CardCustomFieldDate {
|
||||||
|
showDate() {
|
||||||
|
return this.date.get().format('l');
|
||||||
|
}
|
||||||
|
}.register('minicardCustomFieldDate'));
|
||||||
|
|
||||||
class VoteEndDate extends CardDate {
|
class VoteEndDate extends CardDate {
|
||||||
onCreated() {
|
onCreated() {
|
||||||
super.onCreated();
|
super.onCreated();
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
display: block
|
display: block
|
||||||
border-radius: 4px
|
border-radius: 4px
|
||||||
padding: 1px 3px
|
padding: 1px 3px
|
||||||
|
|
||||||
background-color: #dbdbdb
|
background-color: #dbdbdb
|
||||||
&:hover, &.is-active
|
&:hover, &.is-active
|
||||||
background-color: #b3b3b3
|
background-color: #b3b3b3
|
||||||
|
|
||||||
&.current, &.almost-due, &.due, &.long-overdue
|
&.current, &.almost-due, &.due, &.long-overdue
|
||||||
color: #fff
|
color: #fff
|
||||||
|
|
||||||
|
@ -14,17 +14,17 @@
|
||||||
background-color: #5ba639
|
background-color: #5ba639
|
||||||
&:hover, &.is-active
|
&:hover, &.is-active
|
||||||
background-color: darken(#5ba639, 10)
|
background-color: darken(#5ba639, 10)
|
||||||
|
|
||||||
&.almost-due
|
&.almost-due
|
||||||
background-color: #edc909
|
background-color: #edc909
|
||||||
&:hover, &.is-active
|
&:hover, &.is-active
|
||||||
background-color: darken(#edc909, 10)
|
background-color: darken(#edc909, 10)
|
||||||
|
|
||||||
&.due
|
&.due
|
||||||
background-color: #fa3f00
|
background-color: #fa3f00
|
||||||
&:hover, &.is-active
|
&:hover, &.is-active
|
||||||
background-color: darken(#fa3f00, 10)
|
background-color: darken(#fa3f00, 10)
|
||||||
|
|
||||||
&.long-overdue
|
&.long-overdue
|
||||||
background-color: #fd5d47
|
background-color: #fd5d47
|
||||||
&:hover, &.is-active
|
&:hover, &.is-active
|
||||||
|
@ -57,3 +57,7 @@
|
||||||
-webkit-font-smoothing: antialiased
|
-webkit-font-smoothing: antialiased
|
||||||
margin-right: 0.3em
|
margin-right: 0.3em
|
||||||
|
|
||||||
|
.customfield-date
|
||||||
|
display: block
|
||||||
|
border-radius: 4px
|
||||||
|
padding: 1px 3px
|
||||||
|
|
|
@ -77,6 +77,9 @@ template(name="minicard")
|
||||||
if $eq definition.type "currency"
|
if $eq definition.type "currency"
|
||||||
+viewer
|
+viewer
|
||||||
= formattedCurrencyCustomFieldValue(definition)
|
= formattedCurrencyCustomFieldValue(definition)
|
||||||
|
else if $eq definition.type "date"
|
||||||
|
.date
|
||||||
|
+minicardCustomFieldDate
|
||||||
else
|
else
|
||||||
+viewer
|
+viewer
|
||||||
= trueValue
|
= trueValue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue