123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <x-app-layout>
- <x-slot name="header">
- <h2 class="font-semibold text-xl text-burnt leading-tight">
- {{ __('Filmvorschläge ' . $title) }}
- </h2>
- @if($title == 'nach Datum')
- <a href="/vorschlaege" class="text-yelmax">→ Vorschläge nach Beliebtheit</a>
- @else
- <a href="/vorschlaege/neu" class="text-yelmax">→ Vorschläge nach Datum</a>
- @endif
- </x-slot>
- <div class="py-12">
- <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 text-crayola">
- <div class="grid grid-cols-3 gap-2 sm:gap-4 my-4 px-2">
- @foreach ($films as $film)
- <div>
- <a href="/film/{{$film->id}}" class="text-yelmax sm:float-left sm:mr-2">
- <img src="{{ $film->poster !== '' ? $ihelp->getUrl($film->poster, 'w185') : "/img/no-portrait.png" }}" title="{{ $film->name }}" class="rounded-lg shadow-md shadow-burnt">
- </a>
- <a href="/film/{{$film->id}}" class="text-yelmax text-xs leading-3 sm:text-lg">{{$film->name}}</a>
- <div class="flex sm:text-3xl">
- @php
- $stimme = is_null(auth()->user()) ? null : $film->votes()->where('user', auth()->user()->id)->first();
- @endphp
- @if (!is_null($stimme) && $stimme->vote == 0)
- <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">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
- <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" />
- </svg> ·
- @elseif (!is_null($stimme) && $stimme->vote == 1)
- <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">
- <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
- <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" />
- </svg> ·
- @elseif(auth()->user() !== null)
- <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">
- <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" />
- </svg> ·
- @endif
- <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">
- <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
- <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" />
- </svg>
- {{ $film->activeVotes()->where('vote', 1)->sum('vote') }} <span class="text-field"> /{{ $film->activeVotes()->count()}}</span>
- </div>
- <div class="text-xs text-field sm:hidden"> {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }} · {{ $film->suggester->name }}</div>
- <div class="text-field hidden sm:flex my-2">
- <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">
- <path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
- </svg>
- {{ \Carbon\Carbon::parse($film->suggested)->format('d.m.Y') }}
- </div>
- <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>
- </div>
- @endforeach
- </div>
- {{ $films->links() }}
- <div class="flex">
- <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">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
- <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" />
- </svg> Du bist nicht dafür ·
- <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">
- <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
- <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" />
- </svg> Du bist dafür ·
- <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">
- <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" />
- </svg> Film wartet auf deine Stimme ·
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-burnt" viewBox="0 0 20 20" fill="currentColor">
- <path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
- <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" />
- </svg> Summe positiver/aller aktiven Stimmen
- </div>
- </div>
- </div>
- </x-app-layout>
|