-<h3>Add a new [%classmetadata.moniker%]</h3>
[% USE element_maker = Class("HTML::Element") %]
-<p>
<form method="post" action="[% base %]/[% classmetadata.moniker %]/do_edit/">
+<fieldset>
+<legend>Add a new [%classmetadata.moniker%]</legend>
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="class" value="[% classmetadata.name %]"/>
- <table class="view">
[% FOR col = classmetadata.columns;
NEXT IF col == "id";
SET element = classmetadata.cgi.$col;
SET element = element.unshift_content(new_element);
END;
%]
- <tr>
- <td class="field">[% classmetadata.colnames.$col; %]</td>
- <td>[% element.as_HTML; %]</td>
- </tr>
+ <label>
+ <span class="field">[% classmetadata.colnames.$col; %]</span>
+ [% element.as_XML; %]</label>
+
[% END; %]
- </table>
+
<input type="submit" name="create" value="create"/>
+ </div>
</form>
=cut
#%]
-<h3>Add a new [% classmetadata.moniker %]</h3>
-<form method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
+<form id="createform" method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
+ <fieldset>
+<legend>Add a new [% classmetadata.moniker %]</legend>
<input type="hidden" name="action" value="create"/>
- <table class="view">
[% FOR col = classmetadata.columns %]
[% NEXT IF col == "id" %]
- <tr>
- <td>[% classmetadata.colnames.$col %]</td>
- <td>[% classmetadata.cgi.$col.as_HTML; %]</td>
- </tr>
+ <label><span class="field">[% classmetadata.colnames.$col %]</span>
+ [% classmetadata.cgi.$col.as_XML; %]
+ </label>
[% END; %]
- </table>
<input type="submit" name="create" value="create"/>
+</fieldset>
</form>
[% PROCESS macros %]
[% INCLUDE header %]
[% FOR item = objects; %]
-<h2>Edit [% item.name %]</h2>
<form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
+<fieldset>
+<legend>Edit [% item.name %]</legend>
[% FOR col = classmetadata.columns;
NEXT IF col == "id";
- "<p>";
- "<b>"; classmetadata.colnames.$col; "</b>";
- ": ";
- item.to_field(col).as_HTML;
- "</p>";
+ '<label><span class="field">';
+ classmetadata.colnames.$col; ":</span>";
+ item.to_field(col).as_XML;
+ "</label>";
IF errors.$col;
- errors.$col;
+ '<span class="error">'; errors.$col;'</span>';
+ END;
END;
'<input type="submit" name="edit" value="edit"/>';
-END %]
+ "</fieldset></form>";
+
+ END %]
+
[% INCLUDE footer %]
</div>
+ <p>
</body>
</html>
<h2>Listing of all [% classmetadata.plural %]</h2>
[% END %]
[% INCLUDE navbar %]
-<div class="search">[% INCLUDE search_form %]</div>
+[% INCLUDE search_form %]
<div class="list">
- <table id="matrix" width="100%">
+ <table id="matrix" width="100%" >
<tr>
[% FOR col = classmetadata.columns.list;
NEXT IF col == "id";
"<th>";
SET additional = "?order=" _ col;
- SET additional = additional _ "&page=" _ pager.current_page
+ SET additional = additional _ "&page=" _ pager.current_page
IF pager;
- SET additional = additional _ "&o2=desc"
+ SET additional = additional _ "&o2=desc"
IF col == request.query.order and request.query.o2 != "desc";
link(classmetadata.table, "list", additional,
classmetadata.colnames.$col);
"</th>";
END %]
+ <th>Actions</th>
</tr>
[% SET count = 0;
FOR item = objects;
FOR col = classmetadata.columns;
NEXT IF col == "id";
"<td>";
- IF col == "url";
- "<a href="; item.url; "> "; item.url; "</a>";
+ IF col == "url" AND item.url;
+ '<a href="'; item.url; '"> '; item.url; '</a>';
ELSIF col == item.stringify_column;
maybe_link_view(item);
ELSE;
END;
"</td>";
END;
+ "<td>";
button(item, "edit");
button(item, "delete");
+ "</td>";
END %]
[%#
#%]
[% MACRO button(obj, action) BLOCK; %]
-<td>
-<form method="post"
- action="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
- <input type="submit" name="[% action %]" value="[% action %]"/>
-</form>
-</td>
+<a class="action" href="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
+ [% action %]</a>
[% END %]
[%#
-<h3>Search</h3>
<form method="get" action="[% base %]/[% classmetadata.moniker %]/search/">
+<fieldset class="search">
+<legend>Search</legend>
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="class" value="[% classmetadata.name %]"/>
- <table class="view">
[% FOR col = classmetadata.columns;
NEXT IF col == "id";
%]
- <tr>
- <td class=field>[% classmetadata.colnames.$col; %]</td>
- <td>
+ <label>
+ <span class="field">[% classmetadata.colnames.$col; %]</span>
[% SET element = classmetadata.cgi.$col;
IF element.tag == "select";
USE element_maker = Class("HTML::Element");
SET element = element.unshift_content(
element_maker.new("option", value," "));
END;
- element.as_HTML; %]
- </td>
- </tr>
+ element.as_XML; %]
+ </label>
[% END; %]
- </table>
<input type="submit" name="search" value="search"/>
+ </fieldset>
</form>
<td class="field">[% classmetadata.colnames.$col; %]</td>
<td>
[% IF col == "url"; # Possibly too much magic.
- "<a href="; item.url; "> "; item.url; "</a>";
+ '<a href="'; item.url; '"> '; item.url; '</a>';
ELSE;
maybe_link_view(item.$col);
END; %]
displays the results in a table.
#%]
+[% view_related(item); %]
+
[%
- view_related(item);
button(item, "edit");
button(item, "delete");
%]
[% END; %]
+[% INCLUDE footer %]
-HTML {
- PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
-}
-BODY {
- PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px;
- BACKGROUND-COLOR: #ffffea;
+html {
+ padding-right: 0px;
+ padding-left: 0px;
+ padding-bottom: 0px;
+ margin: 0px;
+ padding-top: 0px
+}
+body {
+ padding-right: 0px;
+ padding-left: 0px;
+ padding-bottom: 0px;
+ margin: 0px; padding-top: 0px;
+ background-color: #ffffea;
}
.content {
- PADDING: 12px;
- MARGIN-TOP: 1px; MARGIN-BOTTOM:0px;
- MARGIN-LEFT: 15px; MARGIN-RIGHT: 15px;
- BORDER-COLOR: #000000;
- BORDER-TOP: 0px;
- BORDER-BOTTOM: 0px;
- BORDER-LEFT: 1px;
- BORDER-RIGHT: 1px;
-}
-
-H1 {
- FONT-SIZE: 30pt; MARGIN: 0px;
- FONT-FAMILY: Optima, "Lucida Grande",Sans-serif;
- TEXT-ALIGN: center;
- PADDING-BOTTOM: 1em;
+ padding: 12px;
+ margin-top: 1px;
+ margin-bottom:0px;
+ margin-left: 15px;
+ margin-right: 15px;
+ border-color: #000000;
+ border-top: 0px;
+ border-bottom: 0px;
+ border-left: 1px;
+ border-right: 1px;
+}
+h1 {
+ font-size: 30pt;
+ margin: 0px;
+ font-family: Optima, "Lucida Grande",Sans-serif;
+ text-align: center;
+ padding-bottom: 1em;
+}
+h2 {
+ padding-right: 0.25em;
+ padding-left: 0.25em;
+ font-size: 16pt;
+ padding-bottom: 0.5em;
+ margin: 0px;
+ padding-top: 0.1em;
+ font-family: Optima, "Lucida Grande",Sans-serif;
+ text-align: center;
+}
+
+A {
+ text-decoration: none;
+ color:#225
+}
+A:hover {
+ text-decoration: underline;
+ color:#222
}
-H2 {
- PADDING-RIGHT: 0.25em; PADDING-LEFT: 0.25em; FONT-SIZE: 16pt;
- PADDING-BOTTOM: 0.5em; MARGIN: 0px; PADDING-TOP: 0.1em;
-FONT-FAMILY: Optima, "Lucida Grande",Sans-serif;
- TEXT-ALIGN: center;
-}
-
-A { text-decoration: none; color:#225 }
-A:hover { text-decoration: underline; color:#222 }
table {
-border: 0px solid;
-background-color: #ffffff;
-
+ border: 0px solid;
+ background-color: #ffffff;
}
+
#matrix th {
-background-color: #DDE;
-border: 1px solid;
+ background-color: #DDE;
+ border: 1px solid;
font: bold 12px Verdana, sans-serif;
}
#matrix tr.alternate { background-color:#EEF; }
-#matrix td {
- font: 12px Verdana, sans-serif;
-}
+#matrix td { font: 12px Verdana, sans-serif; }
-#navlist
-{
-padding: 3px 0;
-margin-left: 0;
-border-bottom: 1px solid #778;
-font: bold 12px Verdana, sans-serif;
+#navlist {
+ padding: 3px 0;
+ margin-left: 0;
+ border-bottom: 1px solid #778;
+ font: bold 12px Verdana, sans-serif;
}
-#navlist li
-{
-list-style: none;
-margin: 0;
-display: inline;
+#navlist li {
+ list-style: none;
+ margin: 0;
+ display: inline;
}
-#navlist li a
-{
-padding: 3px 0.5em;
-margin-left: 3px;
-border: 1px solid #778;
-border-bottom: none;
-background: #DDE;
-text-decoration: none;
+#navlist li a {
+ padding: 3px 0.5em;
+ margin-left: 3px;
+ border: 1px solid #778;
+ border-bottom: none;
+ background: #DDE;
+ text-decoration: none;
}
#navlist li a:link { color: #448; }
#navlist li a:visited { color: #667; }
-#navlist li a:hover
-{
-color: #000;
-background: #AAE;
-border-color: #227;
+#navlist li a:hover {
+ color: #000;
+ background: #AAE;
+ border-color: #227;
}
-#navlist li a#current
-{
-background: white;
-border-bottom: 1px solid white;
+#navlist li a#current {
+ background: white;
+ border-bottom: 1px solid white;
}
td { font: 12px Verdana, sans-serif; }
-.field {
-background-color: #DDE;
-border: 1px solid;
-font-weight: bold;
+
+
+fieldset {
+ padding: 1em;
+ font:80%/1 sans-serif;
+ border:1px solid #8484ce;
}
-#vlist
-{
-padding: 0 1px 1px;
-margin-left: 0;
-font: bold 12px Verdana, sans-serif;
-background: gray;
-width: 13em;
+legend {
+ padding: 0.2em 0.5em;
+ border:1px solid #8484ce;
+ font-size:90%;
+ text-align:right;
}
-#vlist li
-{
-list-style: none;
-margin: 0;
-border-top: 1px solid gray;
-text-align: left;
+label {
+ display:block;
}
-#vlist li a
-{
-display: block;
-padding: 0.25em 0.5em 0.25em 0.75em;
-border-left: 1em solid #AAB;
-background: #CCD;
-text-decoration: none;
+label .field {
+ float:left;
+ width:25%;
+ margin-right:0.5em;
+ padding-top:0.2em;
+ text-align:right;
+ font-weight:bold;
}
-#vlist li a:hover {
- border-color: #227;
+
+#vlist {
+ padding: 0 1px 1px;
+ margin-left: 0;
+ font: bold 12px Verdana, sans-serif;
+ background: gray;
+ width: 13em;
}
-.search {float:right; background: #ffa; padding-left: 5px; padding-right: 5px}
-.list { width: 70%; }
-.column-wrap { position: relative; }
-.leftcolumn { position: absolute; left: 10px; top: 50px; width: 200px;
- border-right: 1px dotted black;
+#vlist li {
+ list-style: none;
+ margin: 0;
+ border-top: 1px solid gray;
+ text-align: left;
}
-.centercolumn { margin-left: 200px; margin-right: 300px; }
-.rightcolumn { position: absolute; right: 0px; top: 50px; width: 300px; }
-.messages {
- margin: 20px; padding: 3px; border: 1px solid black;
- background: #ddd;
- font: bold 12px Verdana, sans-serif;
+#vlist li a {
+ display: block;
+ padding: 0.25em 0.5em 0.25em 0.75em;
+ border-left: 1em solid #AAB;
+ background: #CCD;
+ text-decoration: none;
}
+#vlist li a:hover {
+ border-color: #227;
+}
+.search {width: 25%;border:1px outset #000;float:right; background: #eef;}
+.search legend {border:none;}
.error { color: #d00; }
-.chorus { font-style: italic; position: relative; margin-left:50px; }
+.list { width: 70%; }
+.action { style:block;