Skip to content

Commit

Permalink
✨ add plane for manual trips (#2704)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Jun 26, 2024
1 parent f75f3dd commit 952f3c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion app/Enum/HafasTravelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* description="Category of transport. ",
* type="string",
* enum={"nationalExpress", "national", "regionalExp", "regional", "suburban", "bus", "ferry", "subway",
* "tram", "taxi"},
* "tram", "taxi", "plane"},
* example="suburban"
* )
*/
Expand All @@ -25,6 +25,7 @@ enum HafasTravelType: string
case SUBWAY = 'subway';
case TRAM = 'tram';
case TAXI = 'taxi';
case PLANE = 'plane';

public function getEmoji(): string {
return match ($this->value) {
Expand All @@ -36,6 +37,7 @@ public function getEmoji(): string {
'subway' => '🚇',
'tram' => '🚊',
'taxi' => '🚖',
'plane' => '✈️',
default => '',
};
}
Expand Down
6 changes: 4 additions & 2 deletions app/Enum/TravelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
namespace App\Enum;

/**
* @todo Mit HafasTravelType abgleichen - warum wird dieses Enum hier für HAFAS Requests genutzt und nicht das HafasTravelType?
*
* @OA\Schema(
* title="travelType",
* type="string",
* enum={"express", "regional", "suburban", "bus", "ferry", "subway", "tram", "taxi",
* "tram", "taxi"},
* enum={"express", "regional", "suburban", "bus", "ferry", "subway", "tram", "taxi", "plane"},
* example="suburban"
* )
*/
Expand All @@ -22,4 +23,5 @@ enum TravelType: string
case SUBWAY = 'subway';
case TRAM = 'tram';
case TAXI = 'taxi';
case PLANE = 'plane';
}
14 changes: 8 additions & 6 deletions resources/views/includes/status.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@php
use App\Enum\Business;
use App\Http\Controllers\Backend\Transport\StationController;
use App\Http\Controllers\Backend\User\ProfilePictureController;
use App\Http\Controllers\Backend\Helper\StatusHelper;use App\Http\Controllers\Backend\Transport\StationController;
use App\Http\Controllers\Backend\Transport\StatusController;use App\Http\Controllers\Backend\User\ProfilePictureController;use Illuminate\Support\Facades\Gate;
@endphp
<div class="card status mb-3" id="status-{{ $status->id }}"
data-trwl-id="{{$status->id}}"
Expand Down Expand Up @@ -65,11 +65,13 @@ class="text-trwl clearfix">

<p class="train-status text-muted">
<span>
@if (file_exists(public_path('img/' . $status->checkin->trip->category->value . '.svg')))
@if(file_exists(public_path('img/' . $status->checkin->trip->category->value . '.svg')))
<img class="product-icon"
src="{{ asset('img/' . $status->checkin->trip->category->value . '.svg') }}"
alt="{{$status->checkin->trip->category->value}}"
/>
@elseif($status->checkin->trip->category->value == 'plane')
<i class="fa fa-plane d-inline" aria-hidden="true"></i>
@elseif($status->checkin->trip->category->value == 'taxi')
<i class="fa fa-taxi d-inline" aria-hidden="true"></i>
@else
Expand Down Expand Up @@ -117,7 +119,7 @@ class="text-trwl clearfix">

@if(!empty($status->body))
<p class="status-body"><i class="fas fa-quote-right" aria-hidden="true"></i>
{!! \App\Http\Controllers\Backend\Transport\StatusController::getPrintableEscapedBody($status) !!}
{!! StatusController::getPrintableEscapedBody($status) !!}
</p>
@endif

Expand All @@ -126,7 +128,7 @@ class="text-trwl clearfix">
{{ __('stationboard.next-stop') }}

@php
$nextStation = \App\Http\Controllers\Backend\Transport\StatusController::getNextStationForStatus($status);
$nextStation = StatusController::getNextStationForStatus($status);
@endphp
<a href="{{route('trains.stationboard', ['stationId' => $nextStation?->id])}}"
class="text-trwl clearfix">
Expand Down Expand Up @@ -200,7 +202,7 @@ class="like {{ auth()->user() && $status->likes->where('user_id', auth()->user()
type="button"
data-trwl-share-url="{{ route('status', ['id' => $status->id]) }}"
@if(auth()->user() && $status->user_id == auth()->user()->id)
data-trwl-share-text="{{ \App\Http\Controllers\Backend\Helper\StatusHelper::getSocialText($status) }}"
data-trwl-share-text="{{StatusHelper::getSocialText($status) }}"
@else
data-trwl-share-text="{{ $status->description }}"
@endif
Expand Down
1 change: 1 addition & 0 deletions resources/vue/components/TripCreation/TripCreationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default {
{value: "subway", text: "subway"},
{value: "tram", text: "tram"},
{value: "taxi", text: "taxi"},
{value: "plane", text: "plane"},
],
};
},
Expand Down

0 comments on commit 952f3c3

Please sign in to comment.