[% 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;
%]
<label>
<span class="field">[% classmetadata.colnames.$col; %]</span>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link title="Maypole" href="/maypole.css" type="text/css"
rel="stylesheet"/>
- <script 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>
+ </head>
<body>
<div class="content">