/[transports]/trunk/web/templates/users/form
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/web/templates/users/form

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93 - (show annotations)
Fri Jun 23 12:37:55 2006 UTC (17 years, 10 months ago) by dpavlin
File size: 1432 byte(s)
replace submit button with link to make ajax work, hide parts of form which are not for
normal users from them, added link to list of all users
1 <%args>
2 $user_id => 0
3 </%args>
4 <%init>
5 my $u = Transports::Model::User->new();
6 $u->load_by_cols( id => $user_id );
7 my $user = Jifty->web->new_action(
8 class => $u->id ? 'UpdateUser' : 'CreateUser',
9 record => $u,
10 moniker => 'edit_user',
11 );
12 </%init>
13
14 <div class="boxed boxed-yellow">
15
16 <% $user_id ? 'Change user' : 'Add new user' %>
17
18 <% Jifty->web->form->start %>
19 <% Jifty->web->form->next_page( url => $user_id ? '/users' : '/transports' ) %>
20 <% $user->form_field('name') %>
21 <% $user->form_field('email') %>
22 <% $user->form_field('password') %>
23 <% $user->form_field('password_confirm', label => 'Re-enter password' ) %>
24 % if (Jifty->web->current_user->admin) {
25 <% $user->form_field('admin') %>
26 <% $user->form_field('can_import') %>
27 % }
28
29 <input type="hidden" name="user_id" value="<% $user_id %>"/>
30 <div class="submit_button">
31 <% Jifty->web->link(
32 label => $user_id ? 'Update user' : 'Add user',
33 onclick => [
34 { submit => $user },
35 { replace_with => '/users/form',
36 args => { foo => 42 }
37 }
38 ]
39 ) %>
40 </div>
41 <% Jifty->web->form->end %>
42
43 % if ($user_id && Jifty->web->current_user->admin) {
44 <% Jifty->web->region(
45 name => "user-landscape",
46 path => "/users/landscape",
47 defaults => {
48 user_id => $user_id,
49 },
50 ) %>
51 % }
52
53 </div>
54
55
56 <div class="cl">
57 Back to <% Jifty->web->link(
58 label => 'list of all users',
59 onclick => {
60 replace_with => '/users/all',
61 }
62 ) %>
63 </div>

  ViewVC Help
Powered by ViewVC 1.1.26