Add single movie page

master
Guillaume Dott 2015-11-19 12:22:52 +01:00
parent d02afd94d4
commit 7246e18377
4 changed files with 31 additions and 3 deletions

View File

@ -0,0 +1,25 @@
- content_for :title do
= movie.title
.movie data-id="#{movie.id}"
.poster
- if movie.poster_path
img src="#{poster_url(movie.poster_path, 'w154')}"
.informations
h2
a href="#{url("/movie/#{movie.id}")}" #{movie.original_title}
p = movie.release_date
p = movie.overview
.actions
- if movie.added?
- unless movie.viewed?
form method="post" action="/view"
input type="hidden" name="id" value="#{movie.id}"
button type="submit" data-action="view-movie" View
form method="post" action="/remove"
input type="hidden" name="id" value="#{movie.id}"
button type="submit" data-action="remove-movie" Remove
- else
form method="post" action="/add"
input type="hidden" name="id" value="#{movie.id}"
button type="submit" data-action="add-movie" Add

View File

@ -3,7 +3,7 @@
img src="#{poster_url(movie.poster_path, 'w92')}"
.informations
h2
a href="https://www.themoviedb.org/movie/#{movie.id}" #{movie.original_title}
a href="#{url("/movie/#{movie.id}")}" #{movie.original_title}
.actions
- if movie.added?
- unless movie.viewed?

View File

@ -3,9 +3,12 @@
img src="#{poster_url(movie.poster_path, 'w154')}"
.informations
h2
a href="https://www.themoviedb.org/movie/#{movie.id}" #{movie.original_title}
a href="#{url("/movie/#{movie.id}")}" #{movie.original_title}
p = movie.release_date
p = movie.overview
ul.genres
- movie.genres.each do |genre|
li = genre['name']
.actions
- if movie.added?
- unless movie.viewed?

View File

@ -3,4 +3,4 @@
img src="#{poster_url(movie.poster_path, 'w154')}"
.informations
h2
a href="https://www.themoviedb.org/movie/#{movie.id}" #{movie.original_title}
a href="#{url("/movie/#{movie.id}")}" #{movie.original_title}