From 41abd109b652a5477244e47153e1e8d1aeffdd76 Mon Sep 17 00:00:00 2001 From: brunob Date: Thu, 18 Jan 2018 16:40:23 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20#63=20:=20ajout=20d'une=20option=20de=20c?= =?UTF-8?q?onf=20pour=20personnaliser=20les=20d=C3=A9lais=20propos=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pas certain que les modifications dans lib/ soient nécessaires, dans le doute, je les envoie. --- lib/Lutim.pm | 1 + lib/Mounter.pm | 1 + lutim.conf.template | 4 ++++ themes/default/templates/partial/for_my_delay.html.ep | 3 ++- themes/default/templates/partial/lutim.js.ep | 3 ++- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Lutim.pm b/lib/Lutim.pm index f1fec4e..062c916 100644 --- a/lib/Lutim.pm +++ b/lib/Lutim.pm @@ -35,6 +35,7 @@ sub startup { tweet_card_via => '@framasky', max_file_size => 10*1024*1024, https => 0, + proposed_delays => '0,1,7,30,365', default_delay => 0, max_delay => 0, token_length => 24, diff --git a/lib/Mounter.pm b/lib/Mounter.pm index 0141930..9a2215f 100644 --- a/lib/Mounter.pm +++ b/lib/Mounter.pm @@ -30,6 +30,7 @@ sub startup { tweet_card_via => '@framasky', max_file_size => 10*1024*1024, https => 0, + proposed_delays => '0,1,7,30,365', default_delay => 0, max_delay => 0, token_length => 24, diff --git a/lutim.conf.template b/lutim.conf.template index be72e9b..19bd605 100644 --- a/lutim.conf.template +++ b/lutim.conf.template @@ -89,6 +89,10 @@ # optional, default is 0 (no limit) #default_delay => 0, + # values proposed for delays + # optional, default is '0,1,7,30,365' + #proposed_delays => '0,1,7,30,365', + # number of days after which the images will be deleted, even if they were uploaded with "no delay" (or value superior to max_delay) # a warning message will be displayed on homepage # optional, default is 0 (no limit) diff --git a/themes/default/templates/partial/for_my_delay.html.ep b/themes/default/templates/partial/for_my_delay.html.ep index dc166c4..c3b5f0a 100644 --- a/themes/default/templates/partial/for_my_delay.html.ep +++ b/themes/default/templates/partial/for_my_delay.html.ep @@ -1,5 +1,6 @@ % # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab: -% for my $delay (qw/0 1 7 30 365/) { +% my @delays = split(',', $self->config('proposed_delays')); +% for my $delay (@delays) { % my $text = ($delay == 7 || $delay == 30) ? l('%1 days', $delay) : $d->{'delay_'.$delay}; % if (config('max_delay')) { % if ($delay) { diff --git a/themes/default/templates/partial/lutim.js.ep b/themes/default/templates/partial/lutim.js.ep index 4cb6825..9d6427c 100644 --- a/themes/default/templates/partial/lutim.js.ep +++ b/themes/default/templates/partial/lutim.js.ep @@ -134,7 +134,8 @@ function buildMessage(success, msg) { '
', '
', '