diff --git a/templates/imgbin/create.html.ep b/templates/imgbin/create.html.ep new file mode 100644 index 0000000..eef1443 --- /dev/null +++ b/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); +

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

+
+ <%= 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 %> + +
+
+
+ <%= file_field 'file', required => 1 %> +
+ <% end %> +
+% if (my $error = flash 'error') { +
+

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

+
+% } diff --git a/templates/imgbin/view.html.ep b/templates/imgbin/view.html.ep new file mode 100644 index 0000000..c343335 --- /dev/null +++ b/templates/imgbin/view.html.ep @@ -0,0 +1,24 @@ +% layout 'default'; +% title 'Imgbin -- View'; +% stash 'styles' => 'zerobin'; +

<%= l('View image') %>

+
+
+ + <%= link_to l('Upload more') => "/imgbin" %> + +
+
+
+ % my $image = (stash 'image') || {}; + % my $style = sprintf "max-width: %dpx;", $config->{imgbin}->{css_maxwidth}; + %= image $image->{path}, style => $style; +
+
+ +% foreach my $key (qw(width height size name comment)) { +% next unless $image->{$key}; + <%= tag td => l(ucfirst($key)) %><%= tag td => $image->{$key} %> +% } +
:
+