Kommentieren und Bewerten hinzugefügt. Einstellungsseite hinzufügt (macht noch nichts).
This commit is contained in:
@@ -1,16 +1,29 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
{{ __('Dashboard') }}
|
||||
<h2 class="font-semibold text-xl text-burnt leading-tight">
|
||||
{{ __('Einstellungen') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||
<div class="p-6 bg-white border-b border-gray-200">
|
||||
You're logged in!
|
||||
</div>
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 text-crayola">
|
||||
<!-- Session Status -->
|
||||
<x-auth-session-status class="mb-4 border border-burnt p-2 rounded-lg bg-coal mx-auto max-w-xs" :status="session('status')" />
|
||||
|
||||
<h2 class="font-semibold text-xl text-crayola leading-tight sm:rounded-lg bg-coal mb-6 p-4">
|
||||
Passwort
|
||||
</h2>
|
||||
|
||||
<div class="px-4 mb-8">
|
||||
Zum Ändern des Passworts, Abmelden und "Passwort vergessen" Funktion benutzen.
|
||||
</div>
|
||||
|
||||
<h2 class="font-semibold text-xl text-crayola leading-tight sm:rounded-lg bg-coal mb-6 p-4">
|
||||
Avatar
|
||||
</h2>
|
||||
|
||||
<div class="px-4">
|
||||
TBA
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -243,14 +243,18 @@
|
||||
Kommentare
|
||||
</h2>
|
||||
|
||||
<div class="px-2">
|
||||
<div class="px-2" x-data="{xnew: false, comments: {{$film->comments->count()}}}">
|
||||
@if (is_null(auth()->user()))
|
||||
<p>Melde Dich an, um diesen Film zu kommentieren.</p>
|
||||
@else
|
||||
<div>
|
||||
<button x-show="comments > 0" class="text-yelmax float-right" @@click="xnew = !xnew" x-text="xnew ? 'Abbrechen' : '+ Kommentar und Bewertung hinzufügen'"></button>
|
||||
<div x-show="xnew || comments < 1" x-transition>
|
||||
<img src="/avatar/{{ auth()->user()->getAvatar() }}" alt="User Avatar" class="rounded-lg w-16 float-left mr-2">
|
||||
<div class="">
|
||||
<form method="POST" action="/comment/new/{{ $film->id }}/">
|
||||
@csrf
|
||||
<h4 class="font-semibold">Neuer Kommentar</h4>
|
||||
@if($film->userMayEvaluate(auth()->user()->id))
|
||||
<div class="flex" x-data="{ stars: 0 }">
|
||||
<input type="hidden" name="vote" id="vote" x-bind:value="stars">
|
||||
<p @@click="stars = 0">Bewerten: </p>
|
||||
@@ -304,14 +308,17 @@
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
||||
</svg>
|
||||
</div>
|
||||
<span x-text="' (' + stars + ')'"></span>
|
||||
</div>
|
||||
<textarea class="block w-[calc(100%-4.5rem)] my-1 rounded-lg border-1 border-field bg-coal"></textarea>
|
||||
@endif
|
||||
<textarea name="body" id="body" class="block w-[calc(100%-4.5rem)] my-1 rounded-lg border-1 border-field bg-coal"></textarea>
|
||||
<x-button class="ml-[4.5rem]">Absenden</x-button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@foreach ($film->comments()->orderBy('created_at', 'DESC')->get() as $comment)
|
||||
<div class="clear-left my-2 min-h-[4rem]" x-data="{edit: false}">
|
||||
<div class="clear-left my-2 min-h-[5rem]" x-data="{edit: false}">
|
||||
<img src="/avatar/{{ $comment->author->getAvatar() }}" alt="{{ $comment->author->name }} Avatar" class="rounded-lg w-16 float-left mr-2">
|
||||
<h4 class="font-bold">
|
||||
{{ $comment->author->name }}
|
||||
@@ -336,6 +343,8 @@
|
||||
<button class="text-yelmax float-right" @@click="edit = !edit" x-text="edit ? 'Abbrechen' : 'Bearbeiten'"></button>
|
||||
<p x-show="!edit" x-transition>{{ $comment->body }}</p>
|
||||
<div x-show="edit" x-transition>
|
||||
<form method="post" action="/comment/edit/{{ $comment->id }}">
|
||||
@csrf
|
||||
@if($comment->evaluation > 0)
|
||||
<div class="flex" x-data="{ stars: {{ $comment->evaluation }} }">
|
||||
<input type="hidden" name="vote" id="vote" x-bind:value="stars">
|
||||
@@ -390,10 +399,12 @@
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
||||
</svg>
|
||||
</div>
|
||||
<span x-text="' (' + stars + ')'"></span>
|
||||
</div>
|
||||
@endif
|
||||
<textarea class="block w-[calc(100%-4.5rem)] my-1 rounded-lg border-1 border-field bg-coal">{{ $comment->body }}</textarea>
|
||||
<textarea name="body" id="body" class="block w-[calc(100%-4.5rem)] my-1 rounded-lg border-1 border-field bg-coal">{{ $comment->body }}</textarea>
|
||||
<x-button class="ml-[4.5rem]">Speichern</x-button>
|
||||
</form>
|
||||
</div>
|
||||
@else
|
||||
<p>{{ $comment->body }}</p>
|
||||
|
@@ -44,11 +44,13 @@
|
||||
<!-- Authentication -->
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
|
||||
<x-dropdown-link :href="route('dashboard')">
|
||||
{{ __('Einstellungen') }}
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
{{ __('Log Out') }}
|
||||
{{ __('Abmelden') }}
|
||||
</x-dropdown-link>
|
||||
</form>
|
||||
</x-slot>
|
||||
@@ -97,6 +99,9 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-3 space-y-1">
|
||||
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
{{ __('Einstellungen') }}
|
||||
</x-responsive-nav-link>
|
||||
<!-- Authentication -->
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
@@ -104,7 +109,7 @@
|
||||
<x-responsive-nav-link :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
{{ __('Log Out') }}
|
||||
{{ __('Abmelden') }}
|
||||
</x-responsive-nav-link>
|
||||
</form>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user