neuester Stand

This commit is contained in:
2013-09-11 16:02:44 +02:00
parent 5cb555e869
commit 7d21be1a66
14 changed files with 707 additions and 29 deletions

View File

@@ -7,11 +7,11 @@
<div class="row">
<div class="col-md-3">
@if(!is_null($film->gesehen))
<div class="label label-success"><span class="glyphicon glyphicon-check"></span> Gesehen am {{ $film->gesehen }}</div>
@else
<div class="label label-danger"><span class="glyphicon glyphicon-unchecked"></span> Nicht gesehen</div>
@endif
@if(!is_null($film->gesehen))
<div class="label label-success"><span class="glyphicon glyphicon-check"></span> Gesehen am {{ \Carbon\Carbon::parse($film->gesehen)->format('d.m.Y') }}</div>
@else
<div class="label label-danger" <?php if(Auth::user()->admin) { echo "id='gesehen'"; } ?> style="cursor: pointer;"><span class="glyphicon glyphicon-unchecked"></span> Nicht gesehen</div>
@endif
</div>
<div class="col-md-9">
<ul class="nav nav-tabs">
@@ -37,7 +37,7 @@
<dd>{{ $tfilm['original_title'] }}</dd>
<dt>Erschienen</dt>
<dd>
{{ $tfilm['release_date']}} -
{{ \Carbon\Carbon::parse($tfilm['release_date'])->format('d.m.Y')}} -
@foreach($tfilm['production_countries'] as $pc)
<abbr title="{{$pc['name']}}">{{$pc['iso_3166_1']}}</abbr>
@endforeach
@@ -61,7 +61,7 @@
<p></p>
<dt>Inhalt</dt>
<dd>{{ $tfilm['overview'] }}</dd>
<dd>{{ nl2br($tfilm['overview']) }}</dd>
</dl>
</div>
<div class="tab-pane" id="cast">
@@ -90,41 +90,116 @@
<div class="clearfix"></div>
<hr>
@if($votes > 0 || is_null($film->gesehen))
@if($votes > 0)
<h2>Abstimmung</h2>
<p>Insgesamt haben <b>{{$votes}}</b> Personen abgestimmt. <b>{{$vposi}}</b> davon waren <i>dafür</i>.
<p>Insgesamt haben <b>{{$votes}}</b> Personen abgestimmt. <b>{{$vposi}}</b> davon waren <i>daf&uuml;r</i>. @if($uvote[0])
Du hast <i>{{ $uvote[1] ? "daf&uuml;r" : "dagegen"}}</i> gestimmt.
@endif
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: {{ $vposi / $votes * 100}}%">
<span class="sr-only">{{$vposi}} von {{$votes}} (dafür)</span>
<div class="progress-bar progress-bar-success tooltip-enable" style="width: {{ $vposi / $votes * 100}}%" data-toggle="tooltip" data-title="{{$pv}}">
<span class="sr-only">{{$vposi}} von {{$votes}} (daf&uuml;r)</span>
</div>
<div class="progress-bar progress-bar-danger" style="width: 10%">
<span class="sr-only">{{ $votes - $vposi}} von {{ $votes }} Complete (dagegen)</span>
<div class="progress-bar progress-bar-danger tooltip-enable" style="width: {{ ($votes - $vposi) / $votes * 100}}%" data-toggle="tooltip" data-title="{{$nv}}">
<span class="sr-only">{{ $votes - $vposi}} von {{ $votes }} (dagegen)</span>
</div>
</div>
@endif
@if(is_null($film->gesehen))
<div class="container" style="text-align: center">
<div class="btn-group">
<a class="btn btn-lg btn-success <?php echo $uvote[0] && $uvote[1] ? "disabled" : ""; ?>" href="{{ url('vote', array('yes', Auth::user()->id, $film->id)) }}">
<span class="glyphicon glyphicon-thumbs-up"></span> Daf&uuml;r
</a>
<a class="btn btn-lg btn-danger <?php echo $uvote[0] && !$uvote[1] ? "disabled" : ""; ?>" href="{{ url('vote', array('no', Auth::user()->id, $film->id)) }}">
<span class="glyphicon glyphicon-thumbs-down"></span> Dagegen
</a>
</div>
</div>
@endif
<hr>@endif
<h2>Kommentare</h2>
@if(is_null(Auth::user()))
<p>Melde Dich an, um diesen Film zu kommentieren.</p>
@else
<div class="media">
<div class="pull-left">
<img class="media-object" src="{{ "http://www.gravatar.com/avatar/" . md5( strtolower( trim( Auth::user()->email ) ) ) . "?s=40" }}">
</div>
<div class="media-body">
<h4 class="media-heading">Neuer Kommentar</h4>
{{Form::open(array('route' => 'comment'))}}
<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>
<div class="form-group"><button type="submit" class="btn btn-primary btn-xs">Absenden</button></div>
{{Form::close()}}
</div>
</div>
@endif
@foreach($comments as $comment)
<div class="media">
<a class="pull-left" href="#">
<div class="pull-left">
<img class="media-object" src="{{ "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $comment->autor->email ) ) ) . "?s=40" }}" alt="{{ $comment->autor->name }}">
</a>
<div class="media-body">
<h4 class="media-heading">{{ $comment->autor->name }} <small>{{$comment->updated_at}}</small></h4>
{{$comment->text}}
</div>
<div class="media-body" id="comment{{$comment->id}}">
<h5 class="media-heading">{{ $comment->autor->name }} <small>{{\Carbon\Carbon::parse($comment->created_at)->format('d.m.Y H:i')}}
@if($comment->updated_at != $comment->created_at)
&mdash; Zuletzt bearbeitet: {{\Carbon\Carbon::parse($comment->updated_at)->format('d.m.Y H:i')}}
@endif
</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">
<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'))}}
<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">
<button type="submit" class="btn btn-primary btn-xs">Absenden</button>
<button type="button" class="btn btn-xs" onclick="toggleComment('#comment{{$comment->id}}')">Abbrechen</button>
</div>
{{Form::close()}}
</div>
@else
<p>{{$comment->text}}</p>
@endif
</div>
</div>
@endforeach
@stop
@section('script')
<script type="text/javascript">
function toggleComment(id) {
$(id + 'edit').collapse('toggle');
$(id + 'comment').collapse('toggle');
}
$(function() {
$('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
});
$(function() {
$('#gesehen').popover({
html: true,
placement: "right",
trigger: "click",
title: "Als gesehen markieren",
content: "<div class='container'><a href='{{ url('mark-read/' . $film->id) }}' class='btn btn-success'>Film als gesehen markieren</a></div>"
});
});
</script>
@stop
@section('title')