From e7d37d5a81537668a71d373c8eb59d08242c25d4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 29 Apr 2019 08:52:24 +0200 Subject: Switch to App/Mobile first, no longer rely on BrowserDetect plugin "App" with force_mobile=1 is now the default view even on desktop -- The infoscreen template's extra large font wasn't really nice. This breaks the setup of everyone who was relying on infoscreen being the default -- please append `mode=infoscreen` to your requests. --- README.md | 1 - lib/DBInfoscreen.pm | 1 - lib/DBInfoscreen/Controller/Stationboard.pm | 1 + public/static/default.css | 17 +++++++++++++++++ public/static/mobile.css | 18 ++++-------------- templates/layouts/default.html.ep | 7 +++---- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 327c15a..4cf5c78 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ Dependencies * perl >= 5.10 * Cache::File (part of the Cache module) * Mojolicious - * Mojolicious::Plugin::BrowserDetect * Travel::Status::DE::DBWagenreihung >= 0.00 * Travel::Status::DE::DeutscheBahn >= 2.03 * Travel::Status::DE::IRIS >= 1.21 diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index af952c2..422a25d 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -242,7 +242,6 @@ sub startup { ); $self->types->type( json => 'application/json; charset=utf-8' ); - $self->plugin('browser_detect'); } diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index ed5f2d1..c13ed48 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -798,6 +798,7 @@ sub handle_request { $template eq 'single' or $template eq 'multi' ), + force_mobile => ( $template eq 'app' ), ); } return; diff --git a/public/static/default.css b/public/static/default.css index 1b8780a..6f2f603 100644 --- a/public/static/default.css +++ b/public/static/default.css @@ -1,3 +1,7 @@ +body { + margin: 0; +} + html { font-family: Sans-Serif; } @@ -7,6 +11,19 @@ a { text-decoration: none; } +p, +div.about, +div.input-field, +div.notes { + max-width: 94%; + margin-left: auto; + margin-right: auto; +} + +p { + text-align: justify; +} + div.app { border-width:1px 2px; width:100%; diff --git a/public/static/mobile.css b/public/static/mobile.css index 17d9539..c57246c 100644 --- a/public/static/mobile.css +++ b/public/static/mobile.css @@ -1,5 +1,7 @@ -body { - margin: 0; +div.app { + max-width: 60em; + margin-left: auto; + margin-right: auto; } div.app > ul > li { @@ -9,15 +11,3 @@ div.app > ul > li { div.app li .moreinfo { font-size: 2.6em; } - -p, -div.input-field, -div.notes { - max-width: 94%; - margin-left: auto; - margin-right: auto; -} - -p { - text-align: justify; -} diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 7649be5..ee12097 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -13,8 +13,8 @@ % my $av = 'v8'; # asset version %= stylesheet "/static/${av}/default.css" %= stylesheet "/static/${av}/jquery-ui.min.css" -% my $force_mobile = param('force_mobile') // -1; -% if ($force_mobile == 1 or ($self->browser->mobile and $force_mobile != 0)) { +% my $force_mobile = param('force_mobile') // stash('force_mobile'); +% if ($force_mobile) { %= stylesheet "/static/${av}/mobile.css" % } %if (stash('load_marquee')) { @@ -199,8 +199,7 @@ Bitte eine Station aus der Liste auswählen