diff --git a/lib/LDV.pm b/lib/LDV.pm index d0b84bd..512a306 100644 --- a/lib/LDV.pm +++ b/lib/LDV.pm @@ -55,14 +55,16 @@ sub startup { } { # /imgbin + my $conf = $self->app->config->{imgbin}; my $ib = $r->route('/imgbin') -> to(controller => 'imgbin'); $ib->post('/') -> to(action => 'save'); $ib->get ('/') -> to(action => 'create'); $ib->route('/:time', time => qr/\d+/) ->via('GET') -> to(action => 'view'); #$ib->get('/prune') -> to(action => 'prune'); + $ib->get ('/latest') -> to(action => 'latest') + if ($conf->{show_latest}); - my $conf = $self->app->config->{imgbin}; mkdir $self->app->home->rel_dir($conf->{root}); mkdir $self->app->home->rel_file('public/images'); mkdir $self->app->home->rel_file('public/images/full'); diff --git a/public/css/zerobin.css b/public/css/zerobin.css index 9c3dbbd..8035b05 100644 --- a/public/css/zerobin.css +++ b/public/css/zerobin.css @@ -19,3 +19,10 @@ textarea#paste { pre code { background-color: #777777; } + +/* imgbin */ +div.img-preview { + margin: 5px; + display: inline-block; + vertical-align: top; +} diff --git a/templates/imgbin/create.html.ep b/templates/imgbin/create.html.ep index 39c7e87..4de34db 100644 --- a/templates/imgbin/create.html.ep +++ b/templates/imgbin/create.html.ep @@ -15,6 +15,11 @@ <%= tag 'label' => (for => 'expire') => l('Keep for') %>: <%= select_field 'expire' => \@times %> +% if (config->{imgbin}->{show_latest}) { + + <%= link_to l('Latest images') => "/imgbin/latest" %> + +% }