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