This commit is contained in:
2015-10-21 15:19:35 +02:00
parent 4f8a382b51
commit 0b4efeb2ed
7 changed files with 622 additions and 412 deletions

View File

@@ -8,18 +8,33 @@
<table class="table">
<tr>
<th>Titel</th>
<th></th>
<th>Gesehen am</th>
<th>Vorgeschlagen von</th>
<th>Kommentare</th>
</tr>
</tr>
@foreach($filme as $film)
<?php
$stimme = 2;
if(!is_null(Auth::user()) && Vote::where('film', $film->id)->where('user', Auth::user()->id)->count())
$stimme = Vote::where('film', $film->id)->where('user', Auth::user()->id)->first()->stimme;
?>
<tr>
<td>{{ HTML::link('film/' . $film->id, $film->name) }}</td>
<td>
<span class="glyphicon glyphicon-comment"></span> {{ $film->comments()->count()}}
@if($film->getBewertung() > 0)
&nbsp;<span class="label label-{{$labels[round($film->getBewertung())]}}">{{$film->getBewertung()}}</span>
@endif
@if($stimme == 1)
&nbsp;<span class="label label-success tooltip-enable" data-toggle="tooltip" title="Daf&uuml;r gestimmt."><span class="glyphicon glyphicon-thumbs-up"></span></span>
@elseif($stimme == 0)
&nbsp;<span class="label label-default tooltip-enable" data-toggle="tooltip" title="Nicht daf&uuml;r gestimmt."><span class="glyphicon glyphicon-hand-right"></span></span>
@endif
</td>
<td>{{ \Carbon\Carbon::parse($film->gesehen)->format('d.m.Y')}}</td>
<td><span class="badge">
<img class="img-circle" src="{{ $film->besitzer->getAvatar() }}" width="20"> {{$film->besitzer->name}}
<img class="img-circle pull-left" src="{{ $film->besitzer->getAvatar() }}" width="20"> {{$film->besitzer->name}}
</span></td>
<td><span class="glyphicon glyphicon-comment"></span> {{ $film->comments()->count()}}</td>
</tr>
@endforeach
</table>