summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-07-16 13:55:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-07-16 13:55:36 +0200
commitff290c78e01656e3991e13f4da614e4fab24da29 (patch)
treecee694a2a93ce77c794202708ec3ce40d3bcae0d
parent74123bbcc0aedb3e7dbc49a33fcba6a864b7e550 (diff)
services: add marudor.de/regional
-rw-r--r--lib/Travelynx/Controller/Account.pm2
-rw-r--r--lib/Travelynx/Model/Users.pm9
-rw-r--r--templates/use_external_links.html.ep16
3 files changed, 19 insertions, 8 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm
index f4f05d9..74e3367 100644
--- a/lib/Travelynx/Controller/Account.pm
+++ b/lib/Travelynx/Controller/Account.pm
@@ -382,7 +382,7 @@ sub services {
if ( $self->param('action') and $self->param('action') eq 'save' ) {
my $sb = $self->param('stationboard');
my $value = 0;
- if ( $sb =~ m{ ^ \d+ $ }x and $sb >= 0 and $sb <= 3 ) {
+ if ( $sb =~ m{ ^ \d+ $ }x and $sb >= 0 and $sb <= 4 ) {
$value = int($sb);
}
$self->users->use_external_services(
diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm
index b0fdba0..b694ac3 100644
--- a/lib/Travelynx/Model/Users.pm
+++ b/lib/Travelynx/Model/Users.pm
@@ -12,9 +12,10 @@ use DateTime;
my @sb_templates = (
undef,
- [ 'DBF', 'https://dbf.finalrewind.org/{name}?show_realtime=1#{tt}{tn}' ],
+ [ 'DBF', 'https://dbf.finalrewind.org/{name}?show_realtime=1#{tt}{tn}' ],
[ 'marudor.de', 'https://marudor.de/{name}' ],
- [ 'NVM', 'https://nvm.finalrewind.org/board/{eva}' ],
+ [ 'NVM', 'https://nvm.finalrewind.org/board/{eva}#{tt}{tn}' ],
+ [ 'marudor.de/regional', 'https://marudor.de/regional/{name}' ],
);
sub new {
@@ -497,8 +498,8 @@ sub use_external_services {
my $uid = $opt{uid};
my $value = $opt{set};
- if (defined $value) {
- if ( $value < 0 or $value > 3 ) {
+ if ( defined $value ) {
+ if ( $value < 0 or $value > 4 ) {
$value = 0;
}
$db->update( 'users', { external_services => $value }, { id => $uid } );
diff --git a/templates/use_external_links.html.ep b/templates/use_external_links.html.ep
index f1c8c81..d58e33d 100644
--- a/templates/use_external_links.html.ep
+++ b/templates/use_external_links.html.ep
@@ -32,7 +32,7 @@
<div>
<label>
%= radio_button stationboard => '1'
- <span><a href="https://dbf.finalrewind.org/">DBF</a></span>
+ <span><a href="https://dbf.finalrewind.org/">DBF</a> (Schienenverkehr)</span>
</label>
</div>
</div>
@@ -42,7 +42,17 @@
<div>
<label>
%= radio_button stationboard => '2'
- <span><a href="https://marudor.de/">marudor.de</a></span>
+ <span><a href="https://marudor.de/">marudor.de</a> (Schienenverkehr)</span>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="input-field col s12">
+ <div>
+ <label>
+ %= radio_button stationboard => '4'
+ <span><a href="https://marudor.de/regional">marudor.de/regional</a> (Nahverkehr)</span>
</label>
</div>
</div>
@@ -52,7 +62,7 @@
<div>
<label>
%= radio_button stationboard => '3'
- <span><a href="https://nvm.finalrewind.org/">NVM</a></span>
+ <span><a href="https://nvm.finalrewind.org/">NVM</a> (Nahverkehr)</span>
</label>
</div>
</div>