@extends('hello');

@section('content')
<div class="row">
	<div class="col-md-6">
		<div class="panel panel-default">
			<div class="panel-heading">Meistgew&uuml;nschter Film</div>
			<div class="panel-body">
				<img src="{{$image}}" class="pull-left thumbnail" style="max-height: 100px; margin-right: 15px;">
				<h4>{{$topfilm->name}}</h4>
				<p><span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;{{$topfilm->upvotes}} 
					<span class="glyphicon glyphicon-thumbs-down"></span>&nbsp;{{$topfilm->downvotes}}</p>
			</div>

			<div class="list-group">
				{{ link_to_route('film', "Filmdetails", array($topfilm->id), array('class' => 'list-group-item'))}}
			</div>
		</div>
	</div>

	<div class="col-md-6">
		<div class="panel-group" id="accordion">
			@foreach ($news as $new)
				<div class="panel panel-warning">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#news{{$new->id}}">{{$new->headline}}</a>
							<small>{{$new->ersteller->name}} - {{\Carbon\Carbon::parse($new->updated_at)->format('d.m.Y')}}</small>
						</h5>
					</div>
					<div id="news{{$new->id}}" class="panel-collapse collapse">
						<div class="panel-body">{{nl2br(htmlentities($new->body))}}</div>
					</div>
				</div>					
			@endforeach	
		</div>
	</div>
</div>

<div class="row">
	<div class="col-md-6">
		<div class="panel panel-success">
			<div class="panel-heading">Neue Vorschl&auml;ge</div>
			<div class="panel-body"><p>Die neuesten Vorschläge für den nächsten Filmabend. Klicke einen der Vorschläge an, um Filmdetails zu sehen und darüber abzustimmen.</p></div>

			<div class="list-group">
				@foreach ($vorgeschlagen as $film)
					{{ link_to_route('film', $film->name, array($film->id), array('class' => 'list-group-item'))}}
				@endforeach	
			</div>
		</div>
	</div>
	<div class="col-md-6">
		<div class="panel panel-primary">
			<div class="panel-heading">Gesehene Filme</div>
			<div class="panel-body"><p>Die Filme, die wir kürzlich gesehen haben. Klicke einen der Titel an, um Kommentare und Filmdetails sowie ein etwaiges Abstimmungsergebnis zu sehen.</p></div>

			<div class="list-group">
				@foreach ($gesehen as $film)
					{{ link_to_route('film', $film->name, array($film->id), array('class' => 'list-group-item'))}}
				@endforeach		
			</div>
		</div>
	</div>
</div>
@stop