[% typetitle = factory.title(type) %]

<form action="[% config.url %]" method="POST" style="border-top: 1px solid #666; margin-top: 30px;">

<input type="hidden" name="type" value="[% thing.type || type %]">
<input type="hidden" name="id" value="[% thing.id || 'new' %]">
<input type="hidden" name="op" value="store">

<h2>
[% IF thing %]
    edit [% thing.class_title %] '[% thing.title %]'
[% ELSE %]
    add a new [% typetitle %]
[% END %]
</h2>

<p><b>title</b><br>
<input type="text" name="title" value="[% thing.title %]" size="44">
</p>

<p><b>description</b><br>
<textarea name="description" wrap="virtual" rows="12" cols="44">[% thing.description %]</textarea>
</p>

[% INCLUDE "edit/${type}.html" %]

<p>This doesn't work with SQLite at the moment: bind_params seem to unbind and updates fail.</p>

<input type="submit" value=" store [% typetitle %]">

</form>
