[% PROCESS scaffold/header.tt %]
<p>[% message %]</p>
[% FOR efield IN form.error_fields %]
<div class='error' id=error>[% efield.errors %] </div>
[% END %]
<form action="[% action %]" method="post">
<p>
[% f = form.field('title') %]
<label class="label" for="[% f.name %]">[% f.label %]</label>
<input type="text" name="[% f.name %]" id="[% f.name %]" value="[% f.fif %]">
</p>
<p>
[% form.render_field('author') %]
</p>
<p>
[% f = form.field('genres') %]
<label class="label" for="[% f.name %]">[% f.label %]</label>
<select name="[% f.name %]" multiple="multiple" size="5">
[% FOR option IN f.options %]
<option value="[% option.value %]" [% FOREACH selval IN f.fif %][% IF selval == option.value %]selected="selected"[% END %][% END %]>[% option.label | html %]</option>
[% END %]
</select>
</p>
<p>
[% f = form.field('publisher') %]
[% PROCESS widget/text.tt %]
</p>
<p>
[% f = form.field('isbn') %]
<label class="label" for="[% f.name %]">[% f.label %]</label>
<input type="text" name="[% f.name %]" id="[% f.name %]" value="[% f.fif %]">
</p>
<p>
[% f = form.field('format') %]
<label class="label" for="[% f.name %]">[% f.label %]</label>
<select name="[% f.name %]">
[% FOR option IN f.options %]
<option value="[% option.value %]" [% IF option.value == f.fif
%]selected="selected"[% END %]>[% option.label | html %]</option>
[% END %]
</select>
</p>
<p>
[% f = form.field('pages') %]
<label class="label" for="[% f.name %]">[% f.label %]</label>
<input type="text" name="[% f.name %]" id="[% f.name %]" value="[% f.fif %]">
</p>
<p>
[% f = form.field('year') %]
<label class="label" for="[% f.name %]">[% f.label %]</label>
<input type="text" name="[% f.name %]" id="[% f.name %]" value="[% f.fif %]">
</p>
<input type="submit" value="Save"/>
<form/>
<p><a class="big" href="[% c.uri_for('list') %]">> LIST</a></p>
[% PROCESS scaffold/footer.tt %]