+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 ha cambiato i file con 264 aggiunte e 20 eliminazioni

Vedi File

@@ -52,8 +52,17 @@
@endforeach
</dd>
<dt>Bewertung</dt>
<dd>{{ $tfilm['vote_average']}} von 10
</dd>
<dd>{{ $tfilm['vote_average']}} von 10 </dd>
@if(!is_null($film->gesehen) && Comment::where('film', $film->id)->where('bewertung', '>', 0)->count() > 0)
<dt>Eigene Bewertung</dt>
<dd>
<?php
$count = Comment::where('film', $film->id)->where('bewertung', '>', 0)->count();
$avg = Comment::where('film', $film->id)->where('bewertung', '>', 0)->sum('bewertung') / $count;
?>
<div class="label label-{{$labels[round($avg)]}}">{{$avg}}</div>
</dd>
@endif
@for($i = 0; $i < 3 && $i < count($cast['crew']); $i++)
<dt>{{$cast['crew'][$i]['job']}}</dt>
<dd>{{$cast['crew'][$i]['name']}}</dd>
@@ -132,6 +141,17 @@
<div class="media-body">
<h4 class="media-heading">Neuer Kommentar</h4>
{{Form::open(array('route' => 'comment'))}}
@if(!is_null(Auth::user()) && !is_null($film->gesehen) && Comment::where('user', Auth::user()->id)->where('film', $film->id)->where('bewertung', '>', 0)->count() < 1 )
<p><div class="pull-left" style="margin-right: 5px">Bewerten:</div>
<div class="btn-group btn-group-xs" data-toggle="buttons">
@for($i = 1; $i < 11; $i++)
<label class="btn btn-{{ $labels[$i] }}">
<input type="radio" name="rate" id="rate{{ $i }}" value="{{ $i }}"> {{ $i }}
</label>
@endfor
</div>
</p>
@endif
<input type="hidden" name="user" value="{{Auth::user()->id}}">
<input type="hidden" name="film" value="{{$film->id}}">
<div class="form-group"><textarea class="form-control" rows="1" name="text"></textarea></div>
@@ -155,11 +175,25 @@
</small></h5>
@if(!is_null(Auth::user()) && Auth::user()->id === $comment->autor->id)
<div class="collapse in" data-parent="#comment{{$comment->id}}" id="comment{{$comment->id}}comment">
@if($comment->bewertung > 0)
<div class="pull-left label label-{{ $labels[$comment->bewertung] }}" style="margin-right: 5px;">{{$comment->bewertung}}</div>
@endif
<p>{{$comment->text}}</p>
<button type="button" class="btn btn-xs" onclick="toggleComment('#comment{{$comment->id}}')">Bearbeiten</button>
</div>
<div class="collapse" id="comment{{$comment->id}}edit">
{{Form::open(array('route' => 'modcomment'))}}
@if($comment->bewertung > 0)
<p><div class="pull-left" style="margin-right: 5px">Bewerten:</div>
<div class="btn-group btn-group-xs" data-toggle="buttons">
@for($i = 1; $i < 11; $i++)
<label class="btn btn-{{ $labels[$i] }}">
<input type="radio" name="rate" id="rate{{ $i }}" value="{{ $i }}"> {{ $i }}
</label>
@endfor
</div>
</p>
@endif
<input type="hidden" name="id" value="{{$comment->id}}">
<div class="form-group"><textarea class="form-control" rows="1" name="text">{{$comment->text}}</textarea></div>
<div class="form-group">
@@ -169,6 +203,9 @@
{{Form::close()}}
</div>
@else
@if($comment->bewertung > 0)
<div class="pull-left label label-{{ $labels[$comment->bewertung] }}" style="margin-right: 5px;">{{$comment->bewertung}}</div>
@endif
<p>{{$comment->text}}</p>
@endif
</div>