This repository has been archived on 2025-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dumbo/app/views/suggest.blade.php
2013-11-09 21:23:58 +01:00

65 lines
1.8 KiB
PHP

@extends('hello')
@section('content')
<div class="page-header"><h1>Vorschläge</h1></div>
{{ $filme->links() }}
<table class="table">
<tr>
<th>Titel</th>
<th colspan="2">Stimmen</th>
<th>Vorgeschlagen am</th>
<th>Vorgeschlagen von</th>
</tr>
@foreach($filme as $film)
<tr>
<td>
<?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;
?>
{{ HTML::link('film/' . $film->id, $film->name) }}
</td>
<td>
<?php
$vp = $film->upvotes;
$np = $film->downvotes;
?>
<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;{{ $vp }},
<span class="glyphicon glyphicon-thumbs-down"></span>&nbsp;{{ $np }}
</td>
<td>
@if(($vp - $np) > 0) <span class="label label-success">+{{$vp - $np}}</span>
@elseif(($vp - $np) < 0) <span class="label label-danger">{{$vp - $np}}</span>
@else <span class="label label-warning">{{$vp - $np}}</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-danger tooltip-enable" data-toggle="tooltip" title="Dagegen gestimmt."><span class="glyphicon glyphicon-thumbs-down"></span></span>
@endif
</td>
<td>{{ \Carbon\Carbon::parse($film->vorgeschlagen)->format('d.m.Y')}}</td>
<td>{{ Film::find($film->id)->besitzer->name }}</td>
</tr>
@endforeach
</table>
{{ $filme->links() }}
@stop
@section('title')
Vorschläge ~
@stop
@section('script')
<script type="text/javascript">
$(function() {
$('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
});
</script>
@stop