From 9208b054d099c42fc84397c7bcc0b89fef60cc89 Mon Sep 17 00:00:00 2001 From: cheetah100 Date: Fri, 27 May 2016 14:01:45 +1200 Subject: [PATCH] [#47] Display Title of Card rather than Type. Also placed the Phase on the right next to details of when created. --- src/main/webapp/css/core/board.css | 7 +++++ src/main/webapp/scripts/core/cards.js | 41 ++++++++++++++++++--------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/css/core/board.css b/src/main/webapp/css/core/board.css index 39a1956..d2a3e33 100644 --- a/src/main/webapp/css/core/board.css +++ b/src/main/webapp/css/core/board.css @@ -128,6 +128,13 @@ top: 0; } +.card-wrapper .card em span.card-phase { + float: right; + font-size: 10pt; + font-weight: normal; + position: relative; +} + .card-wrapper .card .card-modified { display: block; font-size: 9pt; diff --git a/src/main/webapp/scripts/core/cards.js b/src/main/webapp/scripts/core/cards.js index 79bc02b..c405eab 100644 --- a/src/main/webapp/scripts/core/cards.js +++ b/src/main/webapp/scripts/core/cards.js @@ -116,30 +116,45 @@ var cards = { drawCard: function(data, id, pos) { var $card; - if (typeof template.templates[data.template] === "undefined") + tm = template.templates[data.template]; + title = tm.name; + + if(Object.keys(data.fields).length > 0){ + title = title + ': ' + data.fields[Object.keys(data.fields)[0]]; + } + + if (typeof tm === "undefined") return; if (typeof pos == 'object') { pos.append('
' + - '

' + (template.templates[data.template].name) + '#' + data.id + '

' + + '

' + title + '#' + data.id + '

' + '' + - (data.modified && data.modified != null?"Modified ":"Created ") + convertDateToString((data.modified && data.modified != null)?data.modified: data.created) + ' by ' + (data.modified && data.modified != null?data.modifiedby:data.creator) + '' + - '
' + - 'Phase: ' + phase.phases[data.phase].name + - '
' + + (data.modified && data.modified != null?"Modified ":"Created ") + + convertDateToString((data.modified && data.modified != null)?data.modified: data.created) + + ' by ' + + (data.modified && data.modified != null?data.modifiedby:data.creator) + + '' + + '' + + phase.phases[data.phase].name + + '' + '
'); $card = pos.find('div.card').last(); } else { var $cell = $('div.card').eq(pos); $cell.replaceWith('
' + - '

' + (template.templates[data.template].name) + '#' + data.id + '

' + - '' + - (data.modified && data.modified != null?"Modified ":"Created ") + convertDateToString((data.modified && data.modified != null)?data.modified: data.created) + ' by ' + (data.modified && data.modified != null?data.modifiedby:data.creator) + '' + - '
' + - 'Phase: ' + phase.phases[data.phase].name + - '
' + - '
'); + '

' + title + '#' + data.id + '

' + + '' + + (data.modified && data.modified != null?"Modified ":"Created ") + + convertDateToString((data.modified && data.modified != null)?data.modified: data.created) + + ' by ' + + (data.modified && data.modified != null?data.modifiedby:data.creator) + + '' + + '' + + phase.phases[data.phase].name + + '' + + ''); $card = $('div.card').eq(pos); } -- GitLab