Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

content default helper builds a *static* bit compiled template

and only the first time you call it.  So, we want a block.
  • Loading branch information...
commit 796238457efd75f12e0cd3226560cf4167ea9d1b 1 parent 4bb98ae
Andrew Fresh authored

Showing 1 changed file with 7 additions and 6 deletions. Show diff stats Hide diff stats

  1. +7 6 OpenBSDtracker
13 OpenBSDtracker
@@ -139,15 +139,16 @@ $(document).ready(function() {
139 139 % my ($info) = @_;
140 140 % my $total_size = 0;
141 141 % if ($info->{files}) {
142   -% content file_list => begin
  142 +% my $file_list = begin
  143 +% my $files = shift;
143 144 <ul>
144   -% foreach my $file ( @{ $info->{files} }) {
  145 +% foreach my $file ( @{ $files }) {
145 146 % $total_size += $file->{length};
146   -%= $detail_line->( human_number($file->{length}), join('/', @{ $file->{path} }));
  147 +%= $detail_line->( join('/', @{ $file->{path} } ), human_number($file->{length}) );
147 148 % }
148 149 </ul>
149 150 % end
150   -%= $detail_line->('Files', content('file_list') );
  151 +%= $detail_line->('Files', $file_list->($info->{files}) );
151 152 % } else {
152 153 % $total_size = $info->{length};
153 154 % }
@@ -157,7 +158,7 @@ $(document).ready(function() {
157 158 % my ($list) = @_;
158 159 % if ($list) {
159 160 % $list = [$list] unless ref $list eq 'ARRAY';
160   -% content url_list => begin
  161 +% my $web_seeds = begin
161 162 % if (@{ $list } == 1) {
162 163 %= link_to $list->[0] => $list->[0];
163 164 % } else {
@@ -168,7 +169,7 @@ $(document).ready(function() {
168 169 </ul>
169 170 % }
170 171 % end
171   -%= $detail_line->('Web Seeds', content('url_list'));
  172 +%= $detail_line->('Web Seeds', $web_seeds->($list));
172 173 % }
173 174 % end
174 175 <ul>

0 comments on commit 7962384

Please sign in to comment.
Something went wrong with that request. Please try again.