--- /dev/null
+<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%]">
+ [% FOR col = classmetadata.columns;
+ NEXT IF col == "id";
+ "<b>";classmetadata.colnames.$col;"</b> : ";
+ 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;
+ element.as_HTML;
+ %]
+ <BR>
+ [% END; %]
+ <INPUT TYPE="submit" NAME="create" VALUE="create">
+</FORM>
--- /dev/null
+[% INCLUDE header %]
+
+<h2> Main menu </h2>
+
+<TABLE BORDER="0" ALIGN="center" WIDTH="70%">
+<TR>
+<TD ALIGN="left">
+<P>
+<A HREF="/user/list"><IMG SRC="/images/users.png"> Administer users</A>
+</P>
+</TD>
+<TD ALIGN="right">
+<P>
+<A HREF="/computer/list"><IMG SRC="/images/computer.png"> Administer
+computers</A>
+</P>
+</TD>
+</TR>
+
+<TR>
+<TD ALIGN="left">
+<P>
+<A HREF="/blog/"><IMG SRC="/images/blog.png"> House blog</A>
+</P>
+</TD>
+<TD ALIGN="right">
+<P>
+<A HREF="/phoneNumber/list"><IMG SRC="/images/phone.png"> Register
+phone calls</A>
+</P>
+</TD>
+</TR>
+<TR>
+<TD ALIGN="left">
+<P>
+<A HREF="http://mp3z.trinity-house.org.uk/"><IMG
+SRC="/images/itunes.png">Stream music</A>
+</P>
+</TD>
+<TD ALIGN="right">
+<P>
+</P>
+</TD>
+</TR>
+
+</TABLE>
+
+<BR>
+[% INCLUDE small_blog %]
--- /dev/null
+<HTML>
+ <HEAD>
+ <TITLE> Beer Database </TITLE>
+<META http-equiv=Content-Type content="text/html; charset=utf-8">
+
+<LINK title=myStyle href="/trinity.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">
+
--- /dev/null
+<h3>Add a new [%classmetadata.moniker%]</h3>
+<FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/do_edit/">
+ <INPUT TYPE="hidden" NAME="action" VALUE="create">
+ <INPUT TYPE="hidden" NAME="class" VALUE="[%classmetadata.name%]">
+ [% FOR col = classmetadata.columns;
+ NEXT IF col == "id";
+ "<b>";classmetadata.colnames.$col;"</b> : ";
+ classmetadata.cgi.$col.as_HTML;
+ %]
+ <BR>
+ [% END; %]
+ <INPUT TYPE="submit" NAME="create" VALUE="create">
+</FORM>
--- /dev/null
+[% PROCESS list_macros %]
+[% INCLUDE header %]
+
+[% FOR item = objects; %]
+<h2> Edit [% item.name %]</h2>
+
+<FORM ACTION="[% base %]/[% classmetadata.moniker %]/do_edit/[% item.id %]" METHOD="post">
+[%
+ FOR col = classmetadata.columns;
+ NEXT IF col == "id";
+ "<P>";
+ "<B>"; classmetadata.colnames.$col; "</B>";
+ ": ";
+ item.to_field(col).as_HTML;
+ "</P>";
+ IF errors.$col;
+ "<FONT COLOR=\"#ff0000\">"; errors.$col; "</FONT>";
+ END;
+ END;
+ '<INPUT TYPE="submit" NAME="edit" VALUE="edit">';
+END %]
--- /dev/null
+[% INCLUDE header %]
+
+<h2> Main menu </h2>
+
+<TABLE BORDER="0" ALIGN="center" WIDTH="70%">
+<TR>
+<TD ALIGN="left">
+<P>
+<A HREF="/user/list"><IMG SRC="/images/users.png"> Administer users</A>
+</P>
+</TD>
+<TD ALIGN="right">
+<P>
+<A HREF="/computer/list"><IMG SRC="/images/computer.png"> Administer
+computers</A>
+</P>
+</TD>
+</TR>
+
+<TR>
+<TD ALIGN="left">
+<P>
+<A HREF="/blog/"><IMG SRC="/images/blog.png"> House blog</A>
+</P>
+</TD>
+<TD ALIGN="right">
+<P>
+<A HREF="/phoneNumber/list"><IMG SRC="/images/phone.png"> Register
+phone calls</A>
+</P>
+</TD>
+</TR>
+
+</TABLE>
+
+<BR>
+[% INCLUDE small_blog %]
--- /dev/null
+<HTML>
+ <HEAD>
+ <TITLE> You want to put the title of your application here <TITLE>
+ </HEAD>
+ <BODY>
--- /dev/null
+[% PROCESS list_macros %]
+
+[% INCLUDE header %]
+
+<h2> Listing of all [% classmetadata.plural %]</h2>
+
+[% INCLUDE navbar %]
+
+<TABLE id="matrix" WIDTH="100%">
+<TR>
+[% FOR col = classmetadata.columns.list;
+ NEXT IF col == "id";
+ "<TH>"; classmetadata.colnames.$col; "</TH>";
+END %]
+</TR>
+
+[% SET count = 0;
+FOR item = objects;
+ SET count = count + 1;
+ "<tr";
+ ' class="alternate"' IF count % 2;
+ ">";
+ display_line(item);
+ "</tr>";
+END %]
+</TABLE>
+
+
+[% INCLUDE addnew; %]
--- /dev/null
+[% MACRO display_line(item) BLOCK;
+ FOR col = classmetadata.columns;
+ NEXT IF col == "id";
+ "<td>";
+ "<A HREF='" _ base _ item.$col.moniker _ "/view/" _
+ item.$col.id _"'>" IF item.$col.moniker; # it's an object
+ item.$col;
+ "</A>" IF item.$col.moniker;
+ "</td>";
+ END;
+ button(item, "edit");
+ button(item, "delete");
+END %]
+[% MACRO button(obj, action) BLOCK; %]
+
+<TD>
+<FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/[%action%]/[%obj.id%]">
+ <INPUT TYPE="submit" NAME="[%action%]" VALUE="[%action%]">
+</FORM>
+</TD>
+[% END %]
+
--- /dev/null
+<div id="navcontainer">
+<ul id="navlist">
+[%
+ FOR table = config.display_tables;
+ '<LI '; 'id="active"' IF table == classmetadata.moniker;
+ '>';
+ '<A HREF="';
+ base; table; "/list/";
+ '"';
+ ' id="current"' IF table == classmetadata.moniker;
+ '> '; table; "</A>";
+ END;
+%]
+</ul>
+</div>
+
--- /dev/null
+[% MACRO button(obj, action) BLOCK; %]
+
+<TD>
+<FORM METHOD="post" ACTION="[%base%]/[%classmetadata.moniker%]/[%action%]/[%obj.id%]">
+ <INPUT TYPE="submit" NAME="[%action%]" VALUE="[%action%]">
+</FORM>
+</TD>
+[% END %]
+
+[% INCLUDE header %]
+
+[% FOR item = objects %]
+<h2> [% item.name %]</h2>
+
+[% FOR col = classmetadata.columns.list;
+ NEXT IF col == "id";
+ "<P>";
+ classmetadata.colnames.$col; ":";
+ " "; item.$col;"</p>";
+ END;
+ button(item, "edit");
+ button(item, "delete");
+ "</tr>";
+END;
+%]
+