% foreach my $item (@stack) {
% if ( $item->{depth} > $depth ) {
% } elsif ( $item->{depth} < $depth ) {
% for ($item->{depth}+1 .. $depth) {
% }
% } elsif ( $item->{depth} == $depth ) {
% }
<% $item->{'name'} %> - <% $item->{'render_time'} %>
% unless ($item->{subcomponent}) {
<% Jifty->web->tangent( url =>"/__jifty/edit/mason_component/".$item->{'path'}, label => _('Edit')) %>
% }
% $depth = $item->{'depth'};
% }
% for (1 .. $depth) {
% }
% foreach my $item (@stack) {
<& .frame, frame => $item &>
% }
<%args>
@stack
%args>
<%init>
for my $id (0..$#stack) {
my @kids;
my $looking = $id;
while (++$looking <= $#stack and $stack[$looking]->{depth} >= $stack[$id]->{depth} + 1) {
push @kids, {id => $stack[$looking]{id}, path => $stack[$looking]{path}, render_time => $stack[$looking]{render_time}}
if $stack[$looking]->{depth} == $stack[$id]->{depth} + 1;
}
$stack[$id]{kids} = \@kids;
if ($stack[$id]{depth} > 1) {
$looking = $id;
$looking-- while ($stack[$looking]{depth} >= $stack[$id]{depth});
$stack[$id]{parent} = {id => $stack[$looking]{id}, path => $stack[$looking]{path}, render_time => $stack[$looking]{render_time}};
}
}
my $depth = 0;
%init>
<%def .frame>
<%args>
$frame
%args>
<%init>
my $id = $frame->{id};
my @args;
while (my ($key, $value) = splice(@{$frame->{args}},0,2)) {
push @args, [$key, ref($value), $value];
}
@args = sort {$a->[0] cmp $b->[0]} @args;
my $prev = '';
my @stmts = @{$frame->{'sql_statements'} || []};
%init>
%def>