Skip to content

Commit

Permalink
Remove the application name from an h1, and bump up page titles (and …
Browse files Browse the repository at this point in the history
…other headers) as appropriate
  • Loading branch information
cbeer committed Apr 2, 2018
1 parent a79ddeb commit a43a965
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 49 deletions.
25 changes: 12 additions & 13 deletions app/views/bookmarks/index.html.erb
@@ -1,21 +1,20 @@
<% @page_title = t('blacklight.bookmarks.page_title', :application_name => application_name) %>

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

<%- if current_or_guest_user.blank? -%>
<%- if current_or_guest_user.blank? -%>

<h3 class='section-heading'><%= t('blacklight.bookmarks.need_login') %></h3>
<h2 class='section-heading'><%= t('blacklight.bookmarks.need_login') %></h2>

<%- elsif @response.documents.blank? -%>
<%- elsif @response.documents.blank? -%>

<h3 class='section-heading'><%= t('blacklight.bookmarks.no_bookmarks') %></h3>
<% else %>
<%= render 'sort_and_per_page' %>
<%= render partial: 'tools', locals: { document_list: @response.documents } %>
<%= render_document_index %>
<%= render 'results_pagination' %>
<% end %>
<h2 class='section-heading'><%= t('blacklight.bookmarks.no_bookmarks') %></h2>
<% else %>
<%= render 'sort_and_per_page' %>
<%= render partial: 'tools', locals: { document_list: @response.documents } %>
<h2 class='section-heading sr-only'><%= t('blacklight.bookmarks.list_title') %></h2>
<%= render_document_index %>
<%= render 'results_pagination' %>
<% end %>
</div>

8 changes: 4 additions & 4 deletions app/views/catalog/_citation.html.erb
@@ -1,20 +1,20 @@
<% @documents.each do |document| %>

<h3 class="modal-title"><%= document_heading(document) %></h3>
<h1 class="modal-title"><%= document_heading(document) %></h1>

<% if document.respond_to?(:export_as_mla_citation_txt) %>
<h4><%= t('blacklight.citation.mla') %></h4>
<h2><%= t('blacklight.citation.mla') %></h2>
<%= document.send(:export_as_mla_citation_txt).html_safe %><br/><br/>
<% end %>
<% if document.respond_to?(:export_as_apa_citation_txt) %>
<h4><%= t('blacklight.citation.apa') %></h4>
<h2><%= t('blacklight.citation.apa') %></h2>
<%= document.send(:export_as_apa_citation_txt).html_safe %><br/><br/>
<% end %>
<%- if document.respond_to?(:export_as_chicago_citation_txt) -%>
<h4><%= t('blacklight.citation.chicago') %></h4>
<h2><%= t('blacklight.citation.chicago') %></h2>
<%= document.send(:export_as_chicago_citation_txt).html_safe %>
<%- end -%>
Expand Down
2 changes: 2 additions & 0 deletions app/views/catalog/_constraints.html.erb
@@ -1,5 +1,7 @@
<% if query_has_constraints? %>
<div id="appliedParams" class="clearfix constraints-container">
<h2 class="sr-only"><%= t('blacklight.search.search_contraints_header') %></h2>

<%=link_to t('blacklight.search.start_over'), start_over_path, class: "catalog_startOverLink btn btn-primary" %>
<span class="constraints-label sr-only"><%= t('blacklight.search.filters.title') %></span>
<%= render_constraints(params) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_did_you_mean.html.erb
@@ -1,5 +1,5 @@
<% if should_show_spellcheck_suggestions? @response %>
<div id="spell">
<h4 class="suggest"><em><%= t('blacklight.did_you_mean', :options => safe_join(@response.spelling.words.map { |word| link_to_query(word) }, " #{t('blacklight.or')} ")).html_safe %></em></h4>
<h3 class="suggest"><em><%= t('blacklight.did_you_mean', :options => safe_join(@response.spelling.words.map { |word| link_to_query(word) }, " #{t('blacklight.or')} ")).html_safe %></em></h3>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/catalog/_group.html.erb
@@ -1,7 +1,7 @@
<% # container for all groups in index view -%>
<div id="groups">
<%- @response.groups.each do |g| %>
<h3 class="group-key"><%= g.key %></h3>
<h2 class="group-key"><%= g.key %></h2>
<div class="grouped-documents">
<%= render_document_index g.docs %>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/catalog/_home_text.html.erb
@@ -1,16 +1,16 @@
<div class="jumbotron text-center">
<h2 class="jumbotron-heading"><%= t('blacklight.welcome') %></h2>
<h1 class="jumbotron-heading"><%= t('blacklight.welcome') %></h1>

<p class="lead">Blacklight is a multi-institutional open-source collaboration building a better discovery platform framework.</p>

<p>
<%= link_to 'Read the Documentation', 'https://github.com/projectblacklight/blacklight/wiki', class: 'btn btn-primary' %>
<%= link_to 'See Examples', 'http://projectblacklight.org', class: 'btn btn-secondary' %>
</p>
</div>

