File: edit

package info (click to toggle)
maypole 2.10-1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 472 kB
  • ctags: 108
  • sloc: perl: 1,345; makefile: 21
file content (38 lines) | stat: -rw-r--r-- 980 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[%#

=head1 edit

This is the edit page. It edits the passed-in object, by displaying a
form similar to L<addnew> but with the current values filled in.

=cut

#%]
[% PROCESS macros %]
[% INCLUDE header %]
[% INCLUDE title %]
[% IF objects.size %]
<div id="title">Edit a [% classmetadata.moniker %]</div>
[% FOR item = objects; %]
<form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
<fieldset>
<legend>Edit [% item.name %]</legend>
[% FOR col = classmetadata.columns;
    NEXT IF col == "id";
    '<label><span class="field">';
    classmetadata.colnames.$col; ":</span>";
    item.to_field(col).as_XML;
    "</label>";
    IF errors.$col; 
       '<span class="error">'; errors.$col;'</span>';
    END;
    END %]
    <input type="submit" name="edit" value="edit"/>
    <input type="hidden" name="__form_id" value="[% request.make_random_id %]">
    </fieldset></form>
    
    [% END %]
[% ELSE %]
[% INCLUDE addnew %]
[% END %]
[% INCLUDE footer %]