Skip to content

Commit

Permalink
🚑 Hotfixes (#229)
Browse files Browse the repository at this point in the history
* Hotfixes CSS and added placeholder

* Formatting

* Fixed test
  • Loading branch information
MrKrisKrisu authored Feb 23, 2021
1 parent f382b74 commit 958296f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 27 deletions.
64 changes: 46 additions & 18 deletions resources/views/includes/station-autocomplete.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,83 @@
<input type="hidden" id="autocomplete-provider" name="provider" value="train">

<div class="input-group mb-2 mr-sm-2">
<input type="text" id="station-autocomplete" name="station" class="form-control" placeholder="{{ __('stationboard.station-placeholder') }}" @isset(request()->station) value="{{request()->station}}" @endisset>
<input type="text" id="station-autocomplete" name="station" class="form-control"
placeholder="{{ __('stationboard.station-placeholder') }} / DS100" @isset(request()->station) value="{{request()->station}}" @endisset
/>

@if($latest->count() > 0 || Auth::user()->home)
<div class="input-group-append" id="history-button" title="{{__('stationboard.last-stations')}}">
<div class="input-group-append" id="history-button"
title="{{__('stationboard.last-stations')}}">
<span class="input-group-text">
<i class="fa fa-history"></i>
</span>
</div>
</div>
@endif

<div class="input-group-append" id="gps-button" title="{{__('stationboard.search-by-location')}}">

<div class="input-group-append" id="gps-button"
title="{{__('stationboard.search-by-location')}}">
<span class="input-group-text">
<i class="fa fa-map-marker-alt"></i>
</span>
</div>

</div>
<div class="list-group d-none" id="last-stations">
@if(Auth::user()->home)
<a href="{{ route('trains.stationboard', ['provider' => 'train', 'station' => Auth::user()->home->name ]) }}"
title="{{ Auth::user()->home->name }}" id="home-button" class="list-group-item list-group-item-action">
title="{{ Auth::user()->home->name }}" id="home-button"
class="list-group-item list-group-item-action">
<i class="fa fa-home mr-2"></i> {{ Auth::user()->home->name }}
</a>
@endif

@if($latest->count())
<span class="list-group-item title list-group-item-action disabled">{{__('stationboard.last-stations')}}</span>
<span class="list-group-item title list-group-item-action disabled">{{__('stationboard.last-stations')}}</span>
@endif
@foreach($latest as $station)
<a href="{{ route('trains.stationboard', ['provider' => 'train', 'station' => $station->name ]) }}"
title="{{ $station->name }}" id="home-button" class="list-group-item list-group-item-action">
title="{{ $station->name }}" id="home-button"
class="list-group-item list-group-item-action">
{{ $station->name }}
</a>
@endforeach
</div>

<input type="hidden" name="when" value="{{@$request->when}}">
<button class="btn btn-outline-primary float-right" type="submit">{{__('stationboard.submit-search')}}</button>
<button class="btn btn-outline-secondary" type="button" data-toggle="collapse" data-target="#collapseFilter" aria-expanded="false">{{__('stationboard.filter-products')}}</button>
<button class="btn btn-outline-primary float-right" type="submit">
{{__('stationboard.submit-search')}}
</button>
<button class="btn btn-outline-secondary" type="button" data-toggle="collapse"
data-target="#collapseFilter" aria-expanded="false">
{{__('stationboard.filter-products')}}
</button>
<div class="collapse" id="collapseFilter">
<div class="mt-3 d-flex justify-content-center">
<div class="btn-group flex-wrap btn-group-sm" role="group">
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="ferry">{{ __('transport_types.ferry') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="bus">{{ __('transport_types.bus') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="tram">{{ __('transport_types.tram') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="subway">{{ __('transport_types.subway') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="suburban">{{ __('transport_types.suburban') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="regional">{{ __('transport_types.regional') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="express">{{ __('transport_types.express') }}</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="ferry">
{{ __('transport_types.ferry') }}
</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="bus">
{{ __('transport_types.bus') }}
</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType" value="tram">
{{ __('transport_types.tram') }}
</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType"
value="subway">
{{ __('transport_types.subway') }}
</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType"
value="suburban">
{{ __('transport_types.suburban') }}
</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType"
value="regional">
{{ __('transport_types.regional') }}
</button>
<button type="submit" class="btn btn-unique btn-sm" name="travelType"
value="express">
{{ __('transport_types.express') }}
</button>
</div>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions resources/views/leaderboard/leaderboard.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@extends('layouts.app')

@section('title')
{{ __('menu.leaderboard') }}
@endsection
@section('title'){{ __('menu.leaderboard') }}@endsection

@section('content')
<div class="container">
Expand Down
4 changes: 1 addition & 3 deletions resources/views/leaderboard/month.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@extends('layouts.app')

@section('title')
{{ __('menu.leaderboard') }}
@endsection
@section('title'){{ __('menu.leaderboard') }}@endsection

@section('content')
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/search.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@extends('layouts.app')

@section('title')Dashboard@endsection
@section('title')Dashboard @endsection

@section('content')
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion 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 @endsection

@section('content')
@include('includes.station-autocomplete')
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/HelperMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testStationLink() {

$response = $this->actingAs($user)
->get($links[0]->getAttribute('href'));
$response->assertSee('<input type="text" id="station-autocomplete" name="station" class="form-control" placeholder="Haltestelle" value="' . $alternatedTo . '"', false);
$response->assertSee('placeholder="Haltestelle / DS100" value="' . $alternatedTo . '"', false);
}
}

Expand Down

0 comments on commit 958296f

Please sign in to comment.