From 5d472e324675cdde805d0770a51921e29b9591dd Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 21 Oct 2015 07:29:08 +0200 Subject: [PATCH] Kommentaranzeige. --- .idea/workspace.xml | 138 ++++++++++++++++++++------------------ app/models/Comment.php | 2 +- app/views/index.blade.php | 17 +++-- 3 files changed, 83 insertions(+), 74 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7a72d96..b6866a4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,15 +2,8 @@ - - - - + - - - - @@ -47,16 +40,18 @@ - + - - + + - + + + @@ -80,10 +75,10 @@ - + - + @@ -100,16 +95,6 @@ - - - - - - - - - - @@ -123,8 +108,8 @@ - - + + @@ -132,6 +117,16 @@ + + + + + + + + + + @@ -168,7 +163,6 @@ @@ -423,13 +418,20 @@ \ No newline at end of file diff --git a/app/models/Comment.php b/app/models/Comment.php index ff8eab8..6045768 100644 --- a/app/models/Comment.php +++ b/app/models/Comment.php @@ -12,6 +12,6 @@ class Comment extends Eloquent { } public function scopeNeueste($query) { - return $query->orderBy('updated_at', 'DESC')->where('bewertung', '<', 1)->take(5); + return $query->orderBy('updated_at', 'DESC')->take(7); } } \ No newline at end of file diff --git a/app/views/index.blade.php b/app/views/index.blade.php index b91fed4..89113d1 100644 --- a/app/views/index.blade.php +++ b/app/views/index.blade.php @@ -97,14 +97,19 @@
@foreach ($kommentare as $kommentar) - film) }}" class="list-group-item"> -
{{$kommentar->autor->name}} - in {{ $kommentar->objekt->name }} -
-

+ film) }}" class="list-group-item" style="padding-bottom: 2px"> +

+ {{$kommentar->autor->name}} + + in {{ $kommentar->objekt->name }} +
+

+ @if($kommentar->bewertung > 0) + Hat den Film mit {{$kommentar->bewertung}} bewertet.
+ @endif {{ $kommentar->text }}

- +
@endforeach