|
|
|
% 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' };
|
|
|
|
<h1>Загрузить файл</h1>
|
|
|
|
<div>
|
|
|
|
<%= form_for "/filebin" => (method => 'POST', enctype => 'multipart/form-data') => begin %>
|
|
|
|
<div>
|
|
|
|
<span class="filebin cblock">
|
|
|
|
<%= submit_button l('Upload') %>
|
|
|
|
</span>
|
|
|
|
<span class="filebin cblock">
|
|
|
|
<%= tag 'label' => (for => 'expire') => l('Keep for') %>:
|
|
|
|
<%= select_field 'expire' => \@times %>
|
|
|
|
</span>
|
|
|
|
<span class="filebin cblock">
|
|
|
|
<%= check_box hidden => 1 %>
|
|
|
|
<%= tag 'label' => (for => 'hidden') => l('Hidden') %>
|
|
|
|
</span>
|
|
|
|
% if (config->{filebin}->{show_latest}) {
|
|
|
|
<%= link_to l('Latest files') => "/filebin/latest", class => 'btn latest' %>
|
|
|
|
% }
|
|
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<div>
|
|
|
|
<%= file_field 'file', required => 1 %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<br/>
|
|
|
|
% my $size = sprintf "%.1f Mb", config->{filebin}->{file_maxsize} / 1024 ** 2;
|
|
|
|
<table class="filebin limits">
|
|
|
|
<tr><td><%= l('Max filesize') %></td><td> : </td><%= tag td => $size %></tr>
|
|
|
|
<tr><td><%= l('Max image') %></td><td> : </td><%= tag td => config->{filebin}->{image_maxres} %></tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
% if (my $error = flash('error')) {
|
|
|
|
<%= tag span => (class => 'filebin error') => l(ucfirst($error)) %>
|
|
|
|
% }
|