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,11 +42,7 @@ module Librarix
Tmdb::Movie.find(params['search'])
end
if request.xhr?
slim :list, layout: false, locals: {movies: movies}
else
slim :search, locals: {movies: movies}
end
slim :search, locals: {movies: movies}
end
post '/add' do

View File

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