main.blade.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <x-app-layout>
  2. <x-slot name="header">
  3. <h2 class="font-semibold text-xl text-burnt leading-tight">
  4. {{ __('Dumbo Filmabendplaner') }}
  5. </h2>
  6. </x-slot>
  7. <div class="py-12">
  8. <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 container">
  9. <div class="">
  10. <a href="/film/{{$feature->id}}">
  11. <div class="p-6 sm:rounded-lg h-96 relative" style="
  12. background: linear-gradient(to bottom right, #000000, #000000be, #00000000),
  13. url('{{ $image->getUrl($ftmdb->getBackdropImage(), 'original') }}') center center/cover;">
  14. <img src="{{ $image->getUrl($ftmdb->getPosterImage(), 'w342') }}" alt="{{ $ftmdb->getTitle() }} Poster" class="rounded-lg mx-auto mb-6 sm:float-right sm:mx-0 sm:ml-6 shadow-md shadow-burnt h-80 hidden sm:block">
  15. <span class="text-crayola">{{ $ftype === 'next' ? 'Nächster Film' : 'Zuletzt gesehen' }}</span>
  16. <h3 class="text-burnt drop-shadow-[0_4px_3px_#684f43] text-4xl">{{ $feature->name }}</h3>
  17. <div class="text-crayola mt-4">
  18. {{$ftmdb->getTagline()}}
  19. </div>
  20. <div class="flex flex-wrap space-x-1 text-crayola mt-4">
  21. @foreach ($ftmdb->getGenres() as $genre)
  22. <div class="bg-coal rounded-lg p-1">{{ $genre->getName() }}</div>
  23. @endforeach
  24. </div>
  25. <div class="text-crayola max-w-md text-justify mt-4 hidden md:block">
  26. {{ substr($ftmdb->getOverview(), 0, 200) }}...
  27. </div>
  28. <div class="text-yelmax">{{ $ftype == 'next' ? 'Klick für Details' : 'Jetzt bewerten!'}}</div>
  29. <div class="absolute bottom-2 flex text-crayola">
  30. <img src="/avatar/{{$feature->suggester->getAvatar() }}" class="max-h-7 rounded-lg mr-2"> {{ $feature->suggester->name }}
  31. @if ($ftype === 'last')
  32. &middot; Gesehen am {{ \Carbon\Carbon::parse($feature->seen)->format('d.m.Y') }}
  33. @endif
  34. </div>
  35. </div>
  36. </a>
  37. </div>
  38. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-6">
  39. <div class="">
  40. <div class="sm:rounded-lg bg-coal text-crayola text-lg p-4">
  41. Beliebte Vorschläge
  42. <a class="text-sm text-yelmax" href="/vorschlaege">Mehr</a>
  43. </div>
  44. <div class="grid grid-cols-1 gap-2 mt-2 " x-data="{active: 1}">
  45. @foreach ($popular as $film)
  46. <a href="/film/{{ $film->id }}" :class="active == {{ $loop->iteration }} ? 'block' : 'hidden'" x-transition>
  47. <div class="rounded-lg p-2 h-40 bg-black ">
  48. <img src="{{ $image->getUrl($film->poster, 'w92') }}" alt="{{ $film->name }}" class="rounded-lg float-left mr-2 shadow-md shadow-burnt">
  49. <div class="text-burnt text-xl">{{ $film->name }}</div>
  50. <div class="text-crayola flex text-xl">
  51. @php
  52. $stimme = is_null(auth()->user()) ? null : $film->votes()->where('user', auth()->user()->id)->first();
  53. @endphp
  54. @if (!is_null($stimme) && $stimme->vote == 0)
  55. <svg title="Deine Stimme: Nicht dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-red-700 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  56. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  57. <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" />
  58. </svg> &middot;
  59. @elseif (!is_null($stimme) && $stimme->vote == 1)
  60. <svg title="Deine Stimme: Dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-900 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  61. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  62. <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" />
  63. </svg> &middot;
  64. @elseif(auth()->user() !== null)
  65. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-field sm:h-8 sm:w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  66. <path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
  67. </svg> &middot;
  68. @endif
  69. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  70. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  71. <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-2V5zm3 4a1 1 0 000 2h.01a1 1 0 100-2H7zm3 0a1 1 0 000 2h3a1 1 0 100-2h-3zm-3 4a1 1 0 100 2h.01a1 1 0 100-2H7zm3 0a1 1 0 100 2h3a1 1 0 100-2h-3z" clip-rule="evenodd" />
  72. </svg>
  73. {{ $film->activeVotes()->where('vote', 1)->count() }}<span class="text-field">/{{ $film->activeVotes()->count() }}</span>
  74. </div>
  75. <div class="text-xs text-field sm:hidden"> {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }} &middot; {{ $film->suggester->name }}</div>
  76. <div class="text-field hidden sm:flex my-2">
  77. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  78. <path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
  79. </svg>
  80. {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }}
  81. </div>
  82. <div class="text-field hidden sm:flex my-2"><img src="/avatar/{{$film->suggester->getAvatar() }}" class="max-h-7 rounded-lg mr-2"> {{ $film->suggester->name }}</div>
  83. </div></a>
  84. @endforeach
  85. <div class="flex justify-center p-2">
  86. @foreach ($popular as $film)
  87. <img @click="active = {{$loop->iteration}}" :class="active == {{$loop->iteration}} && 'shadow-md shadow-burnt'" src="{{ $image->getUrl($film->poster, 'w92') }}" alt="{{ $film->name }}" class="rounded-lg float-left mr-2 cursor-pointer h-20">
  88. @endforeach
  89. </div>
  90. </div>
  91. </div>
  92. <div class="">
  93. <div class="sm:rounded-lg bg-coal text-crayola text-lg p-4">Neue Vorschläge <a class="text-sm text-yelmax" href="/vorschlaege/neu">Mehr</a></div>
  94. <div class="grid grid-cols-1 gap-2 mt-2 " x-data="{active: 1}">
  95. @foreach ($new as $film)
  96. <a href="/film/{{ $film->id }}" :class="active == {{ $loop->iteration }} ? 'block' : 'hidden'" x-transition>
  97. <div class="rounded-lg p-2 h-40 bg-black ">
  98. <img src="{{ $image->getUrl($film->poster, 'w92') }}" alt="{{ $film->name }}" class="rounded-lg float-left mr-2 shadow-md shadow-burnt">
  99. <div class="text-burnt text-xl">{{ $film->name }}</div>
  100. <div class="text-crayola flex text-xl">
  101. @php
  102. $stimme = is_null(auth()->user()) ? null : $film->votes()->where('user', auth()->user()->id)->first();
  103. @endphp
  104. @if (!is_null($stimme) && $stimme->vote == 0)
  105. <svg title="Deine Stimme: Nicht dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-red-700 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  106. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  107. <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" />
  108. </svg> &middot;
  109. @elseif (!is_null($stimme) && $stimme->vote == 1)
  110. <svg title="Deine Stimme: Dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-900 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  111. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  112. <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" />
  113. </svg> &middot;
  114. @elseif(auth()->user() !== null)
  115. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-field sm:h-8 sm:w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  116. <path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
  117. </svg> &middot;
  118. @endif
  119. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  120. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  121. <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-2V5zm3 4a1 1 0 000 2h.01a1 1 0 100-2H7zm3 0a1 1 0 000 2h3a1 1 0 100-2h-3zm-3 4a1 1 0 100 2h.01a1 1 0 100-2H7zm3 0a1 1 0 100 2h3a1 1 0 100-2h-3z" clip-rule="evenodd" />
  122. </svg>
  123. {{ $film->activeVotes()->where('vote', 1)->count() }}<span class="text-field">/{{ $film->activeVotes()->count() }}</span>
  124. </div>
  125. <div class="text-field flex my-2">
  126. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  127. <path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
  128. </svg>
  129. {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }}
  130. </div>
  131. <div class="text-field flex my-2"><img src="/avatar/{{$film->suggester->getAvatar() }}" class="max-h-7 rounded-lg mr-2"> {{ $film->suggester->name }}</div>
  132. </div></a>
  133. @endforeach
  134. <div class="flex justify-center p-2">
  135. @foreach ($new as $film)
  136. <img @click="active = {{$loop->iteration}}" :class="active == {{$loop->iteration}} && 'shadow-md shadow-burnt'" src="{{ $image->getUrl($film->poster, 'w92') }}" alt="{{ $film->name }}" class="rounded-lg float-left mr-2 cursor-pointer h-20">
  137. @endforeach
  138. </div>
  139. </div>
  140. </div>
  141. <div class="">
  142. <div class="sm:rounded-lg bg-coal text-crayola text-lg p-4">Gesehene Filme <a class="text-sm text-yelmax" href="/gesehen">Archiv</a> &middot; <a class="text-sm text-yelmax" href="/abgelehnt">Abgelehnt</a></div>
  143. <div class="grid grid-cols-1 gap-2 mt-2 " x-data="{active: 1}">
  144. @foreach ($seen as $film)
  145. <a href="/film/{{ $film->id }}" :class="active == {{ $loop->iteration }} ? 'block' : 'hidden'" x-transition>
  146. <div class="rounded-lg p-2 h-40 bg-black ">
  147. <img src="{{ $image->getUrl($film->poster, 'w92') }}" alt="{{ $film->name }}" class="rounded-lg float-left mr-2 shadow-md shadow-burnt">
  148. <div class="text-burnt text-xl">{{ $film->name }}</div>
  149. <div class="flex sm:text-3xl text-crayola">
  150. @php
  151. $stimme = is_null(auth()->user()) ? null : $film->votes()->where('user', auth()->user()->id)->first();
  152. @endphp
  153. @if (!is_null($stimme) && $stimme->vote == 0)
  154. <svg title="Deine Stimme: Nicht dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-red-700 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  155. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  156. <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" />
  157. </svg> &middot;
  158. @elseif (!is_null($stimme) && $stimme->vote == 1)
  159. <svg title="Deine Stimme: Dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-900 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  160. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  161. <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" />
  162. </svg> &middot;
  163. @endif
  164. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  165. <path d="M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z" />
  166. <path d="M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z" />
  167. </svg>
  168. {{ $film->comments()->count() }}
  169. @if($film->getBewertung() > 0)
  170. &middot;
  171. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt sm:h-8 sm:w-8" viewBox="0 0 20 20" fill="currentColor">
  172. <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" />
  173. </svg>
  174. {{ number_format($film->getBewertung(), 1, '.', '') }}
  175. @endif
  176. </div>
  177. <div class="text-field flex my-2">
  178. <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  179. <path stroke-linecap="round" stroke-linejoin="round" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" />
  180. </svg>
  181. {{ \Carbon\Carbon::parse($film->seen)->format('d.m.Y') }}
  182. </div>
  183. <div class="text-field flex my-2"><img src="/avatar/{{$film->suggester->getAvatar() }}" class="max-h-7 rounded-lg mr-2"> {{ $film->suggester->name }}</div>
  184. </div></a>
  185. @endforeach
  186. <div class="flex justify-center p-2">
  187. @foreach ($seen as $film)
  188. <img @click="active = {{$loop->iteration}}" :class="active == {{$loop->iteration}} && 'shadow-md shadow-burnt'" src="{{ $image->getUrl($film->poster, 'w92') }}" alt="{{ $film->name }}" class="rounded-lg float-left mr-2 cursor-pointer h-20">
  189. @endforeach
  190. </div>
  191. </div>
  192. </div>
  193. <div class="">
  194. <div class="sm:rounded-lg bg-coal text-crayola text-lg p-4">News</div>
  195. @foreach($news as $n)
  196. <div class="mt-2" x-data="{active: {{ $loop->first ? 'true': 'false' }}}">
  197. <div @click="active = !active" x-transition class="text-yelmax bg-field sm:rounded-lg p-2 cursor-pointer">
  198. {{$n->headline}} <span class="text-crayola text-xs">{{{ $n->created_at === $n->updated_at ? \Carbon\Carbon::parse($n->created_at)->format('d.m.Y H:i') : \Carbon\Carbon::parse($n->updated_at)->format('d.m.Y H:i') . ' (bearbeitet)' }}}</span>
  199. <div class="float-right flex text-crayola"><img src="/avatar/{{$n->author->getAvatar() }}" class="max-h-7 rounded-lg mr-2"> {{ $n->author->name }}</div>
  200. </div>
  201. <div class="p-2 text-crayola text-justify" x-show="active" x-transition>{!! nl2br($n->body) !!}</div>
  202. </div>
  203. @endforeach
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. </x-app-layout>