X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=templates%2Ffactory%2Fmacros;h=edae5c1a61647b0c5dacd3a173823c3e783d5229;hb=1970b15356f27bd73d99f6d8160088c616cea5cb;hp=7e3284c3861196d45be137e0e57b1765ef9a40a3;hpb=ca325e68ce3620b52a3c8c9ed437ed79c5d1a744;p=maypole.git diff --git a/templates/factory/macros b/templates/factory/macros index 7e3284c..edae5c1 100644 --- a/templates/factory/macros +++ b/templates/factory/macros @@ -13,7 +13,7 @@ catenating the base URL, table, command, and any arguments. #%] [% MACRO link(table, command, additional, label) BLOCK; - ''; + ''; label; ""; END; @@ -31,9 +31,10 @@ command for that object. Otherwise, it just displays the data. #%] [% + MACRO maybe_link_view(object) BLOCK; - IF object.moniker; # It's an object, i.e. a has-a - link(object.moniker, "view", object.id, object); + IF object.table; # It's an object, i.e. a has-a + link(object.table, "view", object.id, object); ELSE; object; END; @@ -57,7 +58,7 @@ for some. ""; IF col == "url"; " "; item.url; ""; - ELSIF col == "name"; + ELSIF col == item.stringify_column; maybe_link_view(item); ELSE; maybe_link_view(item.$col); @@ -78,7 +79,7 @@ This is a generic button, which performs an action on an object. #%] [% MACRO button(obj, action) BLOCK; %] -
+