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

Diff of /trunk/web/templates/systems/landscapes

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/web/templates/landscapes revision 72 by dpavlin, Mon Jun 12 03:44:50 2006 UTC trunk/web/templates/systems/landscapes revision 73 by dpavlin, Mon Jun 12 09:37:51 2006 UTC
# Line 3  my $landscapes = Transports::Model::Land Line 3  my $landscapes = Transports::Model::Land
3  $landscapes->unlimit;  $landscapes->unlimit;
4    
5  sub admin_link {  sub admin_link {
6          my $label = shift;          my ($label, $type, $id) = @_;
         my $url = join('', @_);  
7          if (Jifty->web->current_user->admin) {          if (Jifty->web->current_user->admin) {
8                  return Jifty->web->link( label => $label, url => $url );                  return Jifty->web->link(
9                            label => $label,
10                            onclick => {
11                                    replace_with => '/systems/edit',
12                                    args => {
13                                            type => $type,
14                                            id => $id,
15                                    },
16                            },
17                    );
18          } else {          } else {
19                  return $label;                  return $label;
20          }          }
21  }  }
22    
23  </%init>  </%init>
 <&|/_elements/wrapper&>  
24    
25  <div class="outer-landscapes">  <div class="outer-landscapes">
26    
# Line 27  sub admin_link { Line 34  sub admin_link {
34  Source systems:  Source systems:
35  <ul>  <ul>
36  % foreach my $s ( sort { $a->name cmp $b->name } @{$l->sources->items_array_ref} ) {  % foreach my $s ( sort { $a->name cmp $b->name } @{$l->sources->items_array_ref} ) {
37    <li><% admin_link( $s->name, '/source/' . $s->id ) %></li>    <li><% admin_link( $s->name, 'Source', $s->id ) %></li>
38  % }  % }
39  </ul>  </ul>
40    
41  Destination systems:  Destination systems:
42  <ul>  <ul>
43  % foreach my $d ( sort { $a->name cmp $b->name } @{$l->destinations->items_array_ref} ) {  % foreach my $d ( sort { $a->name cmp $b->name } @{$l->destinations->items_array_ref} ) {
44    <li><% admin_link( $d->name, '/destination/' . $d->id ) %></li>    <li><% admin_link( $d->name, 'Destination', $d->id ) %></li>
45  % }  % }
46  </ul>  </ul>
47    
# Line 46  Destination systems: Line 53  Destination systems:
53    
54  </div>  </div>
55    
56  </&>  Add new:
57    <% admin_link( 'source', 'Source', 0 ) %>
58    <% admin_link( 'destination', 'Destination', 0 ) %>
59    

Legend:
Removed from v.72  
changed lines
  Added in v.73

  ViewVC Help
Powered by ViewVC 1.1.26