Skip to content

Commit

Permalink
Add divider to stationboard (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Oct 2, 2021
1 parent d64f2a3 commit 5d57795
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 37 deletions.
3 changes: 2 additions & 1 deletion resources/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,6 @@
"description.en-route": "Übersichtskarte über alle Träweller, welche gerade auf der Welt unterwegs sind.",
"leaderboard.notice": "Die hier angezeigten Daten basieren auf den Check-Ins der letzten 7 Tage.",
"localisation.not-available": "Dieser Inhalt steht aktuell leider nicht auf deiner Sprache zur Verfügung.",
"minutes": "Minuten"
"minutes": "Minuten",
"request-time": "abgefragt um :time"
}
3 changes: 2 additions & 1 deletion resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,6 @@
"minutes": "minutes",
"settings.visibility": "Visibility",
"settings.visibility.disclaimer": "If your profile is private, even statuses marked as public will only be shown to your followers.",
"settings.visibility.default": "CheckIns: Default visibility"
"settings.visibility.default": "CheckIns: Default visibility",
"request-time": "requested at :time"
}
1 change: 1 addition & 0 deletions resources/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ body {
@import "./components/leaderboard";
@import "./components/search";
@import "./components/custom-buttons";
@import "./components/stationboard";

.table-vertical-center td {
vertical-align: middle;
Expand Down
11 changes: 11 additions & 0 deletions resources/sass/components/stationboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

#stationboard {
.stationboardDivider {
border-top: #fff solid 2px;
text-align: center;

small {
color: #fff;
}
}
}
79 changes: 44 additions & 35 deletions resources/views/stationboard.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@extends('layouts.app')

@section('title')RIS @endsection
@section('title', 'RIS')

@section('content')
@include('includes.station-autocomplete')
Expand Down Expand Up @@ -33,7 +33,8 @@ class="btn btn-light">
<input type="hidden" name="travelType" value="{{$request->travelType}}"/>
<div class="input-group mb-3 mx-auto">
<input type="datetime-local" class="form-control" id="timepicker" name="when"
aria-describedby="button-addontime" value="{{ $times['now']->format("Y-m-d\TH:i") }}"/>
aria-describedby="button-addontime"
value="{{ $times['now']->format("Y-m-d\TH:i") }}"/>
<button class="btn btn-outline-primary" type="submit" id="button-addontime"
data-mdb-ripple-color="dark">
{{__('stationboard.set-time')}}
Expand Down Expand Up @@ -65,7 +66,7 @@ class="btn btn-light">
</tr>
</table>
@else
<table class="table table-dark table-borderless table-hover m-0">
<table class="table table-dark table-borderless table-hover m-0" id="stationboard">
<thead>
<tr>
<th></th>
Expand All @@ -75,44 +76,52 @@ class="btn btn-light">
</tr>
</thead>
<tbody>
@foreach($departures as $departure)
<tr @if(!isset($departure->cancelled)) class="trainrow"
@endif data-tripID="{{ $departure->tripId }}"
data-lineName="{{ $departure->line->name != null ? $departure->line->name : $departure->line->fahrtNr }}"
data-start="{{ $departure->stop->id }}"
data-departure="{{ $departure->plannedWhen }}">
<td>@if (file_exists(public_path('img/'.$departure->line->product.'.svg')))
<img class="product-icon"
alt="Icon of {{$departure->line->product}}"
src="{{ asset('img/'.$departure->line->product.'.svg') }}">
@else
<i class="fa fa-train"></i>
@endif</td>
<td>
@if($departure->line->name)
{!! str_replace(" ", "&nbsp;", $departure->line->name) !!}
@else
{!! str_replace(" ", "&nbsp;", $departure->line->fahrtNr) !!}
@endif
@foreach($departures as $departure)
@if(!$loop->first && !$loop->last && \Carbon\Carbon::parse($departures[$loop->index - 1]->when)->isPast() && \Carbon\Carbon::parse($departures[$loop->index]->when)->isAfter(\Carbon\Carbon::now()->setSecond(0)))
<tr>
<td colspan="4" class="stationboardDivider">
<small>{{__('request-time', ['time' => \Carbon\Carbon::now()->isoFormat(__('time-format'))])}}</small>
</td>
</tr>
@endif

</td>
<td>{{ $departure->direction }}</td>
<td>
@if(isset($departure->cancelled))
<span class="text-danger">
<tr @if(!isset($departure->cancelled)) class="trainrow"
@endif data-tripID="{{ $departure->tripId }}"
data-lineName="{{ $departure->line->name != null ? $departure->line->name : $departure->line->fahrtNr }}"
data-start="{{ $departure->stop->id }}"
data-departure="{{ $departure->plannedWhen }}">
<td>@if (file_exists(public_path('img/'.$departure->line->product.'.svg')))
<img class="product-icon"
alt="Icon of {{$departure->line->product}}"
src="{{ asset('img/'.$departure->line->product.'.svg') }}">
@else
<i class="fa fa-train"></i>
@endif</td>
<td>
@if($departure->line->name)
{!! str_replace(" ", "&nbsp;", $departure->line->name) !!}
@else
{!! str_replace(" ", "&nbsp;", $departure->line->fahrtNr) !!}
@endif

</td>
<td>{{ $departure->direction }}</td>
<td>
@if(isset($departure->cancelled))
<span class="text-danger">
{{ __('stationboard.stop-cancelled') }}
</span>
@else
{{\Carbon\Carbon::parse($departure->plannedWhen)->isoFormat(__('time-format'))}}
@if(isset($departure->delay))
<small>(<span class="traindelay">
@else
{{\Carbon\Carbon::parse($departure->plannedWhen)->isoFormat(__('time-format'))}}
@if(isset($departure->delay))
<small>(<span class="traindelay">
+{{ $departure->delay / 60 }}
</span>)</small>
@endif
@endif
@endif
</td>
</tr>
@endforeach
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
Expand Down

0 comments on commit 5d57795

Please sign in to comment.