Quellcode durchsuchen

Kommentaranzeige.

Daniel vor 9 Jahren
Ursprung
Commit
5d472e3246
3 geänderte Dateien mit 83 neuen und 74 gelöschten Zeilen
  1. 71 67
      .idea/workspace.xml
  2. 1 1
      app/models/Comment.php
  3. 11 6
      app/views/index.blade.php

+ 71 - 67
.idea/workspace.xml

@@ -2,15 +2,8 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="80f2fc29-4939-4e5d-80a5-cd8ec589ca07" name="Default" comment="">
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/Film.php" afterPath="$PROJECT_DIR$/app/models/Film.php" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/css/bootstrap-superhero.min.css" afterPath="$PROJECT_DIR$/public/css/bootstrap-superhero.min.css" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/film.blade.php" afterPath="$PROJECT_DIR$/app/views/film.blade.php" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/hello.blade.php" afterPath="$PROJECT_DIR$/app/views/hello.blade.php" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/Comment.php" afterPath="$PROJECT_DIR$/app/models/Comment.php" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/index.blade.php" afterPath="$PROJECT_DIR$/app/views/index.blade.php" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/routes.php" afterPath="$PROJECT_DIR$/app/routes.php" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/seen.blade.php" afterPath="$PROJECT_DIR$/app/views/seen.blade.php" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/suggest.blade.php" afterPath="$PROJECT_DIR$/app/views/suggest.blade.php" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/users.blade.php" afterPath="$PROJECT_DIR$/app/views/users.blade.php" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
     </list>
     <ignored path="dumbo.iws" />
@@ -47,16 +40,18 @@
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="index.blade.php" pinned="false" current-in-tab="false">
+      <file leaf-file-name="index.blade.php" pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/app/views/index.blade.php">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-6.377049">
-              <caret line="54" column="38" selection-start-line="53" selection-start-column="120" selection-end-line="55" selection-end-column="27" />
+            <state vertical-scroll-proportion="0.28688523">
+              <caret line="105" column="85" selection-start-line="105" selection-start-column="85" selection-end-line="105" selection-end-column="85" />
               <folding>
                 <element signature="e#314#360#0#HTML" expanded="true" />
                 <element signature="e#1728#1774#0#HTML" expanded="true" />
                 <element signature="e#3948#3994#0#HTML" expanded="true" />
-                <element signature="e#5206#5252#0#HTML" expanded="true" />
+                <element signature="e#4723#4750#0#HTML" expanded="true" />
+                <element signature="e#5346#5375#0#HTML" expanded="true" />
+                <element signature="e#5634#5680#0#HTML" expanded="true" />
               </folding>
             </state>
           </provider>
@@ -80,10 +75,10 @@
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="seen.blade.php" pinned="false" current-in-tab="true">
+      <file leaf-file-name="seen.blade.php" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/views/seen.blade.php">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="0.6240209">
+            <state vertical-scroll-proportion="-17.703703">
               <caret line="31" column="7" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
               <folding />
             </state>
@@ -100,16 +95,6 @@
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="bootstrap-superhero.min.css" pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/public/css/bootstrap-superhero.min.css">
-          <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="434.02942">
-              <caret line="10" column="124543" selection-start-line="10" selection-start-column="124543" selection-end-line="10" selection-end-column="124543" />
-              <folding />
-            </state>
-          </provider>
-        </entry>
-      </file>
       <file leaf-file-name="suggest.blade.php" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/views/suggest.blade.php">
           <provider selected="true" editor-type-id="text-editor">
@@ -123,8 +108,8 @@
       <file leaf-file-name="routes.php" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/routes.php">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-18.666666">
-              <caret line="34" column="48" selection-start-line="34" selection-start-column="27" selection-end-line="34" selection-end-column="48" />
+            <state vertical-scroll-proportion="-16.666666">
+              <caret line="37" column="31" selection-start-line="37" selection-start-column="31" selection-end-line="37" selection-end-column="31" />
               <folding>
                 <element signature="e#7#392#0#PHP" expanded="true" />
               </folding>
