Skip to content

Commit

Permalink
use font awesome for the search-icon
Browse files Browse the repository at this point in the history
update grid col class for BS4
update input group class-> search forms
  • Loading branch information
christinach committed Jun 11, 2019
1 parent 5f04b31 commit 1304916
Show file tree
Hide file tree
Showing 30 changed files with 104 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// A function used as an event handler on loaded.blacklight.ajax-modal
// to catch contained data-ajax-modal=closed directions
Blacklight.ajaxModal.check_close_ajax_modal = function(event) {
if ($(event.target).find(Blacklight.ajaxModal.modalCloseSelector).length) {
Blacklight.modal.check_close_ajax_modal = function(event) {
if ($(event.target).find(Blacklight.modal.modalCloseSelector).length) {
modal_flashes = $(this).find('.flash_messages');

window.setTimeout(function(){
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def container_type

def navbar_type
if index_layout?
'navbar-fixed-top'
'navbar-expand-md fixed-top'
#'navbar-fixed-top'
else
'navbar'
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/advanced/_advanced_search_facets_as_select.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<% facets_from_request(facet_field_names).each do |display_facet| %>
<% if display_facet.items.present? %>
<div class="form-group advanced-search-facet row">
<%= label_tag display_facet.name.parameterize, :class => "col-sm-4 control-label" do %>
<%= label_tag display_facet.name.parameterize, :class => "col-md-4 control-label" do %>
<%= facet_field_label(display_facet.name) %>
<% end %>
<div class="col-sm-8">
<div class="col-md-8">
<%= content_tag(:select, :multiple => true,
:name => "f_inclusive[#{display_facet.name}][]",
:id => display_facet.name.parameterize,
Expand All @@ -26,10 +26,10 @@
<%# Publication Date is a range input %>
<% pub_date = facet_configuration_for_field(Settings.FIELDS.YEAR) %>
<div class="form-group advanced-search-facet row">
<%= label_tag pub_date.field.parameterize, :class => "col-sm-4 control-label" do %>
<%= label_tag pub_date.field.parameterize, :class => "col-md-4 control-label" do %>
<%= pub_date.label %>
<% end %>
<div class="col-sm-8 range_limit">
<div class="col-md-8 range_limit">
<%= render_range_input(pub_date.field, :begin) %><%= render_range_input(pub_date.field, :end) %>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/advanced/_advanced_search_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= form_tag search_catalog_path, :class => 'advanced form-horizontal', :method => :get do %>
<div class="col-md-7">
<div class="col-lg-7">
<% unless (search_context_str = render_search_to_s(advanced_search_context.permit!.to_h)).blank? %>
<div class="constraints well search_history">
<h4 class="advanced-search-context"><%= t 'blacklight_advanced_search.form.search_context' %></h4>
Expand All @@ -16,7 +16,7 @@
</div>

</div>
<div class="col-md-5">
<div class="col-lg-5">
<div class="limit-criteria">
<h3 class="limit-criteria-heading"><%= t('blacklight_advanced_search.form.limit_criteria_heading_html')%></h3>

Expand All @@ -30,7 +30,7 @@
</div>
</div>

<div class="search-submit-buttons clearfix col-sm-7">
<div class="search-submit-buttons clearfix col-md-7">
<%= render 'advanced_search_submit_btns' %>
</div>

Expand Down
1 change: 0 additions & 1 deletion app/views/advanced/_guided_search_fields.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<div class="advanced-search-field">
<div class="search-field">
<%= select_tag('f1', options_for_select(advanced_key_value, guided_field(:f1, 'all_fields'))) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/advanced/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% @page_title = "Advanced Search - #{application_name}" %>
<%= render 'shared/start_over_row' %>
<div class="advanced-search-form col-sm-12">
<div class="advanced-search-form col-md-12">
<h1 class="advanced page-header">
<%= t('blacklight_advanced_search.form.title') %>
<%= link_to t('blacklight_advanced_search.form.start_over'), blacklight_advanced_search_engine.advanced_search_path, :class =>"btn pull-right clear-form" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/bookmarks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%= render 'shared/start_over_row' %>

<div id="content" class="col-md-12">
<div id="content" class="col-lg-12">
<h2 class='page-heading'><%= t('blacklight.bookmarks.title') %></h2>

<%- if current_or_guest_user.blank? -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_document_split.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="documents" class="docView col-md-12">
<div id="documents" class="docView col-lg-12">
<%= render documents, :as => :document %>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/_facets.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% # main container for facets/limits menu -%>
<% if has_facet_values? %>
<div id="facet-view" class="facet-view col-xs-12">
<div id="facet-view" class="facet-view col col-sm-12">
<%=link_to t('blacklight.search.start_over').html_safe, start_over_path, :class => "btn btn-primary button--start-over", :id=>"startOverLink" %>
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#facet-partials">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span><span>&nbspFilters</span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_featured_content.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="intro col-md-12">
<div class="intro col-lg-12">
<section class="topics">
<div class="grid-items">
<a href="/?utf8=%E2%9C%93&search_field=all_fields&q=" class="grid-item">
Expand Down
12 changes: 6 additions & 6 deletions app/views/catalog/_home_text.html.erb
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<div class='container'>
<div class='row'>
<div class='col-md-12 text-center'>
<div class='col-lg-12 text-center'>
<%= content_tag :h3, t('geoblacklight.home.map_heading') %>
<%= content_tag :div, '', id: 'map', data: { map: 'home', 'catalog-path'=> search_catalog_path, 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap } %>
</div>
<div class='col-md-12'>
<div class='col-lg-12'>
<%= content_tag :h3, t('geoblacklight.home.category_heading'), class: 'text-center' %>
<div class='find-by col-md-3'>
<div class='find-by col-lg-3'>
<div class='category-icon'>
<span class='glyphicon glyphicon-home'></span>
</div>
<h4>Institution</h4>
<%= render_facet_tags [Settings.FIELDS.PROVENANCE] %>
</div>
<div class='find-by col-md-3'>
<div class='find-by col-lg-3'>
<div class='category-icon'>
<span class='glyphicon glyphicon-download'></span>
</div>
<h4>Data type</h4>
<%= render_facet_tags [Settings.FIELDS.GEOM_TYPE] %>
</div>
<div class='find-by col-md-3'>
<div class='find-by col-lg-3'>
<div class='category-icon'>
<span class='glyphicon glyphicon-globe'></span>
</div>
<h4>Placename</h4>
<%= render_facet_tags [Settings.FIELDS.SPATIAL_COVERAGE] %>
</div>
<div class='find-by col-md-3'>
<div class='find-by col-lg-3'>
<div class='category-icon'>
<span class='glyphicon glyphicon-tags'></span>
</div>
Expand Down
61 changes: 30 additions & 31 deletions app/views/catalog/_icon_facet.html.erb
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
<% if facet_field_in_params?(facet_field.key) %>
<% remove_href = search_action_path(remove_all_facet_values(field_name)) %>
<%= content_tag(:li) do %>
<%= link_to(remove_href) do %>
<%= content_tag(:span, all_facet_values_label(facet_field.key)) %>
<% end %>
<% if facet_field_in_params?(facet_field.key) %>
<% remove_href = search_action_path(remove_all_facet_values(field_name)) %>
<%= content_tag(:li) do %>
<%= link_to(remove_href) do %>
<%= content_tag(:span, all_facet_values_label(facet_field.key)) %>
<% end %>
<% else %>
<%= content_tag(:li, class: 'active') do %>
<%= link_to('#') do %>
<%= content_tag(:span, all_facet_values_label(facet_field.key)) %>
<% end %>
<% end %>
<% else %>
<%= content_tag(:li, class: 'active') do %>
<%= link_to('#') do %>
<%= content_tag(:span, all_facet_values_label(facet_field.key)) %>
<% end %>
<% end %>
<% paginator = facet_paginator(facet_field, display_facet) %>
<% paginator.items.each do |item| -%>
<% if facet_in_params?(field_name, item.value) %>
<% remove_href = search_action_path(search_state.remove_facet_params(field_name, item)) %>
<%= content_tag(:li, class: 'active') do %>
<%= link_to(remove_href, class: 'remove') do %>
<%= geoblacklight_icon item.value %>
<%= content_tag(:span, facet_display_value(field_name, item)) %>
<span class="facet-count pull-right"><%= render_facet_count(item.hits) %></span>
<% end %>
<% end %>
<% paginator = facet_paginator(facet_field, display_facet) %>
<% paginator.items.each do |item| -%>
<% if facet_in_params?(field_name, item.value) %>
<% remove_href = search_action_path(search_state.remove_facet_params(field_name, item)) %>
<%= content_tag(:li, class: 'active') do %>
<%= link_to(remove_href, class: 'remove') do %>
<%= geoblacklight_icon item.value %>
<%= content_tag(:span, facet_display_value(field_name, item)) %>
<span class="facet-count pull-right"><%= render_facet_count(item.hits) %></span>
<% end %>
<% else %>
<%= content_tag(:li) do %>
<%= link_to(path_for_facet(field_name, item.value)) do %>
<%= geoblacklight_icon item.value %>
<%= facet_display_value(field_name, item.value) %>
<span class="facet-count pull-right"><%= render_facet_count(item.hits) %></span>
<% end %>
<% end %>
<% else %>
<%= content_tag(:li) do %>
<%= link_to(path_for_facet(field_name, item.value)) do %>
<%= geoblacklight_icon item.value %>
<%= facet_display_value(field_name, item.value) %>
<span class="facet-count pull-right"><%= render_facet_count(item.hits) %></span>
<% end %>
<% end -%>
<% end %>
<% end %>
<% end -%>
<% end %>
6 changes: 3 additions & 3 deletions app/views/catalog/_index_split_default.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<% # header bar for doc items in index view -%>
<%= content_tag :div, class: 'documentHeader row', data: { layer_id: document.id, bbox: document.bounding_box_as_wsen, counter: document_counter} do %>
<% counter = document_counter_with_offset(document_counter) %>
<h3 class="index_title col-xs-12 text-span">
<h3 class="index_title col col-sm-12 text-span">
<span class="document-counter">
<%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
</span>
<%= link_to_document document, document_show_link_field(document), counter: counter, title: document[blacklight_config.index.title_field] %>
</h3>
<div class="col-sm-9 cosl-lg-10">
<div class="col-md-9 cosl-xl-10">
<small>
<%= render partial: 'header_icons', locals: { document: document } %>
<%= geoblacklight_present(:index_fields_display, document) %>
</small>
</div>
<div class="col-sm-3 cosl-lg-2">
<div class="col-md-3 cosl-xl-2">
<div class="thumbnail">
<%= gbl_thumbnail_img(document) %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_results_pagination.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if show_pagination? and @response.total_pages > 1 %>
<div class="row record-padding">
<div class="col-md-12">
<div class="col-lg-12">
<div id="index-pagination" class="pagination">
<%= paginate @response, :theme => 'blacklight' %>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/views/catalog/_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<%= render_hash_as_hidden_fields(search_state.params_for_search().except(:q, :search_field, :qt, :page, :utf8, :model, :rpp, :start)) %>
<%= hidden_field_tag(:search_field, 'all_fields') %>

<span class="input-group">
<div class="input-group">
<label for="q" class="sr-only">search for</label>
<%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.search_field.label'), :class => "search_q q form-control", :id => "q", :autocomplete => "off", autocorrect: "off", autocapitalize: "off",spellcheck: "false", :autofocus => should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: blacklight.suggest_index_path } %>
<span class="input-group-btn">
<button type="submit" class="btn btn-primary search-btn" id="search">
<div class="input-group-append">
<button type="submit" class="btn btn-primary" id="search">
<span class="submit-search-text sr-only">Search</span>
<span class="glyphicon glyphicon-search"></span>
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</span>
</div>
</div>
<% end %>
14 changes: 9 additions & 5 deletions app/views/catalog/_search_form_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
<%= render_hash_as_hidden_fields(search_state.params_for_search().except(:q, :search_field, :qt, :page, :utf8, :model, :rpp, :start)) %>
<%= hidden_field_tag(:search_field, 'all_fields') %>

<span class="input-group">
<div class="input-group">

<span class="input-group-text">
<label for="q" class="sr-only">search for</label>
<%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.search_field.label'), :class => "search_q q form-control", :id => "q", :autocomplete => "off", autocorrect: "off", autocapitalize: "off",spellcheck: "false", :autofocus => should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: search_action_path(action: :suggest) } %>
<span class="input-group-btn">
<button type="submit" class="btn btn-primary search-btn" id="search">
</span>
<span class="input-group-append">
<button type="submit" class="btn btn-primary" id="search">
<span class="submit-search-text sr-only">Search</span>
<span class="glyphicon glyphicon-search"></span>
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</span>
</div>

<% end %>
2 changes: 1 addition & 1 deletion app/views/catalog/_search_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="map-container" class="col-sm-8">
<div id="map-container" class="col-md-8">
<%= content_tag :div, '', id: 'map-results', data: { map: 'index', 'catalog-path'=> search_catalog_path, 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap } %>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/_show_default_viewer_container.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% document ||= @document %>
<div id='viewer-container' class="col-md-12">
<div id='viewer-container' class="col-lg-12">
<%= viewer_container %>
</div>
6 changes: 3 additions & 3 deletions app/views/catalog/downloads.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% document ||= @document %>
<div class="col-sm-12 show-document pagination-search-widgets">
<div class="col-md-12 show-document pagination-search-widgets">
<%= link_to "Back to item", solr_document_path(document), :class => "btn btn-default" %>
</div>

<div class="col-sm-12">
<div class="col-md-12">
<p>The Princeton University Library makes available maps and geospatial data in order to support research, teaching, and private study. Please include the following credit statement in all publications that make use of the data:</p>
<p><%= document['dc_title_s'].gsub(/[[:punct:]]/,'') %>, Maps and Geospatial Data, Princeton University Library.</p>
<div class="col-sm-4">
<div class="col-md-4">
<div class='data-download btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'>
<%= render 'data_download_primary' %>
<%= render 'data_download_secondary' %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/catalog/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="content" class="content col-xs-12 col-sm-4">
<div id="content" class="content col col-sm-12 col-md-4">
<%= render 'search_header' %>
<div id="inner" aria-live="polite">
<%= render 'search_results' %>
Expand All @@ -7,6 +7,6 @@
<div class="overlay">
<div class="sp sp-circle"></div>
</div>
<div id="side-content" class="hidden-xs col-sm-8">
<div id="side-content" class="hidden-xs col-md-8">
<%= render 'search_sidebar' %>
</div>
8 changes: 4 additions & 4 deletions app/views/catalog/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="col-sm-12 show-document">
<div class="col-md-12 show-document">
<%= render 'previous_next_doc' %>
</div>

<div class="col-sm-12">
<div class="col-md-12">
<%= render partial: 'show_header_default', locals: { document: @document } %>
</div>

<div id="item-record" class="col-md-9 col-sm-8 show-document">
<div id="item-record" class="col-lg-9 col-md-8 show-document">

<% @page_title = t('blacklight.search.show.title', :document_title => document_show_html_title, :application_name => application_name).html_safe -%>
<% content_for(:head) { render_link_rel_alternates } -%>
Expand Down Expand Up @@ -34,6 +34,6 @@
</div>
<div id="tools-sidebar" class="col-md-3 col-sm-4 tools-sidebar">
<div id="tools-sidebar" class="col-lg-3 col-md-4 tools-sidebar">
<%= render_document_sidebar_partial %>
</div>
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="col-md-12">
<div class="col-lg-12">
<h2 class="page-heading my-account"><%= I18n.t('blacklight.header_links.account_page') %></h2>
<div class="login--cas">
<%= link_to "Log in with Princeton Net ID", user_cas_omniauth_authorize_path, :class => "btn btn-primary" %>
Expand Down
Loading

0 comments on commit 1304916

Please sign in to comment.