archiv.blade.php 6.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <x-app-layout>
  2. <x-slot name="header">
  3. <h2 class="font-semibold text-xl text-burnt leading-tight">
  4. {{ __($title) }}
  5. </h2>
  6. @if($title == 'Gesehene Filme')
  7. <a href="/abgelehnt" class="text-yelmax">&rightarrow; Abgelehnte Filme</a>
  8. @else
  9. <a href="/gesehen" class="text-yelmax">&rightarrow; Gesehene Filme</a>
  10. @endif
  11. </x-slot>
  12. <div class="py-12">
  13. <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 text-crayola">
  14. <div class="grid grid-cols-3 gap-2 sm:gap-4 my-4 px-2">
  15. @foreach ($films as $film)
  16. <div>
  17. <a href="/film/{{$film->id}}" class="text-yelmax sm:float-left sm:mr-2">
  18. <img src="{{ $film->poster !== '' ? $ihelp->getUrl($film->poster, 'w185') : "/img/no-portrait.png" }}" title="{{ $film->name }}" class="rounded-lg shadow-md shadow-burnt">
  19. </a>
  20. <a href="/film/{{$film->id}}" class="text-yelmax text-xs leading-3 sm:text-lg">{{$film->name}}</a>
  21. <div class="flex sm:text-3xl">
  22. @php
  23. $stimme = is_null(auth()->user()) ? null : $film->votes()->where('user', auth()->user()->id)->first();
  24. @endphp
  25. @if (!is_null($stimme) && $stimme->vote == 0)
  26. <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">
  27. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  28. <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" />
  29. </svg> &middot;
  30. @elseif (!is_null($stimme) && $stimme->vote == 1)
  31. <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">
  32. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  33. <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" />
  34. </svg> &middot;
  35. @endif
  36. <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">
  37. <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" />
  38. <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" />
  39. </svg>
  40. {{ $film->comments()->count() }}
  41. @if($film->getBewertung() > 0)
  42. &middot;
  43. <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">
  44. <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" />
  45. </svg>
  46. {{ number_format($film->getBewertung(), 1, '.', '') }}
  47. @endif
  48. </div>
  49. @php
  50. $date = $film->seen !== null ? $film->seen : $film->rejected
  51. @endphp
  52. <div class="text-xs text-field sm:hidden"> {{ \Carbon\Carbon::parse($date)->format('d.m.Y') }} </div>
  53. <div class="text-field hidden sm:flex my-2">
  54. @if($film->seen !== null)
  55. <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">
  56. <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" />
  57. </svg>
  58. @else
  59. <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">
  60. <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" />
  61. </svg>
  62. @endif
  63. {{ \Carbon\Carbon::parse($date)->format('d.m.Y') }}
  64. </div>
  65. </div>
  66. @endforeach
  67. </div>
  68. {{ $films->links() }}
  69. <div class="flex">
  70. <svg title="Deine Stimme: Nicht dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-red-700" viewBox="0 0 20 20" fill="currentColor">
  71. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  72. <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" />
  73. </svg> Du bist nicht dafür &middot;
  74. <svg title="Deine Stimme: Dafür" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-900" viewBox="0 0 20 20" fill="currentColor">
  75. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  76. <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" />
  77. </svg> Du bist dafür &middot;
  78. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
  79. <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" />
  80. <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" />
  81. </svg> Anzahl Kommentare &middot;
  82. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt" viewBox="0 0 20 20" fill="currentColor">
  83. <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" />
  84. </svg> Bewertung
  85. </div>
  86. </div>
  87. </div>
  88. </x-app-layout>