]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/view
Remove "name" magic, replace with "stringify_column" magic.
[maypole.git] / templates / factory / view
index 0ea412e2291831ecef58891ce43c3f22bd8ac0c2..0a0860e404e349652fd977fdbfd27c3cb58344a1 100644 (file)
@@ -12,15 +12,16 @@ C<objects> and displays the object's properties in a table.
 [% INCLUDE header %]
 
 [% FOR item = objects %]
-<h2> [% item.name %]</h2>
+[% SET string = item.stringify_column %]
+<h2> [% item.$string %]</h2>
 
 [% INCLUDE navbar %]
 
 <TABLE class="view">
-    <TR><TD class="field">Name</TD><TD> [% item.name %] </TD></TR>
+    <TR><TD class="field">[% classmetadata.colnames.$string %]</TD><TD> [% item.$string %] </TD></TR>
 [% 
     FOR col = classmetadata.columns.list;
-    NEXT IF col == "id" OR col == "name";
+    NEXT IF col == "id" OR col == string;
     NEXT UNLESS item.$col;
 %]
 
@@ -31,7 +32,7 @@ C<objects> and displays the object's properties in a table.
 It gets the displayable form of a column's name from the hash returned
 from the C<column_names> method:
 
-%#]
+#%]
 
     <TR>
     <TD class="field"> [% classmetadata.colnames.$col; %] </TD>
@@ -48,7 +49,7 @@ from the C<column_names> method:
 #One interesting macro used in this template is C<maybe_link_view>:
 
         maybe_link_view(item.$col); 
-%]
+%] 
 
 [%#