suggest.blade.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. @extends('hello')
  2. @section('content')
  3. <div class="page-header"><h1>Vorschläge</h1></div>
  4. {{ $filme->links() }}
  5. <table class="table">
  6. <tr>
  7. <th>Titel</th>
  8. <th colspan="2">Stimmen</th>
  9. <th>Vorgeschlagen am</th>
  10. <th>Vorgeschlagen von</th>
  11. </tr>
  12. @foreach($filme as $film)
  13. <tr>
  14. <td>
  15. <?php
  16. $stimme = 2;
  17. if(!is_null(Auth::user()) && Vote::where('film', $film->id)->where('user', Auth::user()->id)->count())
  18. $stimme = Vote::where('film', $film->id)->where('user', Auth::user()->id)->first()->stimme;
  19. ?>
  20. {{ HTML::link('film/' . $film->id, $film->name) }}
  21. </td>
  22. <td>
  23. <?php
  24. $vp = $film->upvotes;
  25. $np = $film->downvotes;
  26. ?>
  27. <span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;{{ $vp }},
  28. <span class="glyphicon glyphicon-thumbs-down"></span>&nbsp;{{ $np }}
  29. </td>
  30. <td>
  31. @if(($vp - $np) > 0) <span class="label label-success">+{{$vp - $np}}</span>
  32. @elseif(($vp - $np) < 0) <span class="label label-danger">{{$vp - $np}}</span>
  33. @else <span class="label label-warning">{{$vp - $np}}</span>
  34. @endif
  35. @if($stimme == 1)
  36. &nbsp;<span class="label label-success tooltip-enable" data-toggle="tooltip" title="Daf&uuml;r gestimmt."><span class="glyphicon glyphicon-thumbs-up"></span></span>
  37. @elseif($stimme == 0)
  38. &nbsp;<span class="label label-danger tooltip-enable" data-toggle="tooltip" title="Dagegen gestimmt."><span class="glyphicon glyphicon-thumbs-down"></span></span>
  39. @endif
  40. </td>
  41. <td>{{ \Carbon\Carbon::parse($film->vorgeschlagen)->format('d.m.Y')}}</td>
  42. <td>{{ Film::find($film->id)->besitzer->name }}</td>
  43. </tr>
  44. @endforeach
  45. </table>
  46. {{ $filme->links() }}
  47. @stop
  48. @section('title')
  49. Vorschläge ~
  50. @stop
  51. @section('script')
  52. <script type="text/javascript">
  53. $(function() {
  54. $('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
  55. });
  56. </script>
  57. @stop