Stats
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
<li>{{ HTML::link('vorgeschlagen', 'Vorgeschlagen (Datum)') }}</li>
|
||||
<li>{{ HTML::link('gesehen', 'Gesehen') }}</li>
|
||||
<li>{{ HTML::link('neu', 'Film vorschlagen')}}
|
||||
<li>{{ HTML::link('stats', 'Statistiken') }}</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
|
||||
@@ -72,7 +73,7 @@
|
||||
<footer id="footer">
|
||||
<div class="container">
|
||||
<hr>
|
||||
<small>© 2013 — Daniel Müllers</small>
|
||||
<small>© 2013-2016 — Daniel Müllers</small>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
@@ -8,18 +8,33 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Titel</th>
|
||||
<th></th>
|
||||
<th>Gesehen am</th>
|
||||
<th>Vorgeschlagen von</th>
|
||||
<th>Kommentare</th>
|
||||
</tr>
|
||||
</tr>
|
||||
@foreach($filme as $film)
|
||||
<?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;
|
||||
?>
|
||||
<tr>
|
||||
<td>{{ HTML::link('film/' . $film->id, $film->name) }}</td>
|
||||
<td>
|
||||
<span class="glyphicon glyphicon-comment"></span> {{ $film->comments()->count()}}
|
||||
@if($film->getBewertung() > 0)
|
||||
<span class="label label-{{$labels[round($film->getBewertung())]}}">{{$film->getBewertung()}}</span>
|
||||
@endif
|
||||
@if($stimme == 1)
|
||||
<span class="label label-success tooltip-enable" data-toggle="tooltip" title="Dafür gestimmt."><span class="glyphicon glyphicon-thumbs-up"></span></span>
|
||||
@elseif($stimme == 0)
|
||||
<span class="label label-default tooltip-enable" data-toggle="tooltip" title="Nicht dafür gestimmt."><span class="glyphicon glyphicon-hand-right"></span></span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ \Carbon\Carbon::parse($film->gesehen)->format('d.m.Y')}}</td>
|
||||
<td><span class="badge">
|
||||
<img class="img-circle" src="{{ $film->besitzer->getAvatar() }}" width="20"> {{$film->besitzer->name}}
|
||||
<img class="img-circle pull-left" src="{{ $film->besitzer->getAvatar() }}" width="20"> {{$film->besitzer->name}}
|
||||
</span></td>
|
||||
<td><span class="glyphicon glyphicon-comment"></span> {{ $film->comments()->count()}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
59
app/views/stats.blade.php
Normal file
59
app/views/stats.blade.php
Normal file
@@ -0,0 +1,59 @@
|
||||
@extends('hello')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header"><h1>Statistiken</h1></div>
|
||||
|
||||
<div class="row">
|
||||
@foreach($stats as $stat)
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">{{$stat["name"]}}</div>
|
||||
<div class="panel-body">
|
||||
<?php $top = $stat["vals"]->shift() ?>
|
||||
<div>
|
||||
@if($stat['type'] === "User")
|
||||
<div class="pull-left" style="margin-right:5px">
|
||||
<img class="img-circle media-object" src="{{$top->$stat['prop']->getAvatar()}}" width="47">
|
||||
</div>
|
||||
@endif
|
||||
@if($stat['type'] === "Film")
|
||||
<div class="pull-left" style="margin-right:5px">
|
||||
<img class="media-object" src="{{$top->$stat['prop']->getPoster()}}" height="47">
|
||||
</div>
|
||||
@endif
|
||||
<div class="media-body">
|
||||
<h4 class="media-heading">{{is_object($top->$stat['prop']) ? $top->$stat['prop']->name : dd($top)}}</h4>
|
||||
<b>{{$top->count}}</b> {{$top->count ==1 ? $stat['entr'][0] : $stat['entr'][1] }}
|
||||
</div>
|
||||
</div>
|
||||
@foreach($stat['vals'] as $top)
|
||||
<div style="margin-top: 10px;">
|
||||
@if($stat['type'] === "User")
|
||||
<div class="pull-left" style="margin-right:5px">
|
||||
<img class="img-circle media-object" src="{{$top->$stat['prop']->getAvatar()}}" width="20">
|
||||
</div>
|
||||
@endif
|
||||
@if($stat['type'] === "Film")
|
||||
<div class="pull-left" style="margin-right:5px">
|
||||
<img class="media-object" src="{{$top->$stat['prop']->getPoster()}}" height="20">
|
||||
</div>
|
||||
@endif
|
||||
<div class="media-body">
|
||||
<h5 class="media-heading">{{$top->$stat['prop']->name}} — <b>{{$top->count}}</b> {{$top->count ==1 ? $stat['entr'][0] : $stat['entr'][1] }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('title')
|
||||
Statistiken ~
|
||||
@stop
|
||||
|
||||
@section('script')
|
||||
|
||||
@stop
|
Reference in New Issue
Block a user