aboutsummaryrefslogtreecommitdiffstats
path: root/root/user/index.tt
blob: 873be65a2eae63f0a5e1029594d3b6be48a6afe5 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<div id="input_form">
<form method="post" action="">
    <table>
        <tr><th>[% l('Attribute') %]</th><th>[% l('Value') %]</th><th></th></tr>
        [% FOREACH attr IN values %]
        <tr>
            <td>[% attr.name %]</td>
            <td>
                [% FOREACH val IN attr.values %]
                    [% IF attr.editable %]<input type="hidden" name="[% attr.name %]_old" value="[% val %]" />
                        <input name="[% attr.name %]_new" value="[% val %]" />
                    [% ELSE %]
                        [% val %]
                        <br/>
                    [% END %]
                [% END %]
            </td>
            <td>
                [% FOREACH val IN attr.values %]
                    [% IF attr.addable AND attr.editable %]
                    <button type="button" onclick="location='/user/add/[% attr.name %]'">[% l('Add') %]</button>
                    [% END %]
                    [% IF attr.removable AND attr.editable %]
                        <button type="button" onclick="location='/user/delete/[% attr.name %]/[% val %]'">[% l('Delete') %]</button>
                    [% END %]
                [% END %]
            </td>
        </tr>
        [% END %]
        <tr>
            <td colspan="3" style="text-align:center;"><button type="Submit" value="[% l('Update') %]">[% l('Update') %]</button></td>
        </tr>
    </table>
</form>
</div>

<hr />
<div id="attribute_add_form">
<h3>[%('Add a attribute')%]</h3>
<form method="post" action="/user/add">
    <p>
        <select name="attribute">
        [% FOREACH attr IN may %]
            <option value="[% attr %]">[% attr %]</option>
        [% END %]
        </select>

        <input name="value" value="" />

        <button type="submit" value="[% l('Add') %]">[% l('Add') %]</button>
    </p>
</form>
</div>