% layout 'default'; % title 'Imgbin -- 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->{imgbin}->{expire} || 'year' };

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

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

<%= file_field 'file', required => 1 %>
<% end %>
% my $size = sprintf "%.1f", config->{imgbin}->{maxsize} / 1024 ** 2; <%= tag td => config->{imgbin}->{maxres} %><%= tag td => $size %>
<%= l('Max') %> <%= l('resolution') %> :
<%= l('Max') %> <%= l('size (MB)') %> :
% if (my $error = flash 'error') {

<%= l(ucfirst($error)) %>

% }