<div id="getting-started">
<h3>Here’s how to get started customizing your application:</h3>
<h2>Here’s how to get started customizing your application:</h2>

<p>There are many ways to override specific behaviors and views in Blacklight. Because Blacklight is distributed as a Rails engine-based gem, all customization of Blacklight behavior should be done within your application by overriding Blacklight-provided behaviors with your own.</p>

Expand All @@ -31,7 +31,7 @@

<%# This is the same panel shown in the Rails welcome template %>
<div id="about" class="card">
<h3 class='card-header collapsed collapse-toggle' data-toggle="collapse" data-target="#about-content"><a href="/rails/info/properties">About your application&rsquo;s environment</a></h3>
<h2 class='card-header collapsed collapse-toggle' data-toggle="collapse" data-target="#about-content"><a href="/rails/info/properties">About your application&rsquo;s environment</a></h2>
<div id="about-content" class="card-block collapse"></div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/catalog/_search_results.html.erb
@@ -1,5 +1,3 @@
<h2 class="sr-only top-content-title"><%= t('blacklight.search.search_results_header') %></h2>

<% @page_title = t('blacklight.search.page_title.title', :constraints => render_search_to_page_title(params), :application_name => application_name) %>
<% content_for(:head) do -%>
Expand All @@ -10,6 +8,8 @@
<% end %>
<% content_for(:container_header) do -%>
<h1 class="sr-only top-content-title"><%= t('blacklight.search.header') %></h1>

<%= render 'constraints' %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_show_tools.html.erb
Expand Up @@ -10,7 +10,7 @@
<% if show_doc_actions? %>
<div class="card show-tools">
<div class="card-header">
<%= t('blacklight.tools.title') %>
<h2 class="mb-0 h6"><%= t('blacklight.tools.title') %></h2>
</div>

<ul class="list-group list-group-flush">
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_zero_results.html.erb
Expand Up @@ -5,7 +5,7 @@
<li><%= t 'blacklight.search.zero_results.use_fewer_keywords' %></li>

<%- if params[:q] and params[:search_field] and params[:search_field] != blacklight_config.default_search_field.try(:key) -%>
<li><%= t 'blacklight.search.zero_results.search_fields', :search_fields => search_field_label(params) %> -
<li><%= t 'blacklight.search.zero_results.search_fields', :search_fields => search_field_label(params) %> -
<%= link_to t('blacklight.search.zero_results.search_everything', field: blacklight_config.default_search_field.label), url_for(search_state.params_for_search(search_field: blacklight_config.default_search_field.key)) %>
</li>
<%- end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/citation.js.erb
@@ -1,5 +1,5 @@
<div class="modal-header">
<h3><%= t('blacklight.tools.citation') %></h3>
<h1><%= t('blacklight.tools.citation') %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
</button>
Expand Down
4 changes: 2 additions & 2 deletions app/views/catalog/facet.html.erb
Expand Up @@ -3,7 +3,7 @@
</div>

<div class="modal-header">
<h3 class="modal-title"><%= facet_field_label(@facet.key) %></h3>
<h1 class="modal-title"><%= facet_field_label(@facet.key) %></h1>
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
<span aria-hidden="true">&times;</span>
</button>
Expand All @@ -15,7 +15,7 @@
<%= render_facet_limit(@display_facet, layout: false) %>
</div>
</div>

<div class="modal-footer">

<div class="facet-pagination bottom">
Expand Down
8 changes: 4 additions & 4 deletions app/views/layouts/blacklight.html.erb
@@ -1,11 +1,11 @@
<% content_for(:content) do %>
<% if content_for? :sidebar %>
<section id="sidebar" class="<%= sidebar_classes %>">
<%= content_for(:sidebar) %>
<section id="content" class="<%= main_content_classes %> order-last">
<%= yield %>
</section>

<section id="content" class="<%= main_content_classes %>">
<%= yield %>
<section id="sidebar" class="<%= sidebar_classes %> order-first">
<%= content_for(:sidebar) %>
</section>
<% else %>
<section class="col-md-12">
Expand Down
6 changes: 3 additions & 3 deletions app/views/search_history/index.html.erb
@@ -1,16 +1,16 @@
<% @page_title = t('blacklight.search_history.page_title', :application_name => application_name) %>

