Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fiat Tux
Hat softwares
Lutim
Commits
163a1e2a
Commit
163a1e2a
authored
Apr 07, 2018
by
Luc Didry
Browse files
Disable images' counter option
parent
f26e7ba5
Pipeline
#46593
passed with stages
in 10 minutes and 10 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
163a1e2a
...
...
@@ -5,6 +5,7 @@ Revision history for Lutim
- Move some tasks to recurring instead of being in after_dispatch hook
- Built-in image cache system \o/
- Disable logs option
- Disable images' counter option
0.9.6 2018-03-12
- Update translations
...
...
lib/Lutim.pm
View file @
163a1e2a
...
...
@@ -55,6 +55,7 @@ sub startup {
},
cache_max_size
=>
0
,
quiet_logs
=>
0
,
disable_img_stats
=>
0
,
}
});
...
...
lib/Lutim/Controller.pm
View file @
163a1e2a
...
...
@@ -629,10 +629,12 @@ sub short {
$c
->
app
->
log
->
info
('
[VIEW] someone viewed
'
.
$image
->
filename
.
'
(path:
'
.
$image
->
path
.
'
)
')
unless
$c
->
config
('
quiet_logs
');
# Update record
if
(
$c
->
config
('
minion
')
->
{
enabled
})
{
$c
->
app
->
minion
->
enqueue
(
accessed
=>
[
$image
->
short
,
time
]);
}
else
{
$image
->
accessed
(
time
);
unless
(
$c
->
config
('
disable_img_stats
'))
{
if
(
$c
->
config
('
minion
')
->
{
enabled
})
{
$c
->
app
->
minion
->
enqueue
(
accessed
=>
[
$image
->
short
,
time
]);
}
else
{
$image
->
accessed
(
time
);
}
}
# Delete image if needed
...
...
@@ -731,10 +733,12 @@ sub zip {
$c
->
app
->
log
->
info
('
[VIEW] someone viewed
'
.
$image
->
filename
.
'
(path:
'
.
$image
->
path
.
'
)
')
unless
$c
->
config
('
quiet_logs
');
# Update counter and record
if
(
$c
->
config
('
minion
')
->
{
enabled
})
{
$c
->
app
->
minion
->
enqueue
(
accessed
=>
[
$image
->
short
,
time
]);
}
else
{
$image
->
accessed
(
time
);
unless
(
$c
->
config
('
disable_img_stats
'))
{
if
(
$c
->
config
('
minion
')
->
{
enabled
})
{
$c
->
app
->
minion
->
enqueue
(
accessed
=>
[
$image
->
short
,
time
]);
}
else
{
$image
->
accessed
(
time
);
}
}
}
}
elsif
(
$image
->
path
&&
!
$image
->
enabled
)
{
...
...
lib/Mounter.pm
View file @
163a1e2a
...
...
@@ -48,6 +48,7 @@ sub startup {
},
cache_max_size
=>
0
,
quiet_logs
=>
0
,
disable_img_stats
=>
0
,
}
}
);
...
...
lutim.conf.template
View file @
163a1e2a
...
...
@@ -159,6 +159,11 @@
# }
#},
# disable counters of images
# set to 1 to disable counters
# optional, counters are enabled by default
#disable_img_stats => 0,
# define the height of the thumbnails generated at users' will
# this is not the height of the thumbnails send after upload,
# we're talking about thumbnails generated when someone asked for
...
...
themes/default/lib/Lutim/I18N/lutim.pot
View file @
163a1e2a
...
...
@@ -32,11 +32,11 @@ msgstr ""
msgid "-or-"
msgstr ""
#: lib/Lutim.pm:
199
lib/Lutim/Command/cron/stats.pm:151 lib/Lutim/Command/cron/stats.pm:162 lib/Lutim/Command/cron/stats.pm:179 themes/default/templates/index.html.ep:5 themes/default/templates/raw.html.ep:10 themes/default/templates/raw.html.ep:21 themes/default/templates/raw.html.ep:38
#: lib/Lutim.pm:
201
lib/Lutim/Command/cron/stats.pm:151 lib/Lutim/Command/cron/stats.pm:162 lib/Lutim/Command/cron/stats.pm:179 themes/default/templates/index.html.ep:5 themes/default/templates/raw.html.ep:10 themes/default/templates/raw.html.ep:21 themes/default/templates/raw.html.ep:38
msgid "1 year"
msgstr ""
#: lib/Lutim.pm:
198
lib/Lutim/Command/cron/stats.pm:148 lib/Lutim/Command/cron/stats.pm:159 lib/Lutim/Command/cron/stats.pm:176 themes/default/templates/index.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:151 themes/default/templates/raw.html.ep:18 themes/default/templates/raw.html.ep:35 themes/default/templates/raw.html.ep:7
#: lib/Lutim.pm:
200
lib/Lutim/Command/cron/stats.pm:148 lib/Lutim/Command/cron/stats.pm:159 lib/Lutim/Command/cron/stats.pm:176 themes/default/templates/index.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:151 themes/default/templates/raw.html.ep:18 themes/default/templates/raw.html.ep:35 themes/default/templates/raw.html.ep:7
msgid "24 hours"
msgstr ""
...
...
@@ -44,7 +44,7 @@ msgstr ""
msgid ": Error while trying to get the counter."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:7
7
#: themes/default/templates/partial/navbar.html.ep:7
9
msgid "About"
msgstr ""
...
...
@@ -156,7 +156,7 @@ msgstr ""
msgid "For more details, see the <a href=\"https://framagit.org/luc/lutim\">homepage of the project</a>."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:8
0
#: themes/default/templates/partial/navbar.html.ep:8
2
msgid "Fork me!"
msgstr ""
...
...
@@ -196,19 +196,19 @@ msgstr ""
msgid "Image delay"
msgstr ""
#: lib/Lutim/Controller.pm:7
48
#: lib/Lutim/Controller.pm:7
52
msgid "Image not found."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
69
#: themes/default/templates/partial/navbar.html.ep:
71
msgid "Informations"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:3
3
#: themes/default/templates/partial/navbar.html.ep:3
5
msgid "Install webapp"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:
29
#: themes/default/templates/partial/navbar.html.ep:
31
msgid "Instance's statistics"
msgstr ""
...
...
@@ -228,7 +228,7 @@ msgstr ""
msgid "Keep EXIF tags"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:4
0
#: themes/default/templates/partial/navbar.html.ep:4
2
msgid "Language"
msgstr ""
...
...
@@ -236,7 +236,7 @@ msgstr ""
msgid "Let's go!"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:7
4
#: themes/default/templates/partial/navbar.html.ep:7
6
msgid "License:"
msgstr ""
...
...
@@ -260,7 +260,7 @@ msgstr ""
msgid "Markdown syntax"
msgstr ""
#: themes/default/templates/myfiles.html.ep:2 themes/default/templates/partial/navbar.html.ep:2
6
#: themes/default/templates/myfiles.html.ep:2 themes/default/templates/partial/navbar.html.ep:2
8
msgid "My images"
msgstr ""
...
...
@@ -314,23 +314,23 @@ msgid "Something bad happened"
msgstr ""
#. ($c->config('contact')
#: lib/Lutim/Controller.pm:75
5
#: lib/Lutim/Controller.pm:75
9
msgid "Something went wrong when creating the zip file. Try again later or contact the administrator (%1)."
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:5
2
#: themes/default/templates/partial/navbar.html.ep:5
4
msgid "Support the author"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:6
0
#: themes/default/templates/partial/navbar.html.ep:6
2
msgid "Support the author on Liberapay"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:5
7
#: themes/default/templates/partial/navbar.html.ep:5
9
msgid "Support the author on Tipeee"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:6
3
#: themes/default/templates/partial/navbar.html.ep:6
5
msgid "Support the author with bitcoins"
msgstr ""
...
...
@@ -401,7 +401,7 @@ msgstr ""
msgid "Toggle fullscreen"
msgstr ""
#: themes/default/templates/partial/navbar.html.ep:1
6
#: themes/default/templates/partial/navbar.html.ep:1
8
msgid "Toggle navigation"
msgstr ""
...
...
@@ -418,7 +418,7 @@ msgstr ""
msgid "Unable to find the image %1."
msgstr ""
#: lib/Lutim/Controller.pm:572 lib/Lutim/Controller.pm:617 lib/Lutim/Controller.pm:65
4
lib/Lutim/Controller.pm:69
7
lib/Lutim/Controller.pm:7
09
lib/Lutim/Controller.pm:72
0
lib/Lutim/Controller.pm:74
5
lib/Lutim/Plugin/Helpers.pm:84
#: lib/Lutim/Controller.pm:572 lib/Lutim/Controller.pm:617 lib/Lutim/Controller.pm:65
6
lib/Lutim/Controller.pm:69
9
lib/Lutim/Controller.pm:7
11
lib/Lutim/Controller.pm:72
2
lib/Lutim/Controller.pm:74
9
lib/Lutim/Plugin/Helpers.pm:84
msgid "Unable to find the image: it has been deleted."
msgstr ""
...
...
@@ -495,7 +495,7 @@ msgstr ""
msgid "core developer"
msgstr ""
#: lib/Lutim.pm:19
7
lib/Lutim/Command/cron/stats.pm:147 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:175 themes/default/templates/index.html.ep:3 themes/default/templates/raw.html.ep:17 themes/default/templates/raw.html.ep:34 themes/default/templates/raw.html.ep:6
#: lib/Lutim.pm:19
9
lib/Lutim/Command/cron/stats.pm:147 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:175 themes/default/templates/index.html.ep:3 themes/default/templates/raw.html.ep:17 themes/default/templates/raw.html.ep:34 themes/default/templates/raw.html.ep:6
msgid "no time limit"
msgstr ""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment