1
define(["dojo/_base/declare","dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/dom-construct", "dojo/query", "dojo/text!./ChangelogItem.html", "dojo/NodeList-manipulate"],
2
function(declare, WidgetBase, TemplatedMixin, domC, q, template) {
4
return declare([WidgetBase, TemplatedMixin], {
5
templateString: template,
6
baseClass: "printableform",
8
buildRendering: function() {
10
widget.inherited(arguments);
11
widget.changes.forEach(
13
function insertChangeline(bits) {
14
var line = q(domC.create("li"))
15
.append(q(domC.create("strong", {"class": "column"}))
17
bits.forEach(function (b) {line.append(b);});
18
q(widget.changelineList).append(line);
20
function emstring(str) {
21
return q(domC.create("em")).text(str);
23
if (change.field == 'description') {
24
insertChangeline([" modified"]);
25
} else if (!change.oldvalue) {
27
[" set to ",emstring(change.newvalue)]);
29
} else if (!change.newvalue) {
30
insertChangeline([" removed"]);
34
emstring(change.oldvalue),
36
emstring(change.newvalue)]);