summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpanfile2
-rwxr-xr-xlib/Travelynx.pm6
-rwxr-xr-xlib/Travelynx/Controller/Profile.pm33
-rw-r--r--public/service-worker.js24
-rw-r--r--public/static/css/material-icons.css8
-rw-r--r--public/static/manifest.json12
l---------public/static/v72 (renamed from public/static/v70)0
-rw-r--r--templates/layouts/default.html.ep2
8 files changed, 58 insertions, 29 deletions
diff --git a/cpanfile b/cpanfile
index f81887c..401f54c 100644
--- a/cpanfile
+++ b/cpanfile
@@ -14,7 +14,7 @@ requires 'Mojolicious::Plugin::OAuth2';
requires 'Mojo::Pg';
requires 'Text::CSV';
requires 'Text::Markdown';
-requires 'Travel::Status::DE::DBWagenreihung', '0.12';
+requires 'Travel::Status::DE::DBWagenreihung', '== 0.12';
requires 'Travel::Status::DE::HAFAS', '>= 5.03';
requires 'Travel::Status::DE::IRIS';
requires 'UUID::Tiny';
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 4d04e9e..4749d65 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2358,8 +2358,10 @@ sub startup {
$r->get('/recover')->to('account#request_password_reset');
$r->get('/recover/:id/:token')->to('account#recover_password');
$r->get('/reg/:id/:token')->to('account#verify');
- $r->get('/status/:name')->to('profile#user_status');
- $r->get('/status/:name/:ts')->to('profile#user_status');
+ $r->get( '/status/:name' => [ format => [ 'html', 'json' ] ] )
+ ->to( 'profile#user_status', format => undef );
+ $r->get( '/status/:name/:ts' => [ format => [ 'html', 'json' ] ] )
+ ->to( 'profile#user_status', format => undef );
$r->get('/ajax/status/#name')->to('profile#status_card');
$r->get('/ajax/status/:name/:ts')->to('profile#status_card');
$r->get('/p/:name')->to('profile#profile');
diff --git a/lib/Travelynx/Controller/Profile.pm b/lib/Travelynx/Controller/Profile.pm
index a063c10..fc2d38c 100755
--- a/lib/Travelynx/Controller/Profile.pm
+++ b/lib/Travelynx/Controller/Profile.pm
@@ -334,7 +334,16 @@ sub user_status {
my $user = $self->users->get_privacy_by( name => $name );
if ( not $user ) {
- $self->render( 'not_found', status => 404 );
+ $self->respond_to(
+ json => {
+ json => { error => 'not found' },
+ status => 404,
+ },
+ any => {
+ template => 'not_found',
+ status => 404
+ }
+ );
return;
}
@@ -389,11 +398,29 @@ sub user_status {
"/p/${name}/j/$journey->{id}?token=${token}-${ts}");
}
else {
- $self->render( 'not_found', status => 404 );
+ $self->respond_to(
+ json => {
+ json => { error => 'not found' },
+ status => 404,
+ },
+ any => {
+ template => 'not_found',
+ status => 404
+ }
+ );
}
return;
}
- $self->render( 'not_found', status => 404 );
+ $self->respond_to(
+ json => {
+ json => { error => 'not found' },
+ status => 404,
+ },
+ any => {
+ template => 'not_found',
+ status => 404
+ }
+ );
return;
}
diff --git a/public/service-worker.js b/public/service-worker.js
index 30e49d7..b564d65 100644
--- a/public/service-worker.js
+++ b/public/service-worker.js
@@ -1,18 +1,18 @@
-const CACHE_NAME = 'static-cache-v71';
+const CACHE_NAME = 'static-cache-v72';
const FILES_TO_CACHE = [
'/favicon.ico',
'/offline.html',
- '/static/v71/css/light.min.css',
- '/static/v71/css/dark.min.css',
- '/static/v71/css/material-icons.css',
- '/static/v71/fonts/MaterialIcons-Regular.woff2',
- '/static/v71/fonts/MaterialIcons-Regular.woff',
- '/static/v71/fonts/MaterialIcons-Regular.ttf',
- '/static/v71/js/jquery-3.4.1.min.js',
- '/static/v71/js/materialize.min.js',
- '/static/v71/js/travelynx-actions.min.js',
- '/static/v71/js/autocomplete.min.js',
- '/static/v71/js/geolocation.min.js',
+ '/static/v72/css/light.min.css',
+ '/static/v72/css/dark.min.css',
+ '/static/v72/css/material-icons.css',
+ '/static/v72/fonts/MaterialIcons-Regular.woff2',
+ '/static/v72/fonts/MaterialIcons-Regular.woff',
+ '/static/v72/fonts/MaterialIcons-Regular.ttf',
+ '/static/v72/js/jquery-3.4.1.min.js',
+ '/static/v72/js/materialize.min.js',
+ '/static/v72/js/travelynx-actions.min.js',
+ '/static/v72/js/autocomplete.min.js',
+ '/static/v72/js/geolocation.min.js',
];
self.addEventListener('install', (evt) => {
diff --git a/public/static/css/material-icons.css b/public/static/css/material-icons.css
index c059c8f..73103dd 100644
--- a/public/static/css/material-icons.css
+++ b/public/static/css/material-icons.css
@@ -2,12 +2,12 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
- src: url(/static/v71/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
+ src: url(/static/v72/fonts/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
- url(/static/v71/fonts/MaterialIcons-Regular.woff2) format('woff2'),
- url(/static/v71/fonts/MaterialIcons-Regular.woff) format('woff'),
- url(/static/v71/fonts/MaterialIcons-Regular.ttf) format('truetype');
+ url(/static/v72/fonts/MaterialIcons-Regular.woff2) format('woff2'),
+ url(/static/v72/fonts/MaterialIcons-Regular.woff) format('woff'),
+ url(/static/v72/fonts/MaterialIcons-Regular.ttf) format('truetype');
}
.material-icons {
diff --git a/public/static/manifest.json b/public/static/manifest.json
index 9b85950..ed2760a 100644
--- a/public/static/manifest.json
+++ b/public/static/manifest.json
@@ -3,27 +3,27 @@
"short_name": "Travelynx",
"scope": "/",
"icons": [{
- "src": "/static/v71/icons/icon-128x128.png",
+ "src": "/static/v72/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
}, {
- "src": "/static/v71/icons/icon-144x144.png",
+ "src": "/static/v72/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}, {
- "src": "/static/v71/icons/icon-152x152.png",
+ "src": "/static/v72/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
}, {
- "src": "/static/v71/icons/icon-192x192.png",
+ "src": "/static/v72/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
}, {
- "src": "/static/v71/icons/icon-256x256.png",
+ "src": "/static/v72/icons/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
}, {
- "src": "/static/v71/icons/icon-512x512.png",
+ "src": "/static/v72/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}],
diff --git a/public/static/v70 b/public/static/v72
index 945c9b4..945c9b4 120000
--- a/public/static/v70
+++ b/public/static/v72
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 80ef49e..fbb26ef 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -13,7 +13,7 @@
% while (my ($key, $value) = each %{stash('opengraph') // {}}) {
<meta property="og:<%= $key %>" content="<%= $value %>">
% }
- % my $av = 'v71'; # asset version
+ % my $av = 'v72'; # asset version
<link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/static/<%= $av %>/icons/icon-96x96.png" sizes="96x96">