Skip to content

Commit

Permalink
Merge branch 'develop' into dev-ks/remove
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Jan 11, 2025
2 parents 230fd19 + a90d73b commit c274a81
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 47 deletions.
13 changes: 1 addition & 12 deletions app/Http/Controllers/API/v1/TripController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,9 @@ class TripController extends Controller
{

/**
* Undocumented beta endpoint - only specific users have access
*
* @param Request $request
*
* @return TripResource|Response
*
* @todo add docs
* @todo currently the stations need to be in the database. We need to add a fallback to HAFAS.
* -> later solve the problem for non-existing stations
* @todo add docs when endpoint is stable
*/
public function createTrip(Request $request): TripResource|JsonResponse {
if (!auth()->user()?->can('create-manual-trip')) {
return response()->json(['message' => 'This endpoint is currently only available for open-beta users (you can enable open beta in your settings).'], 403);
}
if (auth()->user()?->can('disallow-manual-trips')) {
return response()->json(['message' => 'You are not allowed to create manual trips'], 403);
}
Expand Down
3 changes: 0 additions & 3 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,6 @@
"create-journey": "Fahrt erstellen",
"trip_creation.no-valid-times": "Die Zeiten der Stationen sind nicht in einer zeitlich korrekten Reihenfolge.",
"trip_creation.title": "Reise manuell erstellen",
"trip_creation.beta": "Bitte beachte, dass sich die Erstellung von Fahrten derzeit im Beta-Stadium befindet. Du kannst Fahrten manuell erstellen, indem du die Stationen und Zeiten eingibst. Dabei gibt es einige Einschränkungen, die unten aufgeführt sind.",
"trip_creation.beta2": "Solltest du auf Probleme stoßen, melde diese bitte an uns.",
"trip_creation.report_issue": "Problem melden",
"trip_creation.form.origin": "Abfahrtsbahnhof",
"trip_creation.form.destination": "Zielbahnhof",
"trip_creation.form.add_stopover": "Zwischenhalt hinzufügen",
Expand Down
3 changes: 0 additions & 3 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,6 @@
"create-journey": "Create journey",
"trip_creation.no-valid-times": "The times of the stations are not in the correct chronological order.",
"trip_creation.title": "Create trip manually",
"trip_creation.beta": "Please note, that the creation of trips is currently in beta. You can create trips manually by entering the stations and times. There are some limitations, which are listed below.",
"trip_creation.beta2": "If you encounter any issues, please report them to us.",
"trip_creation.report_issue": "Report issue",
"trip_creation.form.origin": "Departure station",
"trip_creation.form.destination": "Destination station",
"trip_creation.form.add_stopover": "Add stopover",
Expand Down
3 changes: 0 additions & 3 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,6 @@
"export.format": "¿En qué formato quieres exportar?",
"create-journey": "Crear viaje",
"trip_creation.title": "Crear viaje manualmente",
"trip_creation.beta": "Ten en cuenta que la creación de viajes está actualmente en beta. Puedes crear viajes manualnente introduciendo las estaciones y horarios. Hay varias limitaciones, listadas abajo.",
"trip_creation.beta2": "Si encuentras algún problema, notificanoslo.",
"trip_creation.report_issue": "Notificar problema",
"trip_creation.form.origin": "Estación de salida",
"missing-journey": "¿No has encontrado tu viaje?",
"trip_creation.limitations.6": "Solo los métodos de transporte seleccionables están permitidos (viajes en coche, bici, andando... no están permitidos y serán eliminados). Mira también:",
Expand Down
3 changes: 0 additions & 3 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,8 @@
"stationboard.events-propose": "Vous pouvez proposer un événement ici :",
"trip_creation.limitations.3": "Le voyage est rendu public. Ainsi, si vous vous inscrivez à un voyage, toutes les personnes qui peuvent voir votre statut peuvent également s'inscrire à ce voyage.",
"checkin.success.title": "Enregistrement réussi !",
"trip_creation.beta": "Veuillez noter que la création de trajets est actuellement en version bêta. Vous pouvez créer des trajets manuellement en saisissant les stations et les horaires. Il y a quelques limitations, qui sont énumérées ci-dessous.",
"action.error": "Cette action n'a pas pu être exécutée. Veuillez réessayer plus tard.",
"create-journey": "Créer un trajet",
"trip_creation.beta2": "Si vous rencontrez des problèmes, veuillez nous les signaler.",
"trip_creation.report_issue": "Rapporter un problème",
"trip_creation.form.origin": "Station de départ",
"trip_creation.title": "Créer un trajet manuellement",
"toggle-navigation": "Changer la navigation",
Expand Down
3 changes: 0 additions & 3 deletions lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,6 @@
"create-journey": "Reis toevoegen",
"trip_creation.limitations.1": "Je kunt alleen stations toevoegen die beschikbaar zijn in DB Navigator",
"trip_creation.limitations.2": "De routekaarten zijn overgenomen van de opgegeven stations",
"trip_creation.beta": "Let op: het toevoegen van reizen bevindt zich momenteel in de testfase. Je kunt eigen reizen toevoegen door stationsnamen en tijden in te vullen. Wel zijn er enkele beperkingen, die hieronder worden benoemd.",
"trip_creation.beta2": "Als je problemen ervaart, meld ze dan aan ons.",
"trip_creation.report_issue": "Probleem melden",
"trip_creation.form.origin": "Vertrekstation",
"trip_creation.form.destination": "Aankomststation",
"trip_creation.form.add_stopover": "Overstap toevoegen",
Expand Down
6 changes: 3 additions & 3 deletions resources/views/vuestationboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<div class="col-md-8 col-lg-7" id="station-board-new">
<Stationboard></Stationboard>

@if(auth()->user()->hasRole('open-beta') && !auth()->user()->can('disallow-manual-trips'))
@cannot('disallow-manual-trips')
<div class="text-center mt-4">
<hr/>
<p>
<span class="badge text-bg-info">Beta</span>
<i class="fa-solid fa-plus"></i>
{{__('missing-journey')}}
</p>
<a href="{{ route('trip.create') }}" class="btn btn-sm btn-outline-secondary">
<i class="fa-solid fa-plus"></i>
{{__('create-journey')}}
</a>
</div>
@endif
@endcannot

@if(isset($station) && auth()->user()?->hasRole('open-beta'))
@include('includes.station-infos')
Expand Down
17 changes: 1 addition & 16 deletions resources/vue/components/TripCreation/TripCreationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,26 +195,11 @@ export default {

<template>
<div>
<h1 class="fs-2">
<h1 class="fs-2 mb-2">
<i class="fa fa-plus" aria-hidden="true"></i>
{{ trans("trip_creation.title") }}
</h1>

<div class="alert alert-info">
<h2 class="fs-5">
<i class="fa fa-info-circle" aria-hidden="true"></i>
Beta
</h2>

{{ trans("trip_creation.beta") }}
<br/>
{{ trans("trip_creation.beta2") }}
<a href="https://github.com/Traewelling/traewelling/issues/new/choose" target="_blank"
class="float-end btn btn-sm btn-outline-danger">
{{ trans("trip_creation.report_issue") }}
</a>
</div>

<div class="card mb-3">
<form @submit.prevent="sendForm" class="card-body">
<div class="row g-3 mb-3">
Expand Down
1 change: 0 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
Route::middleware(['auth', 'privacy'])->group(function() {

Route::view('/trip/create', 'beta.trip-creation')
->middleware(['can:create-manual-trip'])
->name('trip.create');

Route::view('/report', 'report')
Expand Down

0 comments on commit c274a81

Please sign in to comment.