suggest.blade.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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-tree-deciduous"></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-warning 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>{{ Film::find($film->id)->besitzer->name }}</td>
  41. </tr>
  42. @endforeach
  43. </table>
  44. {{ $filme->links() }}
  45. @stop
  46. @section('title')
  47. {{$titel}} ~
  48. @stop
  49. @section('script')
  50. <script type="text/javascript">
  51. $(function() {
  52. $('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
  53. });
  54. </script>
  55. @stop