<div id="content" class="col-md-12">
<h2 class='page-heading'><%= t('blacklight.search_history.title') %></h2>
<h1 class='page-heading'><%= t('blacklight.search_history.title') %></h1>
<% if @searches.blank? %>
<h3 class='section-heading'><%= t('blacklight.search_history.no_history') %></h3>
<h2 class='section-heading'><%= t('blacklight.search_history.no_history') %></h2>
<% else %>
<%= link_to t('blacklight.search_history.clear.action_title'),
blacklight.clear_search_history_path,
method: :delete,
data: { confirm: t('blacklight.search_history.clear.action_confirm') },
class: 'btn btn-danger float-md-right' %>
<h3 class='section-heading'><%= t('blacklight.search_history.recent') %></h3>
<h2 class='section-heading'><%= t('blacklight.search_history.recent') %></h2>
<table class="table table-striped search-history">
<% @searches.each_with_index do |search,index| %>
<tr id="document_<%= index + 1 %>">
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_header_navbar.html.erb
@@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-md navbar-dark bg-dark topbar" role="navigation">
<div class="<%= container_classes %>">
<h1 class="mb-0 navbar-brand"><%= link_to application_name, root_path %></h1>
<%= link_to application_name, root_path, class: 'mb-0 navbar-brand' %>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#user-util-collapse" aria-controls="user-util-collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.de.yml
Expand Up @@ -125,7 +125,8 @@ de:
title: '%{constraints} - %{application_name} Suchergebnisse'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} ausgewählt'
search_results_header: 'Suchen'
header: 'Suchen'
search_contraints_header: 'Suchen'
search_results: 'Suchergebnisse'
errors:
request_error: "Entschuldigung, Ich habe dein Suche nicht verstanden."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.en.yml
Expand Up @@ -128,7 +128,8 @@ en:
title: '%{constraints} - %{application_name} Search Results'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} selected'
search_results_header: 'Search Constraints'
header: 'Search'
search_contraints_header: 'Search Constraints'
search_results: 'Search Results'
errors:
request_error: "Sorry, I don't understand your search."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.es.yml
Expand Up @@ -125,7 +125,8 @@ es:
title: '%{constraints} - %{application_name} Resultados de la búsqueda'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} seleccionado'
search_results_header: 'Buscar'
header: 'Buscar'
search_constraints_header: 'Buscar'
search_results: 'Resultados de la búsqueda'
errors:
request_error: "Lo siento, no entiendo esta búsqueda"
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.fr.yml
Expand Up @@ -130,7 +130,8 @@ fr:
title: '%{constraints} - %{application_name} Résultats de recherche'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} sélectionné'
search_results_header: 'Recherche'
header: 'Recherche'
search_constraints_header: 'Recherche'
search_results: 'Résultats de recherche'
errors:
request_error: "Pardon, nous n'avons pas compris votre recherche."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.hu.yml
Expand Up @@ -128,7 +128,8 @@ hu:
title: '%{constraints} - %{application_name} Keresés eredményei'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} kiválasztva'
search_results_header: 'Keresés feltételei'
header: 'Keresés'
search_constraints_header: 'Keresés feltételei'
search_results: 'Keresés eredményei'
errors:
request_error: "Elnézést, nem tudom értelmezni a keresést."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.it.yml
Expand Up @@ -125,7 +125,8 @@ it:
title: '%{constraints} - %{application_name} Risultati della ricerca'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} selezionato'
search_results_header: 'Ricerca'
header: 'Ricerca'
search_constraints_header: 'Ricerca'
search_results: 'Risultati della ricerca'
errors:
request_error: "La richiesta non è comprensibile."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.nl.yml
Expand Up @@ -128,7 +128,8 @@ nl:
title: '%{constraints} - %{application_name} Zoek resultaten'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} geselecteerd'
search_results_header: 'Zoek filters'
header: 'Zoek'
search_constraints_header: 'Zoek filters'
search_results: 'Zoek resultaten'
errors:
request_error: "Sorry, ik kon uw zoekopdracht niet begrijpen."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.pt-BR.yml
Expand Up @@ -125,7 +125,8 @@ pt-BR:
title: '%{constraints} - %{application_name} Resultado da Busca'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} selecionado'
search_results_header: 'Busca'
header: 'Busca'
search_constraints_header: 'Busca'
search_results: 'Resultados da Busca'
errors:
request_error: "Desculpe, Eu não compreendi sua busca."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.sq.yml
Expand Up @@ -128,7 +128,8 @@ sq:
title: '%{constraints} - %{application_name} Rezultatet e kërkimit'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} zgjedhura'
search_results_header: 'Kufizimet e kërkimit'
header: 'Kërkimit'
search_constraints_header: 'Kufizimet e kërkimit'
search_results: 'Rezultatet e kërkimit'
errors:
request_error: "Na vjen keq, unë nuk e kuptoj kërkimin tuaj."
Expand Down
3 changes: 2 additions & 1 deletion config/locales/blacklight.zh.yml
Expand Up @@ -128,7 +128,8 @@ zh:
title: '%{constraints} - %{application_name} 搜索结果'
constraint: '%{label}: %{value}'
many_constraint_values: '%{values} 已选'
search_results_header: '搜索条件'
header: ''
search_constraints_header: '搜索条件'
search_results: '搜索结果'
errors:
request_error: "抱歉,我不明白你要找什么。"
Expand Down
2 changes: 1 addition & 1 deletion spec/views/catalog/facet.html.erb_spec.rb
Expand Up @@ -14,7 +14,7 @@
it "has the facet title" do
allow(view).to receive(:render_facet_limit)
render
expect(rendered).to have_selector 'h3', text: "Facet title"
expect(rendered).to have_selector 'h1', text: "Facet title"
end

it "renders facet pagination" do
Expand Down

0 comments on commit a43a965

Please sign in to comment.