suggest.blade.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @extends('hello')
  2. @section('content')
  3. <div class="page-header"><h1>{{$titel}}</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-transfer"></span>&nbsp;{{ $vp + $np }}
  28. </td>
  29. <td>
  30. @if(($vp) > 0) <span class="label label-default">+{{$vp}}</span>
  31. @else <span class="label label-default">0</span>
  32. @endif
  33. @if($stimme == 1)
  34. &nbsp;<span class="label label-success tooltip-enable" data-toggle="tooltip" title="Daf&uuml;r gestimmt."><span class="glyphicon glyphicon-thumbs-up"></span></span>
  35. @elseif($stimme == 0)
  36. &nbsp;<span class="label label-default tooltip-enable" data-toggle="tooltip" title="Nicht daf&uuml;r gestimmt."><span class="glyphicon glyphicon-hand-right"></span></span>
  37. @endif
  38. </td>
  39. <td>{{ \Carbon\Carbon::parse($film->vorgeschlagen)->format('d.m.Y')}}</td>
  40. <td>
  41. <span class="badge">
  42. <img class="img-circle" src="{{ Film::find($film->id)->besitzer->getAvatar() }}" width="20"> {{Film::find($film->id)->besitzer->name}}
  43. </span>
  44. </td>
  45. </tr>
  46. @endforeach
  47. </table>
  48. {{ $filme->links() }}
  49. @stop
  50. @section('title')
  51. {{$titel}} ~
  52. @stop
  53. @section('script')
  54. <script type="text/javascript">
  55. $(function() {
  56. $('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
  57. });
  58. </script>
  59. @stop