summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-29 08:52:24 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-29 08:52:24 +0200
commite7d37d5a81537668a71d373c8eb59d08242c25d4 (patch)
treed208d334d9d5dd6dc2a0b1f3dae7985e567573f9
parentcd1dc7572478988591389f75e15109419089c440 (diff)
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.
-rw-r--r--README.md1
-rw-r--r--lib/DBInfoscreen.pm1
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm1
-rw-r--r--public/static/default.css17
-rw-r--r--public/static/mobile.css18
-rw-r--r--templates/layouts/default.html.ep7
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</div>
<ul>
<li>Diese Seite kann gerne als iframe in eigene Infoscreens o.ä. eingebunden werden.
Für eine kleine Ansicht (z.B. iframe in einer normalen Website) bitte das
- "App"-Frontend verwenden (und vorerst den Parameter <span style="font-family: monospace;">force_mobile=1</span>
- hinzufügen, das ist bald aber nicht mehr nötig). Für eine große Ansicht
+ "App"-Frontend verwenden. Für eine große Ansicht
(z.B. als alleinstehender Infoscreen) gibt es das "Infoscreen"-Frontend.</li>
<li>Die Parameter <span style="font-family: monospace;">mode=json&amp;version=3</span>
(alternativ auch <span style="font-family: