Browse Source

+ templates/imgbin/*

master
Alex 'AdUser' Z 9 years ago
parent
commit
6f3c47fb0a
  1. 28
      templates/imgbin/create.html.ep
  2. 24
      templates/imgbin/view.html.ep

28
templates/imgbin/create.html.ep

@ -0,0 +1,28 @@
% layout 'default';
% title 'Imgbin -- Create';
% stash 'styles' => 'zerobin';
% my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395);
% my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times);
<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>
</div>
<hr/>
<div>
<%= file_field 'file', required => 1 %>
</div>
<% end %>
</div>
% if (my $error = flash 'error') {
<div>
<p style="color: red; font-size: 14pt;"><%= l(ucfirst($error)) %></p>
</div>
% }

24
templates/imgbin/view.html.ep

@ -0,0 +1,24 @@
% layout 'default';
% title 'Imgbin -- View';
% stash 'styles' => 'zerobin';
<h1><%= l('View image') %></h1>
<div>
<div>
<span class="zerobin cblock">
<%= link_to l('Upload more') => "/imgbin" %>
</span>
</div>
<br/>
<div>
% my $image = (stash 'image') || {};
% my $style = sprintf "max-width: %dpx;", $config->{imgbin}->{css_maxwidth};
%= image $image->{path}, style => $style;
</div>
<hr/>
<table>
% foreach my $key (qw(width height size name comment)) {
% next unless $image->{$key};
<tr><%= tag td => l(ucfirst($key)) %><td> : </td><%= tag td => $image->{$key} %></tr>
% }
</table>
</div>
Loading…
Cancel
Save