-
Notifications
You must be signed in to change notification settings - Fork 0
USE-61: Implement page chrome around the results list #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
357f929
c90fb64
8e562be
6ce0144
eeb2775
dc82063
b2dd54a
27fed12
ddd2743
14e05d2
1a74417
c4b3b04
7f462e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| @mixin buttonSecondary { | ||
| border: 1px solid $color-blue-500; | ||
| border-radius: 0; | ||
| display: inline-block; | ||
| padding: 6px 12px; | ||
| text-decoration: none; | ||
| font-size: 1.6rem; | ||
| font-weight: $fw-medium; | ||
|
|
||
| &:hover { | ||
| background-color: $color-blue-25; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| <% return if @pagination.nil? %> | ||
|
|
||
| <nav class="pagination-container" aria-label="Pagination"> | ||
| <div class="first"> | ||
| <%= first_url(@enhanced_query) %> | ||
| </div> | ||
| <div class="previous"> | ||
| <%= prev_url(@enhanced_query) %> | ||
| </div> | ||
| <div class="current"><%= @pagination[:start] %> - <%= @pagination[:end] %> of <%= number_with_delimiter(@pagination[:hits]) %></div> | ||
| <div class="next"> | ||
| <%= next_url(@enhanced_query) %> | ||
| </div> | ||
| </nav> | ||
| <div id="pagination"> | ||
| <nav class="pagination-container" aria-label="Pagination"> | ||
| <div class="previous"> | ||
| <%= prev_url(@enhanced_query) %> | ||
| </div> | ||
| <div class="center-elements"> | ||
| <div class="first"> | ||
| <%= first_url(@enhanced_query) %> | ||
| </div> | ||
| <div class="current"><span><%= @pagination[:start] %> - <%= @pagination[:end] %> of <%= number_with_delimiter(@pagination[:hits]) %></span></div> | ||
| </div> | ||
| <div class="next"> | ||
| <%= next_url(@enhanced_query) %> | ||
| </div> | ||
| </nav> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <div id="callout-wrapper"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking: This appears to be using 4 spaces instead of two whereas most of our views are using 2 spaces for indents.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated my VS code to default to tabs with 2 spaces. Those were net new files so they used the 4 space default. |
||
| <aside class="result-callout"> | ||
| <i></i> | ||
| <div> | ||
| <h4>Refine your search</h4> | ||
| <p>Use advanced search features to expand or filter your search.</p> | ||
| <a href="#">Search Primo</a> | ||
| </div> | ||
| </aside> | ||
| <aside class="result-callout"> | ||
| <i></i> | ||
| <div> | ||
| <h4>Can’t find a book?</h4> | ||
| <p>If we don’t own it you can often request it from another library.</p> | ||
| <a href="#">Search WorldCat</a> | ||
| </div> | ||
| </aside> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <aside id="results-sidebar"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking: This appears to be using 4 spaces instead of two whereas most of our views are using 2 spaces for indents.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated my VS code to default to tabs with 2 spaces. Those were net new files so they used the 4 space default. |
||
| <div> | ||
| <i></i> | ||
| <div> | ||
| <h4>Were these results useful?</h4> | ||
| <p>Your feedback can help shape the quality and relevance of our search results.</p> | ||
| <a href="#">Send feedback</a> | ||
| </div> | ||
| </div> | ||
| <div> | ||
| <i></i> | ||
| <div> | ||
| <h4>Get help from expert librarians</h4> | ||
| <p>From thesis research to course reserves, we can help you find what you need.</p> | ||
| <a href="#">Ask us</a> | ||
| </div> | ||
| </div> | ||
| </aside> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,46 +10,50 @@ | |
| <%= render(partial: 'trigger_tacos') if tacos_enabled? %> | ||
|
|
||
| <%= turbo_frame_tag "search-results", data: { turbo_action: "advance" } do %> | ||
| <div class="layout-3q1q layout-band"> | ||
| <main id="results" class="col3q wrap-results"> | ||
| <% if @show_primo_continuation %> | ||
| <%= render partial: 'search/primo_continuation' %> | ||
| <% elsif @results.present? && @errors.blank? %> | ||
| <h2 class="results-context"><%= results_summary(@pagination[:hits]) %></h2> | ||
| <p class="results-context-description">From all MIT Libraries sources</p> | ||
| <ol class="results-list" start="<%= @pagination[:start] %>"> | ||
| <% case @active_tab %> | ||
| <% when 'primo' %> | ||
| <%= render(partial: 'search/result_primo', collection: @results, as: :result) %> | ||
| <% when 'timdex' %> | ||
| <%= render(partial: 'search/result', collection: @results, as: :result) %> | ||
| <% when 'all' %> | ||
| <% @results.each do |result| %> | ||
| <% if result[:source] == 'Primo' %> | ||
| <%= render(partial: 'search/result_primo', locals: { result: result }) %> | ||
| <% else %> | ||
| <%= render(partial: 'search/result', locals: { result: result }) %> | ||
| <div id="results-section"> | ||
| <% if @show_primo_continuation %> | ||
| <%= render partial: 'search/primo_continuation' %> | ||
| <% elsif @results.present? && @errors.blank? %> | ||
| <h2 class="results-context"><%= results_summary(@pagination[:hits]) %></h2> | ||
| <p class="results-context-description">From all MIT Libraries sources</p> | ||
| <div id="results-layout-wrapper"> | ||
| <main id="results"> | ||
| <ol class="results-list" start="<%= @pagination[:start] %>"> | ||
| <% case @active_tab %> | ||
| <% when 'primo' %> | ||
| <%= render(partial: 'search/result_primo', collection: @results, as: :result) %> | ||
| <% when 'timdex' %> | ||
| <%= render(partial: 'search/result', collection: @results, as: :result) %> | ||
| <% when 'all' %> | ||
| <% @results.each do |result| %> | ||
| <% if result[:source] == 'Primo' %> | ||
| <%= render(partial: 'search/result_primo', locals: { result: result }) %> | ||
| <% else %> | ||
| <%= render(partial: 'search/result', locals: { result: result }) %> | ||
| <% end %> | ||
| <% end %> | ||
| <% end %> | ||
| <% end %> | ||
| </ol> | ||
| <% elsif @errors.blank? %> | ||
| <div class="no-results"> | ||
| <p class="hd-2">No results found for your search</p> | ||
| </div> | ||
| </ol> | ||
| <%= render partial: "results_callouts" %> | ||
| <% elsif @errors.blank? %> | ||
| <main id="results"> | ||
| <div class="no-results"> | ||
| <p class="hd-2">No results found for your search</p> | ||
| </div> | ||
| </main> | ||
|
||
| <% end %> | ||
| </main> | ||
| <% if @results.present? %> | ||
| <%= render partial: "results_sidebar" %> | ||
| <% end %> | ||
| </main> | ||
| </div> | ||
| </div> | ||
|
|
||
| <% if @results.present? %> | ||
| <div id="pagination"> | ||
| <%= render partial: "pagination" %> | ||
| </div> | ||
| <%= render partial: 'shared/ask', locals: { display: 'view-md' } %> | ||
| <%= render partial: "pagination" %> | ||
| <% end %> | ||
| <% end %> | ||
|
|
||
| <%= render partial: 'shared/ask', locals: { display: 'aside' } if @results.blank? %> | ||
| </div> | ||
|
|
||
| <%= javascript_include_tag "filters" %> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: On wide screens it feels a bit odd to have the pagination not align with the results and instead align with the fill width content that includes the right side callouts. Since the right side callouts are often not-visible at the same time as the pagination it looks uneven when the intent seems to be to justified pagination.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just caught up on Slack and you noted there that this is known.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This irks me, but I think it's a practical starting point for the short term until we have the stepped pagination ("Show X more")