/
_full_movie.html.erb
46 lines (38 loc) · 1.33 KB
/
_full_movie.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<%= movie_poster(movie, :medium) %>
<header>
<%= render 'movies/title', :movie => movie %>
<% if movie.directors.present? %>
<p class="directors">by <strong><%= movie.directors.map { |name|
link_to(name, director_path(name))
}.to_sentence.html_safe %></strong></p>
<% end %>
<% if movie.countries.present? %>
<p class="countries">in <%= movie.countries.to_sentence %></p>
<% end %>
<%= movie_runtime(movie) %>
</header>
<% if movie.chosen_plot.present? %>
<p class="plot"><%= movie_plot movie %></p>
<% end %>
<% if elsewhere = movie_elsewhere(movie).presence %>
<p class="elsewhere">
Elsewhere:
<%= raw elsewhere.map { |label, url, title|
link_to(label, url, title: title)
}.join(separator) %>
</p>
<% end %>
<%= movie_actions(movie) %>
<% if logged_in? and (stats = current_user.friends_who_watched(movie)).present? %>
<div class="friends">
<span class=label>Social</span>
<% for rating, label in [ [true, 'liked'], [nil, 'meh'], [false, 'disliked'] ] -%>
<% people = stats.people_who_rated(rating) -%>
<% names = people.map {|p| screen_name(p) } -%>
<span class=<%= label %> rel=tooltip title="<%= label %>: <%= people.any?? names.to_sentence : 'none' %>">
<%= people.size %>
<% if rating == true %>♥<% end %>
</span>
<% end -%>
</div>
<% end %>