motorradig/motorradig/resources/views/tour/show.blade.php

144 lines
7.3 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 mt-2">
<div class="card mt-4">
<div class="card-header"><h5>{{ $tour->name }}</h5></div>
<div class="card-body">
<form style="background-color: #fff;" class="text-dark" method="post" action="" enctype="multipart/form-data">
@csrf
<div class="" style="display:flex;">
<!-- label class="ml-2 mt-4 col-form-label col-form-label-sm" style="width:150px; text-align:left;" for="name"><h4>Name:</h4></label> -->
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="name">Name:</label>
<input class="mr-1 form-control" type="text" id="name" name="name" value="{{ old('name') ?? $tour->name }}" readonly >
</div>
<div class="mt-1" style="display:flex;">
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="name">Start:</label>
<input class="mr-1 form-control" type="text" id="start" name="start" value="{{ old('start') ?? $tour->start }}" readonly >
</div>
<div class="mt-1" style="display:flex;">
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="creator">Veranstalter:</label>
<input class="mr-1 form-control" type="text" id="creator" name="creator" value="{{ old('creator') ?? $creator->name }}" readonly >
</div>
<div class="mt-1" style="display:flex;">
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="name">Anmeldeschluss:</label>
<input class="mr-1 form-control" type="text" id="anmeldeschluss" style="font-size:16px;" name="start" value="{{ old('anmeldeschluss') ?? $tour->deadline }}" readonly >
</div>
<div class="mt-1" style="display:flex;">
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="name">Max Teilnehmer:</label>
<input class="mr-1 form-control" type="text" id="max_participants" style="font-size:16px;" name="max_participants" value="{{ old('max_participants') ?? $tour->max_participants }}" required >
</div>
@if(App\Tour::has_participant($tour->id, Auth::user()->id))
<label>Du nimmst teil.</label>
@else
<label>Du nimmst nicht teil.</label>
@endif
@if(file_exists (public_path ('img/tour/'.$tour->id.'.jpg')))
<!--File exists -->
<a href="/img/tour/{{$tour->id}}_gross.jpg" data-lightbox="{{$tour->id}}_gross.jpg" data-title="{{ $tour->name }}">
<img src="/img/user/{{$tour->id}}.jpg" class="mt-3 ml-3" >
</a>
@else
<img src="/img/placeholder/tour128x100.jpg" class="mt-3 ml-3" >
@endif
<div class="mt-1" style="display:flex;">
<label class="ml-2" style="width:140px; text-align:left;font-size:18px;" for="is_cancelled">Storniert:</label>
<input class="mr-1 form-control" type="checkbox" id="is_cancelled" style="font-size:10px;width:20px;" name="is_cancelled"
@if($tour->is_cancelled)
checked
@endif
onclick="return false;"
>
</div>
<div class="mt-1">
<textarea class="col-12" name="beschreibung" rows="10" cols="50" readonly>{{ $tour->beschreibung }}
</textarea>
</div>
<!-- TODO: Only if owner or admin -->
<a href="/tour/{{$tour->id}}/edit"><div type="submit" class="btn btn-danger col-3 mb-2 float-left mr-2">Bearbeiten</div></a>
<a href="/tour" type="submit" class="btn btn-success col-3 mb-2 float-right mr-2">Ok</a>
@if(!App\Tour::has_participant($tour->id, Auth::user()->id))
<a href="/tour/{{$tour->id}}/join" type="submit" class="btn btn-danger col-3 mb-2 float-right mr-2">Teilnehmen</a>
@else
<a href="/tour/{{$tour->id}}/cancelBooking" type="submit" class="btn btn-danger col-3 mb-2 float-right mr-2">Absagen</a>
@endif
</form>
</div>
</div>
</div>
<div class="col-md-3 mt-2">
<div class="card mt-4">
<div class="card-header"><h5>Teilnehmer</h5></div>
<div class="card-body">
<ul>
@foreach($users as $user)
<li>{{ $user->name }} &nbsp;
@if(Auth::user()->role=="ADMIN")
<a href="/tour/{{$tour->id}}/cancelBookingAdmin/{{$user->id}}" class="text-primary">(X)</a>
@endif
</li>
@endforeach
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Button trigger modal demo
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Teilnehmer entfernen</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Sind sie sicher ??
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Abbrechen</button>
<button type="button" onclick="alert('LÖSCHEN'); return false;" data-dismiss="modal" class="btn btn-danger">Löschen</button>
</div>
</div>
</div>
</div>
-->
@endsection