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 |
|
|
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 |
|
|
53 |
|
|
54 |
</div> |
</div> |
55 |
|
|
56 |
</&> |
Add new: |
57 |
|
<% admin_link( 'source', 'Source', 0 ) %> |
58 |
|
<% admin_link( 'destination', 'Destination', 0 ) %> |
59 |
|
|