% layout 'default'; % title 'Filebin -- Create'; % my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 365); % my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times); % param expire => $times{ config->{filebin}->{expire} || 'year' };

Загрузить файл

<%= form_for "/filebin" => (method => 'POST', enctype => 'multipart/form-data') => begin %>
<%= submit_button l('Upload') %> <%= tag 'label' => (for => 'expire') => l('Keep for') %>: <%= select_field 'expire' => \@times %> <%= check_box hidden => 1 %> <%= tag 'label' => (for => 'hidden') => l('Hidden') %> % if (config->{filebin}->{show_latest}) { <%= link_to l('Latest files') => "/filebin/latest", class => 'btn latest' %> % }

<%= file_field 'file', required => 1 %>
<% end %>
% my $size = sprintf "%.1f Mb", config->{filebin}->{file_maxsize} / 1024 ** 2; <%= tag td => $size %><%= tag td => config->{filebin}->{image_maxres} %>
<%= l('Max filesize') %> :
<%= l('Max image') %> :
% if (my $error = flash('error')) { <%= tag span => (class => 'filebin error') => l(ucfirst($error)) %> % }