Skip to content
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

search pagination improvements #236

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions app/views/search/hda.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,28 @@
.myhda_empty
= t 'no_documents_found'

#search-pagination
.pagination
nav
ul.pagination
- if @page != 1
span.previous_page =link_to t('previous'), query: @query, page: @page-1, per_page: @rpp
'
li.page-item
span.page-link = link_to t('previous'), query: @query, page: @page-1, per_page: @rpp

- if @page > 5
=link_to "1", query: @query, page: 1, per_page: @rpp
'
=link_to "2", query: @query, page: 2, per_page: @rpp
'
' ..
-(1..4).each do |p|
- page = @page-(5-p)
- unless page < 1
=link_to page, query: @query, page: page, per_page: @rpp
'
em.current = @page
span.page-link = link_to "1", query: @query, page: 1, per_page: @rpp
span.page-link = link_to "2", query: @query, page: 2, per_page: @rpp

em.current.page-link = ".."

- else
-(1..4).each do |p|
- page = @page-(5-p)
- unless page < 1
span.page-link = link_to page, query: @query, page: page, per_page: @rpp

em.current.page-link = @page
- unless @results.size < @rpp
'
-(1..6).each do |p|
=link_to @page+p, query: @query, rel: "next", page: @page+p, per_page: @rpp
'
span.next_page =link_to t('next'), query: @query, page: @page+1, per_page: @rpp
span.page-link = link_to @page+p, query: @query, rel: "next", page: @page+p, per_page: @rpp

li.page-item
span.page-link = link_to t('next'), query: @query, page: @page+1, per_page: @rpp
13 changes: 13 additions & 0 deletions public/themes/default/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,19 @@ td.align-top {
padding: 1px 4px;
width: auto; }

span.page-link{
padding: 0px !important;
}

span.page-link a{
display: inline-block;
padding: 0.5rem 0.75rem;
}

span.page-link a:hover{
text-decoration: none;
}

#footer {
position: relative;
margin-top: -50px;
Expand Down