load code depends and description
[MojoFacets.git] / templates / code / index.html.ep
1 % layout 'default';
2
3 <h1>Code snippets</h1>
4
5 % foreach my $column ( @{ session('columns') } ) {
6 %   next unless defined $snippets->{$column};
7 <h2><%= $column %></h2>
8 <ul>
9 %   foreach my $desc ( keys %{ $snippets->{$column} } ) {
10 <li>
11 <form method=post action=/data/items>
12 <input type=submit name=test value="Load and test">
13 % my $path = "code/$column.$desc.pl";
14 <a target=code href="/<%= $path %>"><%= $desc %></a>
15 <input name=code_depends value="<%= $column %>">
16 <input name=code_description value="<%= $desc %>">
17 <br>
18 % my $code = $snippets->{$column}->{$desc};
19 % my $rows = scalar split(/\n/,$code);
20 <textarea name=code cols=80 rows=<%= $rows %> style="overflow:hidden">
21 <%= $code %>
22 </textarea>
23 </form>
24
25 %   }
26 </ul>
27 % }
28
29 <tt class=debug><%= dumper stash('snippets') %></tt>