]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/templates/factory/macros
Fixed FromCGI and AsForm some more. No official tests in crud.t yet but
[maypole.git] / lib / Maypole / templates / factory / macros
index 53f6952dcc82809f33fedab92425d7cfd319e5b7..c96cb17db8d7818e23b0a04efbbf5273083bd8ce 100644 (file)
@@ -138,7 +138,7 @@ This takes an object and and displays its properties in a table.
     [% INCLUDE navbar %]
     <table class="view">
         <tr>
-            <td class="field">[% classmetadata.colnames.$string %]</td>
+            <td class="field">[% classmetadata.colnames.$string  %]</td>
             <td>[% item.$string | html %]</td>
         </tr>
         [% FOR col = classmetadata.columns.list;
@@ -154,11 +154,18 @@ from the C<column_names> method:
 
 #%]
             <tr>
-                <td class="field">[% classmetadata.colnames.$col; %]</td>
+                <td class="field">[% classmetadata.colnames.$col || 
+                     col | ucfirst | replace('_',' '); %]</td>
                 <td>
                     [% IF col == "url" && item.url;  # Possibly too much magic.
                         '<a href="'; item.url | html ; '"> '; item.url; '</a>';
+                                       ELSIF item.$col.size > 1; # has_many column
+                                               FOR thing IN item.$col; 
+                                                       maybe_link_view(thing);",  ";
+                                                END;
+
                     ELSE;
+                                       
                         maybe_link_view(item.$col); 
                     END; %]
 [%#