@@ -132,6 +117,16 @@
           </provider>
         </entry>
       </file>
+      <file leaf-file-name="Comment.php" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/app/models/Comment.php">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="-9.333333">
+              <caret line="14" column="60" selection-start-line="14" selection-start-column="60" selection-end-line="14" selection-end-column="60" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
       <file leaf-file-name="Film.php" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/models/Film.php">
           <provider selected="true" editor-type-id="text-editor">
@@ -168,7 +163,6 @@
         <option value="$PROJECT_DIR$/app/config/queue.php" />
         <option value="$PROJECT_DIR$/app/config/view.php" />
         <option value="$PROJECT_DIR$/artisan" />
-        <option value="$PROJECT_DIR$/app/models/Comment.php" />
         <option value="$PROJECT_DIR$/public/css/bootstrap-flatly.min.css" />
         <option value="$PROJECT_DIR$/public/css/bootstrap-cyborg.min.css" />
         <option value="$PROJECT_DIR$/public/css/bootstrap-magic.css" />
@@ -184,10 +178,11 @@
         <option value="$PROJECT_DIR$/app/models/Film.php" />
         <option value="$PROJECT_DIR$/app/routes.php" />
         <option value="$PROJECT_DIR$/app/views/users.blade.php" />
-        <option value="$PROJECT_DIR$/app/views/index.blade.php" />
         <option value="$PROJECT_DIR$/app/views/suggest.blade.php" />
         <option value="$PROJECT_DIR$/app/views/film.blade.php" />
         <option value="$PROJECT_DIR$/app/views/seen.blade.php" />
+        <option value="$PROJECT_DIR$/app/models/Comment.php" />
+        <option value="$PROJECT_DIR$/app/views/index.blade.php" />
       </list>
     </option>
   </component>
@@ -423,13 +418,20 @@
       <option name="project" value="LOCAL" />
       <updated>1433778557857</updated>
     </task>
-    <option name="localTasksCounter" value="3" />
+    <task id="LOCAL-00003" summary="Sommer Style, Avatare, Duplikate">
+      <created>1445403749673</created>
+      <option name="number" value="00003" />
+      <option name="project" value="LOCAL" />
+      <updated>1445403749673</updated>
+    </task>
+    <option name="localTasksCounter" value="4" />
     <servers />
   </component>
   <component name="ToolWindowManager">
     <frame x="123" y="125" width="1797" height="955" extended-state="0" />
     <editor active="true" />
     <layout>
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@@ -445,7 +447,6 @@
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
@@ -672,13 +673,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/models/Comment.php">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-10.666667">
-          <caret line="16" column="1" selection-start-line="16" selection-start-column="1" selection-end-line="16" selection-end-column="1" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/public/css/bootstrap-theme.css">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-7.509091">
@@ -799,44 +793,44 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/views/users.blade.php">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-5.4915257">
-          <caret line="18" column="74" selection-start-line="18" selection-start-column="74" selection-end-line="18" selection-end-column="74" />
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/app/views/suggest.blade.php">
+    <entry file="file://$PROJECT_DIR$/app/models/User.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-9.762712">
-          <caret line="44" column="110" selection-start-line="44" selection-start-column="110" selection-end-line="44" selection-end-column="110" />
+        <state vertical-scroll-proportion="-26.666666">
+          <caret line="87" column="46" selection-start-line="87" selection-start-column="46" selection-end-line="87" selection-end-column="46" />
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/app/routes.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-18.666666">
-          <caret line="34" column="48" selection-start-line="34" selection-start-column="27" selection-end-line="34" selection-end-column="48" />
+        <state vertical-scroll-proportion="-16.666666">
+          <caret line="37" column="31" selection-start-line="37" selection-start-column="31" selection-end-line="37" selection-end-column="31" />
           <folding>
             <element signature="e#7#392#0#PHP" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/models/User.php">
