mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-03-28 17:42:54 +01:00
Fix #18
This commit is contained in:
@@ -56,7 +56,8 @@ vi lutim.conf
|
||||
* stats\_day\_num: when you generate statistics with `script/lutim cron stats`, you will have stats for the last `stats_day_num` days (default is 365) ;
|
||||
* keep\_ip\_during: when you delete IP addresses of image's senders with `script/lutim cron cleanbdd`, the IP addresses of images older than `keep_ip_during` days will be deleted (default is 365) ;
|
||||
* broadcast\_message: put some string (not HTML) here and this message will be displayed on all LUTIm pages (not in JSON responses) ;
|
||||
* allowed\_domains: array of authorized domains for API calls. Example: `['http://1.example.com', 'http://2.example.com']`. If you want to authorize everyone to use the API: `['*']`.
|
||||
* allowed\_domains: array of authorized domains for API calls. Example: `['http://1.example.com', 'http://2.example.com']`. If you want to authorize everyone to use the API: `['*']` ;
|
||||
* default\_delay: what is the default time limit for files? Valid values are 0, 1, 7, 30 and 365.
|
||||
|
||||
##Usage
|
||||
```
|
||||
|
||||
11
lib/Lutim.pm
11
lib/Lutim.pm
@@ -126,6 +126,17 @@ sub startup {
|
||||
}
|
||||
);
|
||||
|
||||
$self->helper(
|
||||
is_selected => sub {
|
||||
my $c = shift;
|
||||
my $num = shift;
|
||||
|
||||
$c->config->{default_delay} = 0 unless (defined($c->config->{default_delay}));
|
||||
|
||||
return ($num == $c->config->{default_delay}) ? 'selected="selected"' : '';
|
||||
}
|
||||
);
|
||||
|
||||
$self->hook(
|
||||
before_dispatch => sub {
|
||||
my $c = shift;
|
||||
|
||||
@@ -59,6 +59,11 @@ our %Lexicon = (
|
||||
'no_valid_url' => 'The URL is not valid.',
|
||||
'image_url' => 'Image URL',
|
||||
'upload_image_url' => 'Upload an image with its URL',
|
||||
'delay_0' => 'no time limit',
|
||||
'delay_1' => '24 hours',
|
||||
'delay_7' => '7 days',
|
||||
'delay_30' => '30 days',
|
||||
'delay_365' => '1 year',
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
@@ -59,6 +59,11 @@ our %Lexicon = (
|
||||
'no_valid_url' => 'l\'URL n\'est pas valide.',
|
||||
'image_url' => 'URL de l\'image',
|
||||
'upload_image_url' => 'Déposer une image par son URL',
|
||||
'delay_0' => 'pas de limitation de durée',
|
||||
'delay_1' => '24 heures',
|
||||
'delay_7' => '7 jours',
|
||||
'delay_30' => '30 jours',
|
||||
'delay_365' => '1 an',
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
@@ -22,4 +22,5 @@
|
||||
#policy_when_full => 'warn', # optional, policy when files directory is over max_total_size. Valid values are 'warn', 'stop-upload' and 'delete'. See README.
|
||||
#broadcast_message => 'Maintenance', #optional, the broadcast_message is displayed on all pages of LUTIm (but no in json response)
|
||||
#allowed_domains => ['http://1.example.com', 'http://2.example.com'], #optional, array of authorized domains for API calls. If you want to authorize everyone to use the API: ['*']
|
||||
#default_delay => 0, #optional: what is the default time limit for files? Valid values are 0, 1, 7, 30 and 365.
|
||||
};
|
||||
|
||||
@@ -24,17 +24,11 @@
|
||||
<noscript>
|
||||
<form class="form" role="form" method="POST" action="<%== url_for('add') %>" enctype="multipart/form-data">
|
||||
<div class="form-group form-inline">
|
||||
<span>
|
||||
<label>
|
||||
<select name="delete-day">
|
||||
<option value=0 selected="selected">pas de limitation de durée</option>
|
||||
<option value=1>24 heures</option>
|
||||
<option value=7>7 jours</option>
|
||||
<option value=30>30 jours</option>
|
||||
<option value=365>1 an</option>
|
||||
</select>
|
||||
</label>
|
||||
</span>
|
||||
<select name="delete-day" class="form-control">
|
||||
% for my $delay (qw/0 1 7 30 365/) {
|
||||
<option value="<%= $delay %>" <%== is_selected($delay) %>><%=l "delay_$delay" %></option>
|
||||
% }
|
||||
</select>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="first-view"> <%=l 'delete-first' %>
|
||||
@@ -57,17 +51,11 @@
|
||||
<!-- D&D Zone-->
|
||||
<div class="jsonly">
|
||||
<div class="form-group form-inline">
|
||||
<span>
|
||||
<label>
|
||||
<select id="delete-day">
|
||||
<option value=0 selected="selected">pas de limitation de durée</option>
|
||||
<option value=1>24 heures</option>
|
||||
<option value=7>7 jours</option>
|
||||
<option value=30>30 jours</option>
|
||||
<option value=365>1 an</option>
|
||||
</select>
|
||||
</label>
|
||||
</span>
|
||||
<select id="delete-day" class="form-control">
|
||||
% for my $delay (qw/0 1 7 30 365/) {
|
||||
<option value="<%= $delay %>" <%== is_selected($delay) %>><%=l "delay_$delay" %></option>
|
||||
% }
|
||||
</select>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="first-view"> <%=l 'delete-first' %>
|
||||
|
||||
Reference in New Issue
Block a user