diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 271f922..6844079 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -91,7 +91,7 @@ $(document).ready(function() { // this should be pulled eventually from actual information // but for now using a placeholder as a ui proof of concept function newTextArea(number, data) { - var textarea = $(''); + var textarea = $(''); var text = data["novel"] + "\n"; text += data["display"] + "\n"; text += "Unique words: " + data["unique_words"] + "\n"; diff --git a/app/assets/stylesheets/style.scss.erb b/app/assets/stylesheets/style.scss.erb index 794a2b3..75d2714 100644 --- a/app/assets/stylesheets/style.scss.erb +++ b/app/assets/stylesheets/style.scss.erb @@ -589,3 +589,74 @@ pre code { */ blockquote {font-size: 1em;} + +/* a11y changes */ + +a { + text-decoration: underline; +} + +a:hover { + text-decoration-thickness: 2px; +} + +a.btn, +a.btn:hover { + text-decoration: none; +} + +.btn { + white-space: initial; +} + +.back-to-top a { + background: #fff; + text-decoration: none; + font-weight: 500; + border: solid 1px $gray-light; + bottom: 0; + box-shadow: 0px 0px 5px 3px rgba($gray-dark,0.3); + padding: .5rem 2rem 0.5rem 1.25rem; // .1em 1em .3em 1em; + position: fixed; + right: 2%; + z-index: 1000; + + &:hover { + color: #000; + background-color: $gray-light; + } + + &:after { + content: "\2191"; + position: relative; + top: -1px; + left: 6px; + } +} + +// sr-only with clip instead of position: absolute +.sr-only-clip { + clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ + clip: rect(1px, 1px, 1px, 1px); /* other legacy browsers */ + clip-path: inset(50%); /* modern browsers */ + border: 0; + display: inline-block; + height: 1px; + margin: 0; + padding: 0; + overflow: hidden; + white-space: nowrap; + width: 1px; +} + +// clip-path only, no display style +.sr-only-clip-path { + border: 0; + clip-path: inset(50%); + height: 1px; + margin: 0; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; +} \ No newline at end of file diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index d416c75..671948a 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -14,6 +14,18 @@ def search @docs = $solr.query(options) @total_pages = @docs[:pages] @facets = $solr.get_facets(options) + # add search terms and filters to page title + title_facets = Facets.facet_list.map(&:to_s) << "page" + param_keys = params.keys + if params["qtext"].present? && param_keys.intersect?(title_facets) + @title = "Search Results: \"#{params["qtext"]}\" - #{display_facets(params)}" + elsif params["qtext"].present? + @title = "Search Results: \"#{params["qtext"]}\"" + elsif param_keys.intersect?(title_facets) + @title = "Search Results: #{display_facets(params)}" + else + @title = "Search" + end end @@ -44,4 +56,8 @@ def create_search_options(aParams) end return options end + + def display_facets(params) + params.except(:action,:sort,:controller,:qfield,:qtext,:commit,:rows).values.compact_blank.join(" / ") + end end \ No newline at end of file diff --git a/app/views/frequencies/index.html.erb b/app/views/frequencies/index.html.erb index c2e9237..1d674ae 100644 --- a/app/views/frequencies/index.html.erb +++ b/app/views/frequencies/index.html.erb @@ -7,25 +7,25 @@ diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4974339..d725909 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - + - Austen + <% if @title.present? %><%= @title %> | <% end %>Austen Said @@ -26,8 +26,12 @@ - -
+ + Skip to main content + + +
+
+ -
+
<%= yield %> -
+ - + +
diff --git a/app/views/search/_facet_panel.html.erb b/app/views/search/_facet_panel.html.erb index 80744d0..45046d4 100644 --- a/app/views/search/_facet_panel.html.erb +++ b/app/views/search/_facet_panel.html.erb @@ -9,8 +9,12 @@ <% selected = facet_selected?(facet_type, label) %> <% display = label.length > 0 ? label : "No label" %>
  • > - <%= link_to display, search_path(facet_link(facet_type, label)) %> - <%= num %> + <%= link_to display, search_path(facet_link(facet_type, label)) %>: + <% if (num != 1) %> + <%= num %><%= num %> results + <% else %> + <%= num %><%= num %> results + <% end %> <% if selected %> <%= link_to search_path(remove_facet(facet_type)) do %> diff --git a/app/views/search/search.html.erb b/app/views/search/search.html.erb index 2877ad3..b6cc2da 100644 --- a/app/views/search/search.html.erb +++ b/app/views/search/search.html.erb @@ -119,7 +119,10 @@ <% end %>
  • - <%= paginator(@total_pages, 3) %> +

    Pagination

    +
    @@ -158,7 +161,10 @@
    - <%= paginator(@total_pages, 3) %> +

    Bottom Pagination

    +