film.blade.php 9.6 KB

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