Move partials into separate directory
parent
2b347bb7e6
commit
d02afd94d4
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
.movie data-id="#{movie.id}"
|
|
||||||
== slim :"movie/#{template}", locals: {movie: movie}
|
|
|
@ -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}
|
|
@ -0,0 +1,2 @@
|
||||||
|
.movie data-id="#{movie.id}"
|
||||||
|
== slim :"partials/movie/#{template}", locals: {movie: movie}
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue