X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2Ftemplates%2Ffactory%2Fmacros;h=cbf58bb21902fd0b1f80a907190363aa184ecf1b;hb=a02686080acb66fce170e9657e110761b09e62a2;hp=a102c736a523dd78677661140fec7d0400892ca3;hpb=9248ebe461d183756053e56e7b1941f5c682e344;p=maypole.git diff --git a/lib/Maypole/templates/factory/macros b/lib/Maypole/templates/factory/macros index a102c73..cbf58bb 100644 --- a/lib/Maypole/templates/factory/macros +++ b/lib/Maypole/templates/factory/macros @@ -16,7 +16,7 @@ MACRO link(table, command, additional, label) BLOCK; SET lnk = base _ "/" _ table _ "/" _ command _ "/" _ additional; lnk = lnk | uri | html; ''; - label; + label | html; ""; END; %] @@ -37,7 +37,7 @@ MACRO maybe_link_view(object) BLOCK; IF object.isa('Maypole::Model::Base'); link(object.table, "view", object.id.join('/'), object); ELSE; - object; + object | html ; END; END; %] @@ -58,7 +58,7 @@ for some. NEXT IF col == "id" OR col == classmetadata.table _ "_id"; ""; IF col == "url" AND item.url; - ' '; item.url; ''; + ' '; item.url; ''; ELSIF col == classmetadata.stringify_column; maybe_link_view(item); ELSE; @@ -129,12 +129,12 @@ This takes an object and and displays its properties in a table. #%] [% MACRO view_item(item) BLOCK; %] [% SET string = classmetadata.stringify_column %] -
[% item.$string %]
+
[% item.$string | html %]
[% INCLUDE navbar %] - + [% FOR col = classmetadata.columns.list; NEXT IF col == "id" OR col == string OR col == classmetadata.table _ "_id";; @@ -152,7 +152,7 @@ from the C method:
[% classmetadata.colnames.$string %][% item.$string %][% item.$string | html %]
[% classmetadata.colnames.$col; %] [% IF col == "url" && item.url; # Possibly too much magic. - ' '; item.url; ''; + ' '; item.url; ''; ELSE; maybe_link_view(item.$col); END; %]