From a1db5b626ff8a23c6c0e1c47b793774f6fb499bc Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 18 Sep 2016 22:23:36 +0200 Subject: hide non-primary options behind js menu --- public/static/collapse.js | 17 +++++ public/static/default.css | 38 ++++++++++- templates/layouts/default.html.ep | 138 +++++++++++++++++++------------------- 3 files changed, 124 insertions(+), 69 deletions(-) diff --git a/public/static/collapse.js b/public/static/collapse.js index d38b30a..b6537be 100644 --- a/public/static/collapse.js +++ b/public/static/collapse.js @@ -19,4 +19,21 @@ $(document).ready(function() { }); }); }); + $('.moresettings-header').each(function() { + $(this).click(function() { + var moresettings = $('.moresettings'); + if ($(this).hasClass('moresettings-header-collapsed')) { + $(this).removeClass('moresettings-header-collapsed'); + $(this).addClass('moresettings-header-expanded'); + moresettings.removeClass('moresettings-collapsed'); + moresettings.addClass('moresettings-expanded'); + } + else { + $(this).removeClass('moresettings-header-expanded'); + $(this).addClass('moresettings-header-collapsed'); + moresettings.removeClass('moresettings-expanded'); + moresettings.addClass('moresettings-collapsed'); + } + }); + }); }); diff --git a/public/static/default.css b/public/static/default.css index e11e315..4d8cd91 100644 --- a/public/static/default.css +++ b/public/static/default.css @@ -483,6 +483,26 @@ span.notes { color: #666666; } +.moresettings-header { + cursor: pointer; +} + +.moresettings-header-collapsed:before { + content: "▹ " +} + +.moresettings-header-expanded:before { + content: "▿ " +} + +.moresettings-collapsed { + display: none; +} + +.moresettings-expanded { + display: block; +} + div.break { height: 1em; } @@ -550,10 +570,26 @@ input[type="submit"]:hover, border-color: #204d74; } -input[type="submit"]:active { +input[type="submit"]:active, +.button.active { box-shadow: inset 0 3px 5px rgba(0,0,0,.125); } +.button-light { + color: #333; + background-color: #fff; + border-color: #ccc; +} + +.button-light:active, +.button-light:focus, +.button-light:hover +{ + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} + div.notes { margin-top: 2em; } diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index a7e6a02..92ee22a 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -70,84 +70,86 @@ Bitte eine Station aus der Liste auswählen %= submit_button 'Abfartsmonitor'
- Optionale Einstellungen: -
-
- Frontend -
-
- %= select_field mode => [ ['App / Infoscreen' => 'clean'], ['Bahnhofstafel' => 'multi'], ['Gleis' => 'single'] ] +
Weitere Einstellungen
+
+
+
+ Frontend +
+
+ %= select_field mode => [ ['App / Infoscreen' => 'clean'], ['Bahnhofstafel' => 'multi'], ['Gleis' => 'single'] ] +
-
-
-
- Backend +
+
+ Backend +
+
+ %= select_field backend => [ ['IRIS' => 'iris'], ['HAFAS' => 'ris'] ] +
-
- %= select_field backend => [ ['IRIS' => 'iris'], ['HAFAS' => 'ris'] ] +
+
+ Nur Züge über +
+
+ %= text_field 'via', placeholder => 'Bahnhof 1, Bhf2, ... (oder regulärer Ausdruck)', class => 'station' +
-
-
-
- Nur Züge über -
-
- %= text_field 'via', placeholder => 'Bahnhof 1, Bhf2, ... (oder regulärer Ausdruck)', class => 'station' -
-
-
-
- Gleise -
-
- %= text_field 'platforms', placeholder => '1, 2, 5, ...' +
+
+ Gleise +
+
+ %= text_field 'platforms', placeholder => '1, 2, 5, ...' +
-
-
-
- %= check_box 'hidelowdelay' => 1, id => 'id_hidelowdelay' - +
+
+ %= check_box 'hidelowdelay' => 1, id => 'id_hidelowdelay' + +
-
-
-
- %= check_box 'hide_opts' => 1, id => 'id_hide_opts' - +
+
+ %= check_box 'hide_opts' => 1, id => 'id_hide_opts' + +
-
-
- Nur für IRIS-Backend: -
-
- Ankunfts- oder Abfahrtszeit anzeigen? +
+ Nur für IRIS-Backend: +
+
+ Ankunfts- oder Abfahrtszeit anzeigen? +
+
+ %= select_field admode => [['Abfahrt bevorzugen' => 'deparr'], ['Nur Abfahrt' => 'dep'], ['Nur Ankunft' => 'arr']] +
-
- %= select_field admode => [['Abfahrt bevorzugen' => 'deparr'], ['Nur Abfahrt' => 'dep'], ['Nur Ankunft' => 'arr']] +
+
+ %= check_box 'show_realtime' => 1, id => 'id_show_realtime' + +
-
-
-
- %= check_box 'show_realtime' => 1, id => 'id_show_realtime' - +
+
+ %= check_box 'recursive' => 1, id => 'id_recursive' + +
-
-
-
- %= check_box 'recursive' => 1, id => 'id_recursive' - +
+ %= submit_button 'Anzeigen'
-
-
- %= submit_button 'Anzeigen' -
+
% end -- cgit v1.2.3