/[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

Contents of /trunk/web/templates/systems/landscapes

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73 - (show annotations)
Mon Jun 12 09:37:51 2006 UTC (17 years, 11 months ago) by dpavlin
File size: 1043 byte(s)
added edit interface for systems
1 <%init>
2 my $landscapes = Transports::Model::LandscapeCollection->new();
3 $landscapes->unlimit;
4
5 sub admin_link {
6 my ($label, $type, $id) = @_;
7 if (Jifty->web->current_user->admin) {
8 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 {
19 return $label;
20 }
21 }
22
23 </%init>
24
25 <div class="outer-landscapes">
26
27 % while (my $l = $landscapes->next) {
28 <div class="float-left boxed">
29
30 <b><% $l->name %></b>
31
32 <br/><small>
33
34 Source systems:
35 <ul>
36 % foreach my $s ( sort { $a->name cmp $b->name } @{$l->sources->items_array_ref} ) {
37 <li><% admin_link( $s->name, 'Source', $s->id ) %></li>
38 % }
39 </ul>
40
41 Destination systems:
42 <ul>
43 % foreach my $d ( sort { $a->name cmp $b->name } @{$l->destinations->items_array_ref} ) {
44 <li><% admin_link( $d->name, 'Destination', $d->id ) %></li>
45 % }
46 </ul>
47
48 </small>
49
50 </div>
51
52 % } # while
53
54 </div>
55
56 Add new:
57 <% admin_link( 'source', 'Source', 0 ) %>
58 <% admin_link( 'destination', 'Destination', 0 ) %>
59

  ViewVC Help
Powered by ViewVC 1.1.26