=head2 link
-This creates an <A HREF="... to a command in the Apache::MVC system by
+This creates an <A HREF="..."> to a command in the Apache::MVC system by
catenating the base URL, table, command, and any arguments.
#%]
[%
MACRO maybe_link_view(object) BLOCK;
- IF object.table; # It's an object, i.e. a has-a
- link(object.table, "view", object.id, object);
+ IF object.isa('Maypole::Model::Base');
+ link(object.table, "view", object.id.join('/'), object);
ELSE;
object;
END;
#%]
[% MACRO display_line(item) BLOCK;
- FOR col = classmetadata.columns;
+ FOR col = classmetadata.list_columns;
NEXT IF col == "id";
"<td>";
IF col == "url" AND item.url;
END;
"</td>";
END;
- "<td nowrap>";
+ '<td class="actions">';
button(item, "edit");
button(item, "delete");
"</td>";
#%]
[% MACRO button(obj, action) BLOCK; %]
-<a class="action" href="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
- [% action %]</a>
+[% IF obj.is_public(action) %]
+<form class="actionform" action="[% base %]/[% obj.table %]/[% action %]/[% obj.id.join('/') %]" method="post">
+<div class="field"><input class="actionbutton" type="submit" value="[% action %]" /></div></form>
+[% END %]
[% END %]
[%#