From 942e463b20a56d74d75021401e2e1e62e0b18dc2 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 13 Oct 2013 22:59:14 +0100 Subject: [PATCH] Fixes to get recent changes list to work --- core/modules/new_widgets/view.js | 5 +++-- core/wiki/recentchanges.tid | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/modules/new_widgets/view.js b/core/modules/new_widgets/view.js index 228d1af13..988c96964 100755 --- a/core/modules/new_widgets/view.js +++ b/core/modules/new_widgets/view.js @@ -44,6 +44,7 @@ ViewWidget.prototype.execute = function() { this.viewField = this.getAttribute("field","text"); this.viewIndex = this.getAttribute("index"); this.viewFormat = this.getAttribute("format","text"); + this.viewTemplate = this.getAttribute("template",""); switch(this.viewFormat) { case "wikified": this.text = this.getValueAsWikified(); @@ -55,7 +56,7 @@ ViewWidget.prototype.execute = function() { this.text = this.getValueAsHtmlEncoded(); break; case "date": - this.text = this.getValueAsDate(this.viewFormat); + this.text = this.getValueAsDate(this.viewTemplate); break; case "relativedate": this.text = this.getValueAsRelativeDate(); @@ -120,7 +121,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ ViewWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.title || changedAttributes.field || changedAttributes.index || changedTiddlers[this.viewTitle]) { + if(changedAttributes.title || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) { this.refreshSelf(); return true; } else { diff --git a/core/wiki/recentchanges.tid b/core/wiki/recentchanges.tid index 650842a75..f1fd438fc 100644 --- a/core/wiki/recentchanges.tid +++ b/core/wiki/recentchanges.tid @@ -1,8 +1,14 @@ title: $:/snippets/recentchanges <$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]" itemClass="tw-menu-list-item"> +
<$view field="modified" format="date" template="DDth MMM YYYY"/> <$list filter="[sameday{!!modified}!is[system]!sort[modified]]" itemClass="tw-menu-list-subitem"> -<$view field="title" format="link"/> +
+<$link to={{!!title}}> +<$view field="title"/> + +
+