+    <entry file="file://$PROJECT_DIR$/app/views/suggest.blade.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-26.666666">
-          <caret line="87" column="46" selection-start-line="87" selection-start-column="46" selection-end-line="87" selection-end-column="46" />
+        <state vertical-scroll-proportion="-9.762712">
+          <caret line="44" column="110" selection-start-line="44" selection-start-column="110" selection-end-line="44" selection-end-column="110" />
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/models/Film.php">
+    <entry file="file://$PROJECT_DIR$/app/views/users.blade.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-26.37037">
-          <caret line="49" column="124" selection-start-line="49" selection-start-column="124" selection-end-line="49" selection-end-column="124" />
+        <state vertical-scroll-proportion="-5.4915257">
+          <caret line="18" column="74" selection-start-line="18" selection-start-column="74" selection-end-line="18" selection-end-column="74" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/app/views/seen.blade.php">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="-17.703703">
+          <caret line="31" column="7" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
           <folding />
         </state>
       </provider>
@@ -865,26 +859,36 @@
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/app/models/Film.php">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="-26.37037">
+          <caret line="49" column="124" selection-start-line="49" selection-start-column="124" selection-end-line="49" selection-end-column="124" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/app/models/Comment.php">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="-9.333333">
+          <caret line="14" column="60" selection-start-line="14" selection-start-column="60" selection-end-line="14" selection-end-column="60" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/app/views/index.blade.php">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-6.377049">
-          <caret line="54" column="38" selection-start-line="53" selection-start-column="120" selection-end-line="55" selection-end-column="27" />
+        <state vertical-scroll-proportion="0.28688523">
+          <caret line="105" column="85" selection-start-line="105" selection-start-column="85" selection-end-line="105" selection-end-column="85" />
           <folding>
             <element signature="e#314#360#0#HTML" expanded="true" />
             <element signature="e#1728#1774#0#HTML" expanded="true" />
             <element signature="e#3948#3994#0#HTML" expanded="true" />
-            <element signature="e#5206#5252#0#HTML" expanded="true" />
+            <element signature="e#4723#4750#0#HTML" expanded="true" />
+            <element signature="e#5346#5375#0#HTML" expanded="true" />
+            <element signature="e#5634#5680#0#HTML" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/app/views/seen.blade.php">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.6240209">
-          <caret line="31" column="7" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
-          <folding />
-        </state>
-      </provider>
-    </entry>
   </component>
 </project>

+ 1 - 1
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);
 	}
 }

+ 11 - 6
app/views/index.blade.php

@@ -97,14 +97,19 @@
 	
 			<div class="list-group">
 				@foreach ($kommentare as $kommentar)
-					<a href="{{ url("film/" . $kommentar->film) }}" class="list-group-item">
-						<h6 class='list-group-item-heading'>{{$kommentar->autor->name}}
-							<small>in {{ $kommentar->objekt->name }}</small>
-						</h6>
-					<p class='list-group-item-text'>
+					<a href="{{ url("film/" . $kommentar->film) }}" class="list-group-item" style="padding-bottom: 2px">
+						<h6 class='list-group-item-heading'><span class="badge">
+						<img class="img-circle" src="{{ $kommentar->autor->getAvatar() }}" width="16"> {{$kommentar->autor->name}}
+					</span>
+							<small>in</small> <i>{{ $kommentar->objekt->name }}</i>
+						</h6></a>
+					<p class='panel-body' style="padding-top: 0; padding-bottom: 3px; ">
+						@if($kommentar->bewertung > 0)
+							<small>Hat den Film mit <span class="label label-{{$labels[round($kommentar->bewertung)]}}">{{$kommentar->bewertung}}</span> bewertet.</small><br>
+						@endif
 						{{ $kommentar->text }}
 					</p>
-					</a>
+					<hr style="padding: 0; margin: 0">
 				@endforeach		
 			</div>
 		</div>