film.blade.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. <span class="label label-info">
  14. <img class="img-circle" src="{{ $film->besitzer->getAvatar() }}" width="16"> {{$film->besitzer->name}}
  15. </span>
  16. </div>
  17. <div class="col-md-9">
  18. <ul class="nav nav-pills">
  19. <li class="active"><a href="#ueberblick" data-toggle="tab">Überblick</a></li>
  20. <li><a href="#cast" data-toggle="tab">Schauspieler</a></li>
  21. <li><a href="#trailer" data-toggle="tab">Trailer</a></li>
  22. </ul>
  23. </div>
  24. </div>
  25. <div class="row">
  26. <div class="col-md-3 thumbnail">
  27. <img src="{{ $poster }}" alt="{{ $film->name }} Poster">
  28. </div>
  29. <div class="col-md-9 tab-content">
  30. <div class="tab-pane active" id='ueberblick'>
  31. <div class="pull-right">
  32. <a class="btn btn-xs btn-primary" href="http://themoviedb.org/movie/{{ $film->tvdbid }}">themoviedb.org</a>
  33. <a class="btn btn-xs btn-warning" href="http://imdb.com/title/{{ $tfilm['imdb_id'] }}">IMDB</a>
  34. </div>
  35. <dl class="dl-horizontal">
  36. <dt>Originaltitel</dt>
  37. <dd>{{ $tfilm['original_title'] }}</dd>
  38. <dt>Erschienen</dt>
  39. <dd>
  40. {{ \Carbon\Carbon::parse($tfilm['release_date'])->format('d.m.Y')}} -
  41. @foreach($tfilm['production_countries'] as $pc)
  42. <abbr title="{{$pc['name']}}">{{$pc['iso_3166_1']}}</abbr>
  43. @endforeach
  44. @foreach($tfilm['production_companies'] as $pc)
  45. - {{$pc['name']}}
  46. @endforeach
  47. </dd>
  48. <dt>Genre</dt>
  49. <dd>
  50. @foreach($tfilm['genres'] as $g)
  51. <span class="label label-default">{{$g['name']}}</span>
  52. @endforeach
  53. </dd>
  54. <dt>Bewertung</dt>
  55. <dd>{{ $tfilm['vote_average']}} von 10 </dd>
  56. @if($film->getBewertung() > 0)
  57. <dt>Eigene Bewertung</dt>
  58. <dd>
  59. <div class="label label-{{$labels[round($film->getBewertung())]}}">{{$film->getBewertung()}}</div>
  60. </dd>
  61. @endif
  62. @for($i = 0; $i < 3 && $i < count($cast['crew']); $i++)
  63. <dt>{{$cast['crew'][$i]['job']}}</dt>
  64. <dd>{{$cast['crew'][$i]['name']}}</dd>
  65. @endfor
  66. <p></p>
  67. <dt>Inhalt</dt>
  68. <dd>{{ nl2br($tfilm['overview']) }}</dd>
  69. </dl>
  70. </div>
  71. <div class="tab-pane" id="cast">
  72. <div class="row" style="margin-top:10px;">
  73. @for($i = 0; $i < 10 && $i < count($cast['cast']); $i++)
  74. <div class="col-md-6">
  75. <div class="pull-left" style="margin-right:5px; min-height: 80px;"><img class="media-object" src="{{ !is_null($cast['cast'][$i]['profile_path']) ? $tmdb->getImageUrl($cast['cast'][$i]['profile_path'], TMDb::IMAGE_PROFILE, 'w185') : asset("img/no-avatar.jpg") }}" alt="{{$cast['cast'][$i]['name']}}" width="55"></div>
  76. <div class="media-body">
  77. <h4 class="media-heading">{{$cast['cast'][$i]['name']}}</h4>
  78. {{$cast['cast'][$i]['character']}}
  79. </div>
  80. </div>
  81. @if($i % 2 == 1)
  82. </div><div class="row">
  83. @endif
  84. @endfor
  85. </div>
  86. </div>
  87. <div class="tab-pane" id="trailer">
  88. @foreach($trail['youtube'] as $yt)
  89. <p></p><iframe width="420" height="315" src="//www.youtube.com/embed/{{ $yt['source'] }}" frameborder="0" allowfullscreen></iframe>
  90. @endforeach
  91. </div>
  92. </div>
  93. </div>
  94. <div class="clearfix"></div>
  95. <hr>
  96. @if($votes > 0 || is_null($film->gesehen))
  97. @if($votes > 0)
  98. <h2>Abstimmung</h2>
  99. <p>Insgesamt haben <b>{{$votes}}</b> Personen abgestimmt. <b>{{$vposi}}</b> davon waren <i>daf&uuml;r</i>. @if($uvote[0])
  100. Du hast <i>{{ $uvote[1] ? "daf&uuml;r" : "nicht daf&uuml;r"}}</i> gestimmt.
  101. @endif
  102. </p>
  103. <dl class="dl-horizontal">
  104. <dt>Daf&uuml;r</dt>
  105. <dd>
  106. @foreach($pv as $v)
  107. <span class="badge">
  108. <img class="img-circle" src="{{ $v->getAvatar() }}" width="20"> {{$v->name}}
  109. </span>&nbsp;
  110. @endforeach
  111. </dd>
  112. <p></p>
  113. <dt>Nicht daf&uuml;r</dt>
  114. <dd>
  115. @foreach($nv as $v)
  116. <span class="badge">
  117. <img class="img-circle" src="{{ $v->getAvatar() }}" width="20"> {{$v->name}}
  118. </span>&nbsp;
  119. @endforeach
  120. </dd>
  121. </dl>
  122. @endif
  123. @if(is_null($film->gesehen) && !is_null(Auth::user()))
  124. <div class="container" style="text-align: center">
  125. <div class="btn-group">
  126. <a class="btn btn-lg btn-success <?php echo $uvote[0] && $uvote[1] ? "disabled" : ""; ?>" href="{{ url('vote', array('yes', Auth::user()->id, $film->id)) }}">
  127. <span class="glyphicon glyphicon-thumbs-up"></span> Daf&uuml;r
  128. </a>
  129. <a class="btn btn-lg btn-default <?php echo $uvote[0] && !$uvote[1] ? "disabled" : ""; ?>" href="{{ url('vote', array('no', Auth::user()->id, $film->id)) }}">
  130. <span class="glyphicon glyphicon-hand-right"></span> Nicht daf&uuml;r
  131. </a>
  132. </div>
  133. </div>
  134. @endif
  135. <hr>@endif
  136. <h2>Kommentare</h2>
  137. @if(is_null(Auth::user()))
  138. <p>Melde Dich an, um diesen Film zu kommentieren.</p>
  139. @else
  140. <div class="media">
  141. <div class="pull-left">
  142. <img class="media-object" src="{{ Auth::user()->getAvatar() }}" width="64">
  143. </div>
  144. <div class="media-body">
  145. <h4 class="media-heading">Neuer Kommentar</h4>
  146. {{Form::open(array('route' => 'comment'))}}
  147. @if(!is_null(Auth::user()) && !is_null($film->gesehen) && Comment::where('user', Auth::user()->id)->where('film', $film->id)->where('bewertung', '>', 0)->count() < 1 )
  148. <p><div class="pull-left" style="margin-right: 5px">Bewerten:</div>
  149. <div class="btn-group btn-group-xs" data-toggle="buttons">
  150. @for($i = 1; $i < 11; $i++)
  151. <label class="btn btn-{{ $labels[$i] }}">
  152. <input type="radio" name="rate" id="rate{{ $i }}" value="{{ $i }}"> {{ $i }}
  153. </label>
  154. @endfor
  155. </div>
  156. </p>
  157. @endif
  158. <input type="hidden" name="user" value="{{Auth::user()->id}}">
  159. <input type="hidden" name="film" value="{{$film->id}}">
  160. <div class="form-group"><textarea class="form-control" rows="1" name="text"></textarea></div>
  161. <div class="form-group"><button type="submit" class="btn btn-primary btn-xs">Absenden</button></div>
  162. {{Form::close()}}
  163. </div>
  164. </div>
  165. @endif
  166. @foreach($comments as $comment)
  167. <div class="media">
  168. <div class="pull-left">
  169. <img class="media-object" src="{{ $comment->autor->getAvatar() }}" alt="{{ $comment->autor->name }}" width="64">
  170. </div>
  171. <div class="media-body" id="comment{{$comment->id}}">
  172. <h5 class="media-heading">{{ $comment->autor->name }} <small>{{\Carbon\Carbon::parse($comment->created_at)->format('d.m.Y H:i')}}
  173. @if($comment->updated_at != $comment->created_at)
  174. &mdash; Zuletzt bearbeitet: {{\Carbon\Carbon::parse($comment->updated_at)->format('d.m.Y H:i')}}
  175. @endif
  176. </small></h5>
  177. @if(!is_null(Auth::user()) && Auth::user()->id === $comment->autor->id)
  178. <div class="collapse in" data-parent="#comment{{$comment->id}}" id="comment{{$comment->id}}comment">
  179. @if($comment->bewertung > 0)
  180. <div class="pull-left label label-{{ $labels[$comment->bewertung] }}" style="margin-right: 5px;">{{$comment->bewertung}}</div>
  181. @endif
  182. <p>{{$comment->text}}</p>
  183. <button type="button" class="btn btn-default btn-xs" onclick="toggleComment('#comment{{$comment->id}}')">Bearbeiten</button>
  184. </div>
  185. <div class="collapse" id="comment{{$comment->id}}edit">
  186. {{Form::open(array('route' => 'modcomment'))}}
  187. @if($comment->bewertung > 0)
  188. <p><div class="pull-left" style="margin-right: 5px">Bewerten:</div>
  189. <div class="btn-group btn-group-xs" data-toggle="buttons">
  190. @for($i = 1; $i < 11; $i++)
  191. <label class="btn btn-{{ $labels[$i] }}">
  192. <input type="radio" name="rate" id="rate{{ $i }}" value="{{ $i }}"> {{ $i }}
  193. </label>
  194. @endfor
  195. </div>
  196. </p>
  197. @endif
  198. <input type="hidden" name="id" value="{{$comment->id}}">
  199. <div class="form-group"><textarea class="form-control" rows="1" name="text">{{$comment->text}}</textarea></div>
  200. <div class="form-group">
  201. <button type="submit" class="btn btn-primary btn-xs">Absenden</button>
  202. <button type="button" class="btn btn-default btn-xs" onclick="toggleComment('#comment{{$comment->id}}')">Abbrechen</button>
  203. </div>
  204. {{Form::close()}}
  205. </div>
  206. @else
  207. @if($comment->bewertung > 0)
  208. <div class="pull-left label label-{{ $labels[$comment->bewertung] }}" style="margin-right: 5px;">{{$comment->bewertung}}</div>
  209. @endif
  210. <p>{{$comment->text}}</p>
  211. @endif
  212. </div>
  213. </div>
  214. @endforeach
  215. @stop
  216. @section('script')
  217. <script type="text/javascript">
  218. function toggleComment(id) {
  219. $(id + 'edit').collapse('toggle');
  220. $(id + 'comment').collapse('toggle');
  221. }
  222. $(function () {
  223. $('[data-toggle="tooltip"]').tooltip()
  224. })
  225. $(function() {
  226. $('#gesehen').popover({
  227. html: true,
  228. placement: "right",
  229. trigger: "click",
  230. title: "Als gesehen markieren",
  231. content: "<div class='container'><a href='{{ url('mark-read/' . $film->id) }}' class='btn btn-success'>Gesehen</a><a href='{{ url('view-next/' . $film->id) }}' class='btn btn-warning'>Als n&auml;chstes sehen</a></div>"
  232. });
  233. });
  234. </script>
  235. @stop
  236. @section('title')
  237. {{ $film->name }} ~
  238. @stop