film.blade.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. @extends('hello')
  2. @section('content')
  3. <div class="page-header">
  4. <h1>{{ $film->name }} <small>{{ $tfilm['tagline']}}</small></h1>
  5. </div>
  6. <div class="row">
  7. <div class="col-md-3">
  8. @if(!is_null($film->gesehen))
  9. <div class="label label-success"><span class="glyphicon glyphicon-check"></span> Gesehen am {{ \Carbon\Carbon::parse($film->gesehen)->format('d.m.Y') }}</div>
  10. @else
  11. <div class="label label-danger" <?php if(!is_null(Auth::user()) && Auth::user()->admin) { echo "id='gesehen'"; } ?> style="cursor: pointer;"><span class="glyphicon glyphicon-unchecked"></span> Nicht gesehen</div>
  12. @endif
  13. </div>
  14. <div class="col-md-9">
  15. <ul class="nav nav-tabs">
  16. <li class="active"><a href="#ueberblick" data-toggle="tab">Überblick</a></li>
  17. <li><a href="#cast" data-toggle="tab">Schauspieler</a></li>
  18. <li><a href="#trailer" data-toggle="tab">Trailer</a></li>
  19. </ul>
  20. </div>
  21. </div>
  22. <div class="row">
  23. <div class="col-md-3 thumbnail">
  24. <img src="{{ $poster }}" alt="{{ $film->name }} Poster">
  25. </div>
  26. <div class="col-md-9 tab-content">
  27. <div class="tab-pane active" id='ueberblick'>
  28. <div class="pull-right">
  29. <a class="btn btn-xs btn-primary" href="http://themoviedb.org/movie/{{ $film->tvdbid }}">themoviedb.org</a>
  30. <a class="btn btn-xs btn-warning" href="http://imdb.com/title/{{ $tfilm['imdb_id'] }}">IMDB</a>
  31. </div>
  32. <dl class="dl-horizontal">
  33. <dt>Originaltitel</dt>
  34. <dd>{{ $tfilm['original_title'] }}</dd>
  35. <dt>Erschienen</dt>
  36. <dd>
  37. {{ \Carbon\Carbon::parse($tfilm['release_date'])->format('d.m.Y')}} -
  38. @foreach($tfilm['production_countries'] as $pc)
  39. <abbr title="{{$pc['name']}}">{{$pc['iso_3166_1']}}</abbr>
  40. @endforeach
  41. @foreach($tfilm['production_companies'] as $pc)
  42. - {{$pc['name']}}
  43. @endforeach
  44. </dd>
  45. <dt>Genre</dt>
  46. <dd>
  47. @foreach($tfilm['genres'] as $g)
  48. <span class="label label-default">{{$g['name']}}</span>
  49. @endforeach
  50. </dd>
  51. <dt>Bewertung</dt>
  52. <dd>{{ $tfilm['vote_average']}} von 10
  53. </dd>
  54. @for($i = 0; $i < 3 && $i < count($cast['crew']); $i++)
  55. <dt>{{$cast['crew'][$i]['job']}}</dt>
  56. <dd>{{$cast['crew'][$i]['name']}}</dd>
  57. @endfor
  58. <p></p>
  59. <dt>Inhalt</dt>
  60. <dd>{{ nl2br($tfilm['overview']) }}</dd>
  61. </dl>
  62. </div>
  63. <div class="tab-pane" id="cast">
  64. <div class="row" style="margin-top:10px;">
  65. @for($i = 0; $i < 10 && $i < count($cast['cast']); $i++)
  66. <div class="col-md-6">
  67. <div class="pull-left" style="margin-right:5px; min-height: 80px;"><img class="img-thumbnail media-object" src="{{ !is_null($cast['cast'][$i]['profile_path']) ? $tmdb->getImageUrl($cast['cast'][$i]['profile_path'], TMDb::IMAGE_PROFILE, 'w185') : "http://d3a8mw37cqal2z.cloudfront.net/assets/649ae87ebcf4285/images/no-profile-w185.jpg"}}" alt="{{$cast['cast'][$i]['name']}}" width="55"></div>
  68. <div class="media-body">
  69. <h4 class="media-heading">{{$cast['cast'][$i]['name']}}</h4>
  70. {{$cast['cast'][$i]['character']}}
  71. </div>
  72. </div>
  73. @if($i % 2 == 1)
  74. </div><div class="row">
  75. @endif
  76. @endfor
  77. </div>
  78. </div>
  79. <div class="tab-pane" id="trailer">
  80. @foreach($trail['youtube'] as $yt)
  81. <iframe width="420" height="315" src="//www.youtube.com/embed/{{ $yt['source'] }}" frameborder="0" allowfullscreen></iframe>
  82. @endforeach
  83. </div>
  84. </div>
  85. </div>
  86. <div class="clearfix"></div>
  87. <hr>
  88. @if($votes > 0 || is_null($film->gesehen))
  89. @if($votes > 0)
  90. <h2>Abstimmung</h2>
  91. <p>Insgesamt haben <b>{{$votes}}</b> Personen abgestimmt. <b>{{$vposi}}</b> davon waren <i>daf&uuml;r</i>. @if($uvote[0])
  92. Du hast <i>{{ $uvote[1] ? "daf&uuml;r" : "dagegen"}}</i> gestimmt.
  93. @endif
  94. <div class="progress">
  95. <div class="progress-bar progress-bar-success tooltip-enable" style="width: {{ $vposi / $votes * 100}}%" data-toggle="tooltip" data-title="{{$pv}}">
  96. <span class="sr-only">{{$vposi}} von {{$votes}} (daf&uuml;r)</span>
  97. </div>
  98. <div class="progress-bar progress-bar-danger tooltip-enable" style="width: {{ ($votes - $vposi) / $votes * 100}}%" data-toggle="tooltip" data-title="{{$nv}}">
  99. <span class="sr-only">{{ $votes - $vposi}} von {{ $votes }} (dagegen)</span>
  100. </div>
  101. </div>
  102. @endif
  103. @if(is_null($film->gesehen))
  104. <div class="container" style="text-align: center">
  105. <div class="btn-group">
  106. <a class="btn btn-lg btn-success <?php echo $uvote[0] && $uvote[1] ? "disabled" : ""; ?>" href="{{ url('vote', array('yes', Auth::user()->id, $film->id)) }}">
  107. <span class="glyphicon glyphicon-thumbs-up"></span> Daf&uuml;r
  108. </a>
  109. <a class="btn btn-lg btn-danger <?php echo $uvote[0] && !$uvote[1] ? "disabled" : ""; ?>" href="{{ url('vote', array('no', Auth::user()->id, $film->id)) }}">
  110. <span class="glyphicon glyphicon-thumbs-down"></span> Dagegen
  111. </a>
  112. </div>
  113. </div>
  114. @endif
  115. <hr>@endif
  116. <h2>Kommentare</h2>
  117. @if(is_null(Auth::user()))
  118. <p>Melde Dich an, um diesen Film zu kommentieren.</p>
  119. @else
  120. <div class="media">
  121. <div class="pull-left">
  122. <img class="media-object" src="{{ "http://www.gravatar.com/avatar/" . md5( strtolower( trim( Auth::user()->email ) ) ) . "?s=40" }}">
  123. </div>
  124. <div class="media-body">
  125. <h4 class="media-heading">Neuer Kommentar</h4>
  126. {{Form::open(array('route' => 'comment'))}}
  127. <input type="hidden" name="user" value="{{Auth::user()->id}}">
  128. <input type="hidden" name="film" value="{{$film->id}}">
  129. <div class="form-group"><textarea class="form-control" rows="1" name="text"></textarea></div>
  130. <div class="form-group"><button type="submit" class="btn btn-primary btn-xs">Absenden</button></div>
  131. {{Form::close()}}
  132. </div>
  133. </div>
  134. @endif
  135. @foreach($comments as $comment)
  136. <div class="media">
  137. <div class="pull-left">
  138. <img class="media-object" src="{{ "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $comment->autor->email ) ) ) . "?s=40" }}" alt="{{ $comment->autor->name }}">
  139. </div>
  140. <div class="media-body" id="comment{{$comment->id}}">
  141. <h5 class="media-heading">{{ $comment->autor->name }} <small>{{\Carbon\Carbon::parse($comment->created_at)->format('d.m.Y H:i')}}
  142. @if($comment->updated_at != $comment->created_at)
  143. &mdash; Zuletzt bearbeitet: {{\Carbon\Carbon::parse($comment->updated_at)->format('d.m.Y H:i')}}
  144. @endif
  145. </small></h5>
  146. @if(!is_null(Auth::user()) && Auth::user()->id === $comment->autor->id)
  147. <div class="collapse in" data-parent="#comment{{$comment->id}}" id="comment{{$comment->id}}comment">
  148. <p>{{$comment->text}}</p>
  149. <button type="button" class="btn btn-xs" onclick="toggleComment('#comment{{$comment->id}}')">Bearbeiten</button>
  150. </div>
  151. <div class="collapse" id="comment{{$comment->id}}edit">
  152. {{Form::open(array('route' => 'modcomment'))}}
  153. <input type="hidden" name="id" value="{{$comment->id}}">
  154. <div class="form-group"><textarea class="form-control" rows="1" name="text">{{$comment->text}}</textarea></div>
  155. <div class="form-group">
  156. <button type="submit" class="btn btn-primary btn-xs">Absenden</button>
  157. <button type="button" class="btn btn-xs" onclick="toggleComment('#comment{{$comment->id}}')">Abbrechen</button>
  158. </div>
  159. {{Form::close()}}
  160. </div>
  161. @else
  162. <p>{{$comment->text}}</p>
  163. @endif
  164. </div>
  165. </div>
  166. @endforeach
  167. @stop
  168. @section('script')
  169. <script type="text/javascript">
  170. function toggleComment(id) {
  171. $(id + 'edit').collapse('toggle');
  172. $(id + 'comment').collapse('toggle');
  173. }
  174. $(function() {
  175. $('.tooltip-enable').tooltip({ html: true, placement: "bottom" });
  176. });
  177. $(function() {
  178. $('#gesehen').popover({
  179. html: true,
  180. placement: "right",
  181. trigger: "click",
  182. title: "Als gesehen markieren",
  183. content: "<div class='container'><a href='{{ url('mark-read/' . $film->id) }}' class='btn btn-success'>Film als gesehen markieren</a></div>"
  184. });
  185. });
  186. </script>
  187. @stop
  188. @section('title')
  189. {{ $film->name }} ~
  190. @stop