From 3fb0c8b6708634fb29d51e3da070253bc4153631 Mon Sep 17 00:00:00 2001 From: Kosuke Tanabe Date: Mon, 27 Apr 2015 00:49:37 +0900 Subject: [PATCH] switch to slim --- app/views/loc_search/index.html.erb | 54 ---------------------------- app/views/loc_search/index.html.slim | 49 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 54 deletions(-) delete mode 100644 app/views/loc_search/index.html.erb create mode 100644 app/views/loc_search/index.html.slim diff --git a/app/views/loc_search/index.html.erb b/app/views/loc_search/index.html.erb deleted file mode 100644 index f1c4485..0000000 --- a/app/views/loc_search/index.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -
-

<%= t('enju_loc.import_from_loc_search') %>

-
-

<%= notice %>

-<%= form_for :loc_search, :url => loc_search_index_path, :html => {:method => 'get'} do -%> -

- <%= label_tag :search_form_top, t('page.search_term') -%>: - <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form'} -%> - <%= submit_tag t('page.search') -%> -

-<%- end -%> -<% if @query.present? %> -

<%= t('enju_loc.number_of_search_results', :count => @books.total_count) %>

- - - - - -<% @books.each do |book| -%> - "> - - - -<% end -%> -
<%= t('activerecord.attributes.manifestation.original_title') %>
- <%= link_to_import_from_loc(book.lccn) %> - - <%= link_to_unless( book.lccn.blank?, book.title, "http://lccn.loc.gov/#{ book.lccn }" ) do book.title end %>
- <%=h book.creator -%>
- <% if book.publisher.present? %> - <%=h book.publisher -%>, - <% end %> - <%=h book.pubyear -%> - <% if book.isbn.present? %> - (ISBN: <%=h book.isbn -%>) - <% end %> -
-
-<%= paginate(@books) %> - -<% else %> - <%= javascript_tag("$('#search_form_top').focus()") -%> -<% end %> - -
-
- - diff --git a/app/views/loc_search/index.html.slim b/app/views/loc_search/index.html.slim new file mode 100644 index 0000000..aa8db01 --- /dev/null +++ b/app/views/loc_search/index.html.slim @@ -0,0 +1,49 @@ +.row + #content_list.col-md-9 + h1.title + = t('enju_loc.import_from_loc_search') + p#notice + = notice + = form_for :books, url: loc_search_index_path, html: {method: 'get', class: 'form-inline'} do + p + = label_tag :search_form_top, t('page.search_term') + | : + => search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'form-control'} + => submit_tag t('page.search'), class: 'form-control' + - if @query.present? + p + = t('enju_loc.number_of_search_results', :count => @books.total_count) + table.table.table-striped.index + tr + th + th + = t('activerecord.attributes.manifestation.original_title') + - @books.each do |book| + | + td + = link_to_import_from_loc(book.lccn) + td + strong + = link_to_unless( book.lccn.blank?, book.title, "http://lccn.loc.gov/#{ book.lccn }" ) do book.title end + br + =h book.creator + br + - if book.publisher.present? + =h book.publisher + | , + =h book.pubyear + - if book.isbn.present? + | (ISBN: + =h book.isbn + | ) + br + = paginate(@books) + - else + = javascript_tag("$('#search_form_top').focus()") + #submenu.col-md-3 + - if defined?(EnjuNdl) + ul + li + = link_to t('enju_ndl.import_from_ndl_search'), ndl_books_path( :query => @query )