Move partials into separate directory

master
Guillaume Dott 2015-11-18 16:18:59 +01:00
parent 2b347bb7e6
commit d02afd94d4
10 changed files with 6 additions and 10 deletions

View File

@ -42,12 +42,8 @@ module Librarix
Tmdb::Movie.find(params['search']) Tmdb::Movie.find(params['search'])
end end
if request.xhr?
slim :list, layout: false, locals: {movies: movies}
else
slim :search, locals: {movies: movies} slim :search, locals: {movies: movies}
end end
end
post '/add' do post '/add' do
id = params[:id].to_i id = params[:id].to_i

View File

@ -24,7 +24,7 @@ form method="get" action="/" id="filter"
- filter.movies.each do |group, movies| - filter.movies.each do |group, movies|
- unless group == :all - unless group == :all
h1 = group h1 = group
== slim :list, locals: {movies: movies} == slim :'partials/list', locals: {movies: movies}
- if filter.maybe_search? - if filter.maybe_search?
p p
| Search for | Search for

View File

@ -1,2 +0,0 @@
.movie data-id="#{movie.id}"
== slim :"movie/#{template}", locals: {movie: movie}

View File

@ -1,4 +1,4 @@
ul.movies class="#{template}" ul.movies class="#{template}"
- movies.each do |movie| - movies.each do |movie|
li li
== slim :movie, locals: {movie: movie} == slim :'partials/movie', locals: {movie: movie}

View File

@ -0,0 +1,2 @@
.movie data-id="#{movie.id}"
== slim :"partials/movie/#{template}", locals: {movie: movie}

View File

@ -7,4 +7,4 @@ form method="get" action="/search" id="search"
input type="submit" value="Search" input type="submit" value="Search"
div div
== slim :list, locals: {movies: movies} == slim :'partials/list', locals: {movies: movies}