film.blade.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <x-app-layout>
  2. <x-slot name="header">
  3. <div class="float-right flex space-x-2">
  4. <a href="https://themoviedb.org/movie/{{ $tmdb->getId() }}"><img src="/img/tmdb.svg" class="max-h-7 w-8"></a>
  5. <a href="https://imdb.com/title/{{ $tmdb->getImdbId() }}"><img src="/img/IMDb_Logo_Square.svg" class="max-h-7"></a>
  6. </div>
  7. <h2 class="font-semibold text-xl text-burnt leading-tight">
  8. {{ $tmdb->getTitle() }}
  9. </h2>
  10. <div class="text-burnt italic mt-2 text-lg">{{ $tmdb->getTagline() }}</div>
  11. </x-slot>
  12. <div class="py-12">
  13. <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 text-crayola" x-data="{ tab: 'fact' }">
  14. <!-- Session Status -->
  15. <x-auth-session-status class="mb-4 border border-burnt p-2 rounded-lg bg-coal mx-auto max-w-xs" :status="session('status')" />
  16. @if (!is_null($film->seen))
  17. <div id="gesehen" class="border border-burnt p-2 rounded-lg flex mb-6 bg-coal mx-auto max-w-xs sm:ml-0">
  18. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  19. <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
  20. </svg>
  21. Gesehen am {{ \Carbon\Carbon::parse($film->seen)->format('d.m.Y') }}
  22. </div>
  23. @elseif (!is_null($film->rejected))
  24. <div id="gesehen" class="border border-burnt p-2 rounded-lg flex mb-6 bg-coal mx-auto max-w-xs sm:ml-0">
  25. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  26. <path stroke-linecap="round" stroke-linejoin="round" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636" />
  27. </svg>
  28. Abgelehnt am {{ \Carbon\Carbon::parse($film->rejected)->format('d.m.Y') }}
  29. </div>
  30. @elseif(!is_null(auth()->user()) && auth()->user()->isAdmin())
  31. <div class="flex content-start" x-data="{confseen: false, confdel: false, confnext: false}">
  32. @if(!$film->isNext())
  33. <div
  34. class="border p-2 rounded-lg flex mb-6 bg-coal max-w-xs mr-2 ml-2 sm:ml-0 cursor-pointer hover:text-coal border-burnt"
  35. :class="confnext ? 'bg-burnt text-coal hover:bg-crayola' : 'hover:bg-burnt'"
  36. @click="confnext ? location.href='/film/mark/{{ $film->id }}/next' : confnext = true"
  37. @click.outside="confnext = false"
  38. >
  39. <span x-text="confnext ? 'Als nächstes sehen?' : ''"></span>
  40. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mx-1" viewBox="0 0 640 512" stroke="currentColor">
  41. <path fill="currentColor" d="M592 0H48A48 48 0 0 0 0 48v320a48 48 0 0 0 48 48h240v32H112a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H352v-32h240a48 48 0 0 0 48-48V48a48 48 0 0 0-48-48zm-16 352H64V64h512z"/>
  42. </svg>
  43. </div>
  44. @endif
  45. <div
  46. class="border p-2 rounded-lg flex mb-6 bg-coal max-w-xs mr-2 ml-2 sm:ml-0 cursor-pointer hover:text-coal border-burnt"
  47. :class="confseen ? 'bg-burnt text-coal hover:bg-crayola' : 'hover:bg-burnt'"
  48. @click="confseen ? location.href='/film/mark/{{ $film->id }}/seen' : confseen = true"
  49. @click.outside="confseen = false"
  50. >
  51. <span x-text="confseen ? 'Wirklich gesehen?' : ''"></span>
  52. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  53. <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
  54. </svg>
  55. </div>
  56. <div
  57. class="border p-2 rounded-lg flex mb-6 bg-coal max-w-xs mr-2 cursor-pointer hover:text-coal border-burnt"
  58. :class="confdel ? 'bg-burnt text-coal hover:bg-crayola' : 'hover:bg-burnt'"
  59. @click="confdel ? location.href='/film/mark/{{ $film->id }}/deny' : confdel = true"
  60. @click.outside="confdel = false">
  61. <span x-text="confdel ? 'Wirklich ablehnen?' : ''"></span>
  62. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  63. <path stroke-linecap="round" stroke-linejoin="round" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636" />
  64. </svg>
  65. </div>
  66. </div>
  67. @endif
  68. <img src="{{ $image->getUrl($tmdb->getPosterImage(), 'w342') }}" alt="{{ $tmdb->getTitle() }} Poster" class="rounded-lg mx-auto mb-6 lg:float-right lg:mx-0 lg:ml-6 shadow-md shadow-burnt">
  69. <div class="sm:rounded-lg bg-coal flex mb-6 px-4">
  70. <a class="p-6 hover:text-yelmax cursor-pointer" x-bind:class="tab == 'fact' ? 'border-b-2 border-yelmax' : ''" @@click="tab = 'fact'">Allgemein</a>
  71. <a class="p-6 hover:text-yelmax cursor-pointer" x-bind:class="tab == 'cast' ? 'border-b-2 border-yelmax' : ''" @@click="tab = 'cast'">Schauspieler</a>
  72. <a class="p-6 hover:text-yelmax cursor-pointer" x-bind:class="tab == 'vids' ? 'border-b-2 border-yelmax' : ''" @@click="tab = 'vids'">Trailer</a>
  73. </div>
  74. <div id="#allgemein" class="px-4 grid grid-cols-2 gap-2" x-show="tab == 'fact'" x-transition>
  75. <div class="font-bold">Vorgeschlagen von</div>
  76. <div class="flex"><img src="/avatar/{{$film->suggester->getAvatar() }}" class="max-h-7 rounded-lg mr-2"> {{ $film->suggester->name }}</div>
  77. <div class="font-bold">Originaltitel</div>
  78. <div>„{{ $tmdb->getOriginalTitle() }}“ ({{ $tmdb->getOriginalLanguage() }})</div>
  79. <div class="font-bold">Laufzeit</div>
  80. <div>{{ $tmdb->getRuntime() }} Minuten</div>
  81. <div class="font-bold">Erschienen</div>
  82. <div>{{ $tmdb->getReleaseDate()->format('d.m.Y') }} -
  83. @foreach ($tmdb->getProductionCountries() as $co)
  84. <abbr title="{{$co->getName()}}">{{$co->getIso31661()}}</abbr>
  85. @endforeach
  86. </div>
  87. <div class="font-bold">Genre</div>
  88. <div class="flex flex-wrap space-x-1">
  89. @foreach ($tmdb->getGenres() as $genre)
  90. <div class="bg-coal rounded-lg p-1">{{ $genre->getName() }}</div>
  91. @endforeach
  92. </div>
  93. <div class="font-bold">TMDB Bewertung</div>
  94. <div class="">{{ $tmdb->getVoteAverage() }} von 10</div>
  95. @if($film->getBewertung() > 0)
  96. <div class="font-bold">Dumbo Bewertung</div>
  97. <div class="">{{ number_format($film->getBewertung(), 2, '.', '')}} von 10</div>
  98. @endif
  99. <div class="font-bold">Flatrate Stream</div>
  100. <div class="flex flex-wrap space-x-1">
  101. @forelse($tmdb->getWatchProviders()->filter(
  102. function($key, $value) {
  103. return $value->getIso31661() == 'DE' && count($value->getFlatrate()) > 0;
  104. }
  105. ) as $wp)
  106. @foreach($wp->getFlatrate() as $p)
  107. <img src="{{ $image->getUrl($p->getLogoPath(), 'w45') }}" title="{{ $p->getName() }}" class="rounded-lg max-h-8">
  108. @endforeach
  109. @empty
  110. <div class="italic">Keine</div>
  111. @endforelse
  112. </div>
  113. <div class="font-bold">Kaufen / Leihen</div>
  114. <div class="flex flex-wrap space-x-1">
  115. @foreach($tmdb->getWatchProviders()->filter(
  116. function($key, $value) {
  117. return $value->getIso31661() == 'DE' && (count($value->getRent()) > 0 || count($value->getBuy()) > 0);
  118. }
  119. ) as $wp)
  120. @foreach($wp->getRent() as $p)
  121. <img src="{{ $image->getUrl($p->getLogoPath(), 'w45') }}" title="{{ $p->getName() }}" class="rounded-lg max-h-8">
  122. @endforeach
  123. @endforeach
  124. </div>
  125. <div class="col-span-2 font-bold">Handlung</div>
  126. <div class="col-span-2 font-serif border-l-4 border-burnt pl-6">{{ $tmdb->getOverview() }}</div>
  127. </div>
  128. <div id="#schauspieler" class="px-4 grid grid-cols-4 gap-2" x-show="tab == 'cast'" x-transition>
  129. @foreach($tmdb->getCredits()->getCast() as $role)
  130. @if ($loop->index > 11)
  131. @break
  132. @endif
  133. <div class="pb-2">
  134. @if ($role->getProfileImage() != "")
  135. <img src="{{ $image->getUrl($role->getProfileImage() , "w185") }}" class="rounded-lg mb-1">
  136. @else
  137. <img src="/img/no-portrait.png" class="rounded-lg mb-1">
  138. @endif
  139. <div class="font-bold">{{ $role->getName() }}</div>
  140. <div class="text-burnt">{{ $role->getCharacter() }}</div>
  141. </div>
  142. @endforeach
  143. </div>
  144. <div id="trailer" class="px-4" x-show="tab == 'vids'" x-transition>
  145. @foreach ($tmdb->getVideos()->filter(
  146. function($key, $value) {
  147. return $value->getType() == "Trailer";
  148. }
  149. ) as $vid)
  150. <div class="font-bold">{{ $vid->getName() }}</div>
  151. <div class="relative overflow-hidden w-full sm:w-[calc(100%-384px)] after:block after:pt-[56.25%]">
  152. <iframe class="absolute top-0 left-0 w-full h-full" src="//www.youtube.com/embed/{{ $vid->getKey() }}" frameborder="0" allowfullscreen></iframe>
  153. </div>
  154. @endforeach
  155. </div>
  156. </div>
  157. </div>
  158. @php
  159. $votes = $film->votes()->count();
  160. if(!is_null(auth()->user()))
  161. $uvote = $film->votes()->where('user', auth()->id())->first();
  162. @endphp
  163. @if( $votes > 0 || (is_null($film->seen) && is_null($film->rejected)))
  164. <div class="py-6 " id="voting">
  165. <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 text-crayola ">
  166. <h2 class="font-semibold text-xl text-crayola leading-tight sm:rounded-lg bg-coal mb-6 p-4">
  167. Abstimmung
  168. </h2>
  169. @if($votes > 0)
  170. <div class="px-2">
  171. <p>
  172. Insgesamt haben <b>{{ $votes }}</b> Personen abgestimmt.
  173. <b>{{ $film->votes->where('vote', 1)->count() }}</b> waren <i>dafür</i>.
  174. @if(!is_null(auth()->user()))
  175. Du hast {!! is_null($uvote) ? '<i>nicht</i> ab' : ($uvote->vote == 0 ? '<i>nicht dafür</i> ' : '<i>dafür</i> ') !!}gestimmt.
  176. @endif
  177. </p>
  178. <div class="grid grid-cols-2 gap-2">
  179. <div class="text-burnt">Dafür</div>
  180. <div class="text-burnt">Nicht dafür</div>
  181. <div class="flex flex-col sm:flex-row flex-wrap">
  182. @foreach($film->votes->reject( function ($v) { return $v->vote == 0; }) as $vote)
  183. <div class="flex mb-1 mr-1 p-2 border border-burnt rounded-lg {{ $vote->voter->isActive() ? '' : 'italic border-coal text-field' }}"><img src="/avatar/{{$vote->voter->getAvatar() }}" class="max-h-6 rounded-lg mr-1"> {{ $vote->voter->name }}</div>
  184. @endforeach
  185. </div>
  186. <div class="flex flex-col sm:flex-row flex-wrap">
  187. @foreach($film->votes->reject( function ($v) { return $v->vote == 1; }) as $vote)
  188. <div class="flex mb-1 mr-1 p-2 border border-burnt rounded-lg {{ $vote->voter->isActive() ? '' : 'italic border-coal text-field' }}"><img src="/avatar/{{$vote->voter->getAvatar() }}" class="max-h-6 rounded-lg mr-1"> {{ $vote->voter->name }}</div>
  189. @endforeach
  190. </div>
  191. </div>
  192. </div>
  193. @endif
  194. @if(is_null($film->seen) && is_null($film->rejected) && !is_null(auth()->user()))
  195. <div class="py-6">
  196. <div class="flex mx-auto w-80">
  197. <a href="/film/vote/{{ $film->id }}/1" class="flex rounded-l-lg border-2 border-r-0 border-burnt p-4 w-40">
  198. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt" viewBox="0 0 20 20" fill="currentColor">
  199. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  200. <path fill-rule="evenodd" d="M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
  201. </svg>
  202. Dafür
  203. </a>
  204. <a href="/film/vote/{{ $film->id }}/0" class="flex rounded-r-lg border-2 border-l-1 border-burnt p-4 w-40">
  205. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt" viewBox="0 0 20 20" fill="currentColor">
  206. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  207. <path d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z" />
  208. </svg>
  209. Nicht dafür
  210. </a>
  211. </div>
  212. </div>
  213. @endif
  214. </div>
  215. </div>
  216. @endif
  217. <div class="py-6 ">
  218. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-crayola">
  219. <h2 class="font-semibold text-xl text-crayola leading-tight sm:rounded-lg bg-coal mb-6 p-4">
  220. Kommentare
  221. </h2>
  222. <div class="px-2">
  223. @if (is_null(auth()->user()))
  224. <p>Melde Dich an, um diesen Film zu kommentieren.</p>
  225. @else
  226. <div>
  227. <img src="/avatar/{{ auth()->user()->getAvatar() }}" alt="User Avatar" class="rounded-lg w-16 float-left mr-2">
  228. <div class="">
  229. <h4 class="font-semibold">Neuer Kommentar</h4>
  230. <div class="flex" x-data="{ stars: 0 }">
  231. <input type="hidden" name="vote" id="vote" x-bind:value="stars">
  232. <p @@click="stars = 0">Bewerten: </p>
  233. <div @@click="stars = 1">
  234. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 1 ? 'text-burnt' : ''">
  235. <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" />
  236. </svg>
  237. </div>
  238. <div @@click="stars = 2">
  239. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 2 ? 'text-burnt' : ''">
  240. <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" />
  241. </svg>
  242. </div>
  243. <div @@click="stars = 3">
  244. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 3 ? 'text-burnt' : ''">
  245. <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" />
  246. </svg>
  247. </div>
  248. <div @@click="stars = 4">
  249. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 4 ? 'text-burnt' : ''">
  250. <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" />
  251. </svg>
  252. </div>
  253. <div @@click="stars = 5">
  254. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 5 ? 'text-burnt' : ''">
  255. <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" />
  256. </svg>
  257. </div>
  258. <div @@click="stars = 6">
  259. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 6 ? 'text-burnt' : ''">
  260. <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" />
  261. </svg>
  262. </div>
  263. <div @@click="stars = 7">
  264. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 7 ? 'text-burnt' : ''">
  265. <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" />
  266. </svg>
  267. </div>
  268. <div @@click="stars = 8">
  269. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 8 ? 'text-burnt' : ''">
  270. <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" />
  271. </svg>
  272. </div>
  273. <div @@click="stars = 9">
  274. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 9 ? 'text-burnt' : ''">
  275. <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" />
  276. </svg>
  277. </div>
  278. <div @@click="stars = 10">
  279. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 10 ? 'text-burnt' : ''">
  280. <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" />
  281. </svg>
  282. </div>
  283. </div>
  284. <textarea class="block w-[calc(100%-4.5rem)] my-1 rounded-lg border-1 border-field bg-coal"></textarea>
  285. <x-button class="ml-[4.5rem]">Absenden</x-button>
  286. </div>
  287. </div>
  288. @endif
  289. @foreach ($film->comments()->orderBy('created_at', 'DESC')->get() as $comment)
  290. <div class="clear-left my-2 min-h-[4rem]" x-data="{edit: false}">
  291. <img src="/avatar/{{ $comment->author->getAvatar() }}" alt="{{ $comment->author->name }} Avatar" class="rounded-lg w-16 float-left mr-2">
  292. <h4 class="font-bold">
  293. {{ $comment->author->name }}
  294. <span class="text-sm font-light">
  295. {{ \Carbon\Carbon::parse($comment->created_at)->format('d.m.Y H:i') }}
  296. @if ($comment->updated_at != $comment->created_at)
  297. &mdash; Zuletzt bearbeitet: {{ \Carbon\Carbon::parse($comment->updated_at)->format('d.m.Y H:i') }}
  298. @endif
  299. </span>
  300. </h4>
  301. @if($comment->evaluation > 0)
  302. <div class="flex" title="{{ $comment->evaluation }}" x-show="!edit">
  303. @for ($i = 0; $i < $comment->evaluation; $i++)
  304. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt" viewBox="0 0 20 20" fill="currentColor">
  305. <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" />
  306. </svg>
  307. @endfor
  308. <span>({{$comment->evaluation}})</span>
  309. </div>
  310. @endif
  311. @if(!is_null(auth()->user()) && auth()->user()->id == $comment->author->id)
  312. <button class="text-yelmax float-right" @@click="edit = !edit" x-text="edit ? 'Abbrechen' : 'Bearbeiten'"></button>
  313. <p x-show="!edit" x-transition>{{ $comment->body }}</p>
  314. <div x-show="edit" x-transition>
  315. @if($comment->evaluation > 0)
  316. <div class="flex" x-data="{ stars: {{ $comment->evaluation }} }">
  317. <input type="hidden" name="vote" id="vote" x-bind:value="stars">
  318. <p @@click="stars = 0">Bewerten: </p>
  319. <div @@click="stars = 1">
  320. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 1 ? 'text-burnt' : ''">
  321. <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" />
  322. </svg>
  323. </div>
  324. <div @@click="stars = 2">
  325. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 2 ? 'text-burnt' : ''">
  326. <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" />
  327. </svg>
  328. </div>
  329. <div @@click="stars = 3">
  330. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 3 ? 'text-burnt' : ''">
  331. <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" />
  332. </svg>
  333. </div>
  334. <div @@click="stars = 4">
  335. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 4 ? 'text-burnt' : ''">
  336. <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" />
  337. </svg>
  338. </div>
  339. <div @@click="stars = 5">
  340. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 5 ? 'text-burnt' : ''">
  341. <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" />
  342. </svg>
  343. </div>
  344. <div @@click="stars = 6">
  345. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 6 ? 'text-burnt' : ''">
  346. <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" />
  347. </svg>
  348. </div>
  349. <div @@click="stars = 7">
  350. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 7 ? 'text-burnt' : ''">
  351. <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" />
  352. </svg>
  353. </div>
  354. <div @@click="stars = 8">
  355. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 8 ? 'text-burnt' : ''">
  356. <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" />
  357. </svg>
  358. </div>
  359. <div @@click="stars = 9">
  360. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 9 ? 'text-burnt' : ''">
  361. <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" />
  362. </svg>
  363. </div>
  364. <div @@click="stars = 10">
  365. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" x-bind:class="stars >= 10 ? 'text-burnt' : ''">
  366. <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" />
  367. </svg>
  368. </div>
  369. </div>
  370. @endif
  371. <textarea class="block w-[calc(100%-4.5rem)] my-1 rounded-lg border-1 border-field bg-coal">{{ $comment->body }}</textarea>
  372. <x-button class="ml-[4.5rem]">Speichern</x-button>
  373. </div>
  374. @else
  375. <p>{{ $comment->body }}</p>
  376. @endif
  377. </div>
  378. @endforeach
  379. </div>
  380. </div>
  381. </div>
  382. </x-app-layout>