Commit 9208b054 authored by Peter Harrison's avatar Peter Harrison

[#47] Display Title of Card rather than Type.

Also placed the Phase on the right next to details of when created.
parent d2beaf0e
...@@ -128,6 +128,13 @@ ...@@ -128,6 +128,13 @@
top: 0; top: 0;
} }
.card-wrapper .card em span.card-phase {
float: right;
font-size: 10pt;
font-weight: normal;
position: relative;
}
.card-wrapper .card .card-modified { .card-wrapper .card .card-modified {
display: block; display: block;
font-size: 9pt; font-size: 9pt;
......
...@@ -116,30 +116,45 @@ var cards = { ...@@ -116,30 +116,45 @@ var cards = {
drawCard: function(data, id, pos) { drawCard: function(data, id, pos) {
var $card; 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; return;
if (typeof pos == 'object') { if (typeof pos == 'object') {
pos.append('<div class="card" data-id="' + id + '" data-phase="' + data.phase + '">' + pos.append('<div class="card" data-id="' + id + '" data-phase="' + data.phase + '">' +
'<h1>' + (template.templates[data.template].name) + '<span class="card-id">#' + data.id + '</span></h1>' + '<h1>' + title + '<span class="card-id">#' + data.id + '</span></h1>' +
'<em class="card-modified">' + '<em class="card-modified">' +
(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) + '' + (data.modified && data.modified != null?"Modified ":"Created ") +
'<br />' + convertDateToString((data.modified && data.modified != null)?data.modified: data.created) +
'<strong>Phase: </strong>' + phase.phases[data.phase].name + ' by ' +
'</em>' + (data.modified && data.modified != null?data.modifiedby:data.creator) +
'' +
'<span class="card-phase">' +
phase.phases[data.phase].name +
'</span></em>' +
'</div>'); '</div>');
$card = pos.find('div.card').last(); $card = pos.find('div.card').last();
} else { } else {
var $cell = $('div.card').eq(pos); var $cell = $('div.card').eq(pos);
$cell.replaceWith('<div class="card" data-id="' + id + '" data-phase="' + data.phase + '">' + $cell.replaceWith('<div class="card" data-id="' + id + '" data-phase="' + data.phase + '">' +
'<h1>' + (template.templates[data.template].name) + '<span class="card-id">#' + data.id + '</span></h1>' + '<h1>' + title + '<span class="card-id">#' + data.id + '</span></h1>' +
'<em class="card-modified">' + '<em class="card-modified">' +
(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) + '' + (data.modified && data.modified != null?"Modified ":"Created ") +
'<br />' + convertDateToString((data.modified && data.modified != null)?data.modified: data.created) +
'<strong>Phase: </strong>' + phase.phases[data.phase].name + ' by ' +
'</em>' + (data.modified && data.modified != null?data.modifiedby:data.creator) +
'</div>'); '' +
'<span class="card-phase">' +
phase.phases[data.phase].name +
'</span></em>' +
'</div>');
$card = $('div.card').eq(pos); $card = $('div.card').eq(pos);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment