vorschlaege.blade.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <x-app-layout>
  2. <x-slot name="header">
  3. <h2 class="font-semibold text-xl text-burnt leading-tight">
  4. {{ __('Filmvorschläge ' . $title) }}
  5. </h2>
  6. @if($title == 'nach Datum')
  7. <a href="/vorschlaege" class="text-yelmax">&rightarrow; Vorschläge nach Beliebtheit</a>
  8. @else
  9. <a href="/vorschlaege/neu" class="text-yelmax">&rightarrow; Vorschläge nach Datum</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. @elseif(auth()->user() !== null)
  36. <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">
  37. <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" />
  38. </svg> &middot;
  39. @endif
  40. <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">
  41. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  42. <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" />
  43. </svg>
  44. {{ $film->activeVotes()->where('vote', 1)->sum('vote') }} <span class="text-field"> /{{ $film->activeVotes()->count()}}</span>
  45. </div>
  46. <div class="text-xs text-field sm:hidden"> {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }} &middot; {{ $film->suggester->name }}</div>
  47. <div class="text-field hidden sm:flex my-2">
  48. <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">
  49. <path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
  50. </svg>
  51. {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }}
  52. </div>
  53. <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>
  54. </div>
  55. @endforeach
  56. </div>
  57. {{ $films->links() }}
  58. <div class="flex">
  59. <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">
  60. <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
  61. <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" />
  62. </svg> Du bist nicht dafür &middot;
  63. <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">
  64. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  65. <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" />
  66. </svg> Du bist dafür &middot;
  67. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-field" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
  68. <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" />
  69. </svg> Film wartet auf deine Stimme &middot;
  70. <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt" viewBox="0 0 20 20" fill="currentColor">
  71. <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
  72. <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" />
  73. </svg> Summe positiver/aller aktiven Stimmen
  74. </div>
  75. </div>
  76. </div>
  77. </x-app-layout>