suggest.blade.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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>Stimmen</th>
  9. <th>Vorgeschlagen am</th>
  10. <th>Vorgeschlagen von</th>
  11. </tr>
  12. @foreach($filme as $film)
  13. <tr>
  14. <td>{{ HTML::link('film/' . $film->id, $film->name) }}</td>
  15. <td>
  16. <?php
  17. $vp = $film->votes()->where('stimme', true)->count();
  18. $np = $film->votes()->where('stimme', false)->count();
  19. ?>
  20. <div class="progress tooltip-enable" data-toggle="tooltip" title="{{ $vp }}/{{ $np }}">
  21. <div class="progress-bar progress-bar-success" style="width: <?php if(($vp + $np) > 0) echo ($vp / ($vp + $np) * 100); else echo 0; ?>%">
  22. <span class="sr-only">{{$vp}} von {{$vp + $np}} (daf&uuml;r)</span>
  23. </div>
  24. <div class="progress-bar progress-bar-danger" style="width: <?php if(($vp + $np) > 0) echo ($vp / ($vp + $np) * 100); else echo 0; ?>%">
  25. <span class="sr-only">{{$np}} von {{$vp + $np}} (dagegen)</span>
  26. </div>
  27. </div>
  28. </td>
  29. <td>{{ \Carbon\Carbon::parse($film->vorgeschlagen)->format('d.m.Y')}}</td>
  30. <td>{{ $film->besitzer->name }}</td>
  31. </tr>
  32. @endforeach
  33. </table>
  34. {{ $filme->links() }}
  35. @stop
  36. @section('title')
  37. Vorschläge ~
  38. @stop
  39. @section('script')
  40. <script type="text/javascript">
  41. $(function() {
  42. $('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
  43. });
  44. </script>
  45. @stop