<h3>Add a new [%classmetadata.moniker%]</h3>
[% USE element_maker = Class("HTML::Element") %]
-<P>
-<FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/do_edit/">
- <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;
- IF col == "brewery";
- SET create_url = base _ "/brewery/edit";
- SET new_element = element_maker.new("option",
- "class", "redirect",
- "value", create_url).push_content("Create new brewery");
- SET child = element.content_list.first;
- SET foo = element.attr("name", "navi");
- SET child = child.attr("selected", "selected");
- SET element =
- element.unshift_content(element_maker.new("option", value," "));
- element.attr("onChange", "go()");
- SET element = element.unshift_content(new_element);
- END;
- %]
- <TR> <TD class="field"> [% classmetadata.colnames.$col; %]
- </TD>
- <TD> [% element.as_HTML; %] </TD> </TR>
- [% END; %]
- </TABLE>
- <INPUT TYPE="submit" NAME="create" VALUE="create">
-</FORM>
+<p>
+<form method="post" action="[% base %]/[% classmetadata.moniker %]/do_edit/">
+ <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;
+ IF col == "brewery";
+ SET create_url = base _ "/brewery/edit";
+ SET new_element = element_maker.new("option",
+ "class", "redirect",
+ "value", create_url).push_content("Create new brewery");
+ SET child = element.content_list.first;
+ SET foo = element.attr("name", "navi");
+ SET child = child.attr("selected", "selected");
+ SET element =
+ element.unshift_content(element_maker.new("option", value," "));
+ element.attr("onChange", "go()");
+ SET element = element.unshift_content(new_element);
+ END;
+ %]
+ <tr>
+ <td class="field">[% classmetadata.colnames.$col; %]</td>
+ <td>[% element.as_HTML; %]</td>
+ </tr>
+ [% END; %]
+ </table>
+ <input type="submit" name="create" value="create"/>
+</form>
+++ /dev/null
-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;
-}
-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;
-
-}
-#matrix th {
-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;
-}
-
-#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 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#current
-{
-background: white;
-border-bottom: 1px solid white;
-}
-
-td { font: 12px Verdana, sans-serif; }
-.field {
-background-color: #DDE;
-border: 1px solid;
-font-weight: bold;
-}
-
-#vlist
-{
-padding: 0 1px 1px;
-margin-left: 0;
-font: bold 12px Verdana, sans-serif;
-background: gray;
-width: 13em;
-}
-
-#vlist li
-{
-list-style: none;
-margin: 0;
-border-top: 1px solid gray;
-text-align: left;
-}
-
-#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 {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;
-}
-.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;
-}
-
-.error { color: #d00; }
-
-.chorus { font-style: italic; position: relative; margin-left:50px; }
+++ /dev/null
-[% INCLUDE header %]
-
-<h2> The beer database </h2>
-
-<TABLE BORDER="0" ALIGN="center" WIDTH="70%">
-[% FOR table = config.display_tables %]
-<TR>
-<TD>
-<A HREF="[%table%]/list">List by [%table %]</A>
-</TD>
-</TR>
-[% END %]
-</TABLE>
-
-<BR>
-[% INCLUDE footer %]
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE> Beer Database </TITLE>
-<META http-equiv=Content-Type content="text/html; charset=utf-8">
-
-<LINK title=myStyle href="/beerdb.css" type=text/css rel=stylesheet>
-
-<script language="javascript" type="text/javascript">
-<!--
-function go()
-{
- box = document.forms[-1].navi;
- destination = box.options[box.selectedIndex].value;
- if (box.options[box.selectedIndex].class == 'redirect')
- location.href = destination;
-}
-
-// -->
-</SCRIPT>
-</HEAD>
-<BODY>
-<DIV class="content">
-
#%]
<h3>Add a new [% classmetadata.moniker %]</h3>
-<form method=post action="[% base %]/[% classmetadata.table %]/do_edit/">
- <input type=hidden name=action value=create />
- <table class=view>
+<form method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
+ <input type="hidden" name="action" value="create"/>
+ <table class="view">
[% FOR col = classmetadata.columns %]
[% NEXT IF col == "id" %]
<tr>
</tr>
[% END; %]
</table>
- <input type=submit name=create value=create />
+ <input type="submit" name="create" value="create"/>
</form>
[% INCLUDE header %]
[% FOR item = objects; %]
<h2>Edit [% item.name %]</h2>
-<form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method=post>
+<form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
[% FOR col = classmetadata.columns;
NEXT IF col == "id";
"<p>";
IF errors.$col;
errors.$col;
END;
- '<input type=submit name=edit value=edit />';
+ '<input type="submit" name="edit" value="edit"/>';
END %]
[% INCLUDE footer %]
<h2>
[% config.application_name || "A poorly configured Maypole application" %]
</h2>
-<table border=0 align=center width=70%>
+<table border="0" align="center" width="70%">
[% FOR table = config.display_tables %]
<tr>
<td>
"A poorly configured Maypole application"
%]
</title>
- <meta http-equiv=Content-Type content="text/html; charset=utf-8" />
- <link title=Maypole href=/maypole.css type=text/css rel=stylesheet />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <link title="Maypole" href="/maypole.css" type="text/css"
+ rel="stylesheet"/>
<script language="javascript" type="text/javascript">
<!--
function go()
<h2>Listing of all [% classmetadata.plural %]</h2>
[% END %]
[% INCLUDE navbar %]
-<div class=search>[% INCLUDE search_form %]</div>
-<div class=list>
- <table id=matrix width=100%>
+<div class="search">[% INCLUDE search_form %]</div>
+<div class="list">
+ <table id="matrix" width="100%">
<tr>
[% FOR col = classmetadata.columns.list;
NEXT IF col == "id";
NEXT IF col == "id";
"<td>";
IF col == "url";
- "<A HREF="; item.url; "> "; item.url; "</A>";
+ "<a href="; item.url; "> "; item.url; "</a>";
ELSIF col == item.stringify_column;
maybe_link_view(item);
ELSE;
#%]
[% MACRO button(obj, action) BLOCK; %]
<td>
-<form method=post action="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
- <input type=submit name=[% action %] value=[% action %] />
+<form method="post"
+ action="[% base %]/[% obj.table %]/[% action %]/[% obj.id %]">
+ <input type="submit" name="[% action %]" value="[% action %]"/>
</form>
</td>
[% END %]
<h3>Search</h3>
-<form method=get action="[% base %]/[% classmetadata.moniker %]/search/">
- <input type=hidden name=action value=create />
- <input type=hidden name=class value=[% classmetadata.name %] />
- <table class=view>
+<form method="get" action="[% base %]/[% classmetadata.moniker %]/search/">
+ <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>
[% END; %]
</table>
- <input type=submit name=search value=search>
+ <input type="submit" name="search" value="search"/>
</form>
[% SET string = item.stringify_column %]
<h2> [% item.$string %]</h2>
[% INCLUDE navbar %]
- <table class=view>
+ <table class="view">
<tr>
<td class="field">[% classmetadata.colnames.$string %]</td>
<td>[% item.$string %]</td>
#%]
<tr>
- <td class=field>[% classmetadata.colnames.$col; %]</td>
+ <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; %]
--- /dev/null
+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;
+}
+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;
+
+}
+#matrix th {
+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;
+}
+
+#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 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#current
+{
+background: white;
+border-bottom: 1px solid white;
+}
+
+td { font: 12px Verdana, sans-serif; }
+.field {
+background-color: #DDE;
+border: 1px solid;
+font-weight: bold;
+}
+
+#vlist
+{
+padding: 0 1px 1px;
+margin-left: 0;
+font: bold 12px Verdana, sans-serif;
+background: gray;
+width: 13em;
+}
+
+#vlist li
+{
+list-style: none;
+margin: 0;
+border-top: 1px solid gray;
+text-align: left;
+}
+
+#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 {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;
+}
+.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;
+}
+
+.error { color: #d00; }
+
+.chorus { font-style: italic; position: relative; margin-left:50px; }