services: add marudor.de/regional

This commit is contained in:
Daniel Friesel 2022-07-16 13:55:36 +02:00
parent 74123bbcc0
commit ff290c78e0
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005
3 changed files with 19 additions and 8 deletions

View file

@ -382,7 +382,7 @@ sub services {
if ( $self->param('action') and $self->param('action') eq 'save' ) { if ( $self->param('action') and $self->param('action') eq 'save' ) {
my $sb = $self->param('stationboard'); my $sb = $self->param('stationboard');
my $value = 0; 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); $value = int($sb);
} }
$self->users->use_external_services( $self->users->use_external_services(

View file

@ -14,7 +14,8 @@ my @sb_templates = (
undef, 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}' ], [ '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 { sub new {
@ -498,7 +499,7 @@ sub use_external_services {
my $value = $opt{set}; my $value = $opt{set};
if ( defined $value ) { if ( defined $value ) {
if ( $value < 0 or $value > 3 ) { if ( $value < 0 or $value > 4 ) {
$value = 0; $value = 0;
} }
$db->update( 'users', { external_services => $value }, { id => $uid } ); $db->update( 'users', { external_services => $value }, { id => $uid } );

View file

@ -32,7 +32,7 @@
<div> <div>
<label> <label>
%= radio_button stationboard => '1' %= 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> </label>
</div> </div>
</div> </div>
@ -42,7 +42,17 @@
<div> <div>
<label> <label>
%= radio_button stationboard => '2' %= 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> </label>
</div> </div>
</div> </div>
@ -52,7 +62,7 @@
<div> <div>
<label> <label>
%= radio_button stationboard => '3' %= 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> </label>
</div> </div>
</div> </div>