From c7b6b1e35d3f8c86c49415d5fd8e22c78a2bda16 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Mon, 11 May 2015 01:01:16 +1000 Subject: [PATCH] * default expire settings for imgbin --- conf/ldv.conf.sample | 1 + templates/imgbin/create.html.ep | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/ldv.conf.sample b/conf/ldv.conf.sample index 5e01375..5aa5c86 100644 --- a/conf/ldv.conf.sample +++ b/conf/ldv.conf.sample @@ -28,6 +28,7 @@ imgbin => { root => 'data/imgbin', + expire => 'year', maxres => '8192x8192', maxsize => 32 * 1024 * 1024, thumbs_ext => 'jpg', diff --git a/templates/imgbin/create.html.ep b/templates/imgbin/create.html.ep index eef1443..55c4701 100644 --- a/templates/imgbin/create.html.ep +++ b/templates/imgbin/create.html.ep @@ -1,8 +1,9 @@ % layout 'default'; % title 'Imgbin -- Create'; % stash 'styles' => 'zerobin'; -% my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395); +% 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' };

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

<%= form_for "/imgbin" => (method => 'POST', enctype => 'multipart/form-data') => begin %>