You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.4 KiB

% 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' };
<h1>Загрузить файл</h1>
<div>
<%= form_for "/imgbin" => (method => 'POST', enctype => 'multipart/form-data') => begin %>
<div>
<span class="zerobin cblock">
<%= submit_button l('Upload') %>
</span>
<span class="zerobin cblock">
<%= tag 'label' => (for => 'expire') => l('Keep for') %>:
<%= select_field 'expire' => \@times %>
</span>
% if (config->{imgbin}->{show_latest}) {
<%= link_to l('Latest images') => "/imgbin/latest", class => 'zerobin latest' %>
% }
</div>
<hr/>
<div>
<%= file_field 'file', required => 1 %>
</div>
<% end %>
<br/>
% my $size = sprintf "%.1f", config->{imgbin}->{maxsize} / 1024 ** 2;
<span style="color: lightgray;">
<table>
<tr><td><%= l('Max') %> <%= l('resolution') %></td><td> : </td><%= tag td => config->{imgbin}->{maxres} %></tr>
<tr><td><%= l('Max') %> <%= l('size (MB)') %></td><td> : </td><%= tag td => $size %></tr>
</table>
</span>
</div>
% if (my $error = flash 'error') {
<div>
<p style="color: red; font-size: 14pt;"><%= l(ucfirst($error)) %></p>
</div>
% }