Add delay information page

This commit is contained in:
Luc Didry 2015-10-03 23:54:08 +02:00
parent 2863f008fd
commit 41cb17e20b
16 changed files with 82 additions and 18 deletions

View File

@ -9,3 +9,4 @@ requires 'Switch';
requires 'Locale::Maketext';
requires 'Locale::Maketext::Extract';
requires 'Email::Valid';
requires 'Number::Bytes::Human';

View File

@ -504,6 +504,15 @@ DISTRIBUTIONS
Mojolicious 5
Test::More 0
perl 5.001001
Number-Bytes-Human-0.09
pathname: D/DA/DAGOBERT/Number-Bytes-Human-0.09.tar.gz
provides:
Number::Bytes::Human 0.09
requirements:
Carp 0
ExtUtils::MakeMaker 0
POSIX 0
Test::More 0
ORLite-1.98
pathname: A/AD/ADAMK/ORLite-1.98.tar.gz
provides:

View File

@ -167,6 +167,11 @@ sub startup {
to('Files#delete')->
name('delete');
# Get some informations about delays
$r->get('/delays' => sub {
shift->render(template => 'delays');
})->name('delays');
# Get mail page
$r->get('/m' => sub {
shift->render(template => 'mail');

View File

@ -52,6 +52,15 @@
# optional, default is 0 (no limit)
#max_delay => 0,
# size thresholds: if you want to define max delays for different sizes of file
# the keys are size in Bytes, you can't have 10*1000*10000 as key
# optional, default is using max_delay (see above) for all sizes
#delay_for_size => {
# 10000000 => 90, # between 10MB and 50MB => max is 90 days, less than 10MB => max is max_delay (see above)
# 50000000 => 60, # between 50MB ans 1GB => max is 60 days
# 1000000000 => 2, # more than 1GB => max is 2 days
#}
# URL sub-directory in which you want Lufi to be accessible
# example: you want to have Lufi under https://example.org/lufi/
# => set prefix to '/lufi' or to '/lufi/', it doesn't matter

View File

@ -2,4 +2,5 @@
.icon-download:before { content: '\e800'; } /* '' */
.icon-clipboard:before { content: '\e801'; } /* '' */
.icon-trash:before { content: '\e802'; } /* '' */
.icon-mail:before { content: '\e803'; } /* '' */
.icon-mail:before { content: '\e803'; } /* '' */
.icon-help-circled:before { content: '\e804'; } /* '' */

File diff suppressed because one or more lines are too long

View File

@ -2,4 +2,5 @@
.icon-download { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-clipboard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-help-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }

View File

@ -13,4 +13,5 @@
.icon-download { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-clipboard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-help-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?83820521');
src: url('../font/fontello.eot?83820521#iefix') format('embedded-opentype'),
url('../font/fontello.woff?83820521') format('woff'),
url('../font/fontello.ttf?83820521') format('truetype'),
url('../font/fontello.svg?83820521#fontello') format('svg');
src: url('../font/fontello.eot?37853598');
src: url('../font/fontello.eot?37853598#iefix') format('embedded-opentype'),
url('../font/fontello.woff?37853598') format('woff'),
url('../font/fontello.ttf?37853598') format('truetype'),
url('../font/fontello.svg?37853598#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
@ -14,7 +14,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?83820521#fontello') format('svg');
src: url('../font/fontello.svg?37853598#fontello') format('svg');
}
}
*/
@ -57,4 +57,5 @@
.icon-download:before { content: '\e800'; } /* '' */
.icon-clipboard:before { content: '\e801'; } /* '' */
.icon-trash:before { content: '\e802'; } /* '' */
.icon-mail:before { content: '\e803'; } /* '' */
.icon-mail:before { content: '\e803'; } /* '' */
.icon-help-circled:before { content: '\e804'; } /* '' */

Binary file not shown.

View File

@ -10,6 +10,7 @@
<glyph glyph-name="clipboard" unicode="&#xe801;" d="m0-150l0 904 225 0 0-64-161 0 0-774 579 0 0 774-161 0 0 64 225 0 0-904-707 0z m129 129l0 31 31 0 0-31-31 0z m0 121l0 31 31 0 0-31-31 0z m0 121l0 31 31 0 0-31-31 0z m0 121l0 32 31 0 0-32-31 0z m0 121l0 32 31 0 0-32-31 0z m0 96l0 94 129 0 0 97q0 41 27 71t69 29 69-30 28-70q0-56-2-97l129 0 0-94-449 0z m96-582l0 33 353 0 0-33-353 0z m0 121l0 33 353 0 0-33-353 0z m0 121l0 33 353 0 0-33-353 0z m0 121l0 34 353 0 0-34-353 0z m0 121l0 34 353 0 0-34-353 0z m97 260q0-14 9-22t23-9 22 9 9 22-9 24-22 9-23-9-9-24z" horiz-adv-x="707" />
<glyph glyph-name="trash" unicode="&#xe802;" d="m0 569l0 68q2 37 29 63t65 25l94 0 0 31q0 39 27 67t66 27l313 0q39 0 66-27t28-67l0-31 93 0q37 0 65-25t29-63l0-68q0-26-19-44t-44-19l0-531q0-53-36-89t-88-36l-500 0q-53 0-89 36t-36 89l0 531q-26 0-44 19t-19 44z m63 0l749 0 0 62q0 14-8 23t-23 8l-687 0q-14 0-23-8t-8-23l0-62z m62-594q0-25 19-44t44-19l500 0q25 0 43 19t19 44l0 531-625 0 0-531z m63 31l0 407q0 13 8 22t23 9l62 0q14 0 23-9t9-22l0-407q0-13-9-22t-23-9l-62 0q-14 0-23 9t-8 22z m31 0l62 0 0 407-62 0 0-407z m31 719l375 0 0 31q0 14-9 23t-22 8l-313 0q-13 0-22-8t-9-23l0-31z m125-719l0 407q0 13 9 22t22 9l63 0q13 0 22-9t9-22l0-407q0-13-9-22t-22-9l-63 0q-13 0-22 9t-9 22z m31 0l63 0 0 407-63 0 0-407z m157 0l0 407q0 13 8 22t23 9l62 0q14 0 23-9t9-22l0-407q0-13-9-22t-23-9l-62 0q-14 0-23 9t-8 22z m31 0l62 0 0 407-62 0 0-407z" horiz-adv-x="875" />
<glyph glyph-name="mail" unicode="&#xe803;" d="m0 28v644q0 8 2 18l460-460q39-39 95-39 55 0 94 39l460 460q2-9 2-18v-644q0-37-26-62t-62-26h-937q-36 0-62 26t-26 62z m63 728q13 4 25 4h937q12 0 25-4l-463-463q-13-12-31-12t-30 12z" horiz-adv-x="1113.3" />
<glyph glyph-name="help-circled" unicode="&#xe804;" d="m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
</font>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Binary file not shown.

View File

@ -6,6 +6,12 @@
"units_per_em": 1000,
"ascent": 850,
"glyphs": [
{
"uid": "17ebadd1e3f274ff0205601eef7b9cc4",
"css": "help-circled",
"code": 59396,
"src": "fontawesome"
},
{
"uid": "9a76bc135eac17d2c8b8ad4a5774fc87",
"css": "download",

25
templates/delays.html.ep Normal file
View File

@ -0,0 +1,25 @@
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
% use Number::Bytes::Human qw(format_bytes);
<div class="inner cover render">
<h1><%= l('Information about delays') %></h1>
<div class="text-left">
<p><%= l('If you choose a delay, the file will be deleted after that delay.') %><br>
<%= l('Don\'t worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file.') %>
% if (defined(config('delay_for_size'))) {
<p><%= l('This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:') %></p>
<ul>
% my $delays = config('delay_for_size');
% $delays->{0} = 1;
% my @keys = sort keys %{$delays};
% my $i = 0;
% for my $key (@keys) {
% if ($i + 1 < scalar(@keys)) {
<li><%= l('between %1 and %2, the file will be kept %3 day(s)', format_bytes($keys[$i++]), format_bytes($keys[$i]), $delays->{$keys[$i]}) %></li>
% } else {
<li><%= l('for %1 and more, the file will be kept %2 day(s)', format_bytes($keys[$i]), $delays->{$keys[$i]}) %></li>
% }
% }
</ul>
</div>
% }
</div>

View File

@ -13,7 +13,10 @@
</div>
</div>
% }
<div class="col-sm-6 col-xs-12">
<div class="col-sm-1 col-xs-12">
<a href="<%= url_for('/delays') %>" title="<%= l('Important: more information on delays') %>"><span class="lead icon icon-help-circled"></span></a>
</div>
<div class="col-sm-5 col-xs-12">
<select id="delete-day" class="form-control">
% for my $delay (qw/0 1 7 30 365/) {
% my $text = ($delay == 7 || $delay == 30) ? l('%1 days', $delay) : $d{'delay_'.$delay};