+Bewertungen, Meistgewünschter Film, Sortierung nach Votes

This commit is contained in:
2013-09-27 04:06:12 +02:00
parent 521ecc46c1
commit fb74d68046
11 changed files with 264 additions and 20 deletions

View File

@@ -17,20 +17,20 @@
<td>{{ HTML::link('film/' . $film->id, $film->name) }}</td>
<td>
<?php
$vp = $film->votes()->where('stimme', true)->count();
$np = $film->votes()->where('stimme', false)->count();
$vp = $film->upvotes;
$np = $film->downvotes;
?>
<div class="progress tooltip-enable" data-toggle="tooltip" title="{{ $vp }}/{{ $np }}">
<div class="progress-bar progress-bar-success" style="width: <?php if(($vp + $np) > 0) echo ($vp / ($vp + $np) * 100); else echo 0; ?>%">
<span class="sr-only">{{$vp}} von {{$vp + $np}} (daf&uuml;r)</span>
</div>
<div class="progress-bar progress-bar-danger" style="width: <?php if(($vp + $np) > 0) echo ($vp / ($vp + $np) * 100); else echo 0; ?>%">
<div class="progress-bar progress-bar-danger" style="width: <?php if(($vp + $np) > 0) echo ($np / ($vp + $np) * 100); else echo 0; ?>%">
<span class="sr-only">{{$np}} von {{$vp + $np}} (dagegen)</span>
</div>
</div>
</td>
<td>{{ \Carbon\Carbon::parse($film->vorgeschlagen)->format('d.m.Y')}}</td>
<td>{{ $film->besitzer->name }}</td>
<td>{{ Film::find($film->id)->besitzer->name }}</td>
</tr>
@endforeach
</table>