Skip to content

Commit

Permalink
Merge pull request #496 from UCLALibrary/URS-478_Create-More_Results-…
Browse files Browse the repository at this point in the history
…card-link-in-gallery-view

Create more results card link in gallery view
  • Loading branch information
pghorpade authored Nov 5, 2019
2 parents 90be08c + 90bfbb4 commit e7cdb10
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Layout/BlockEndNewline:
Exclude:
- 'spec/features/search_catalog_spec.rb'

Lint/RequireParentheses:
Exclude:
- app/helpers/blacklight_helper.rb

Metrics/AbcSize:
Exclude:
- 'app/helpers/blacklight/url_helper_behavior.rb'
Expand Down Expand Up @@ -100,6 +104,11 @@ Style/BlockDelimiters:
Style/IfUnlessModifier:
Exclude:
- 'app/helpers/blacklight/url_helper_behavior.rb'
- app/helpers/blacklight_helper.rb

Style/AndOr:
Exclude:
- app/helpers/blacklight_helper.rb

Style/MethodDefParentheses:
Exclude:
Expand Down
22 changes: 22 additions & 0 deletions app/assets/stylesheets/ursus/_gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
}
}
}
@media screen and (max-width: 1199px) {
#documents.row.gallery {
.gallery-box {
outline: 1px solid $light-gray;
padding: 5px;
height: 200px;
}
.gallery-text {
margin: 10px;
}
}
}
}

@media screen and (max-width: 1199px) {
Expand Down Expand Up @@ -87,3 +99,13 @@
}
}
}

.extra-result-see-more {
a {
border: 1px solid #ddd;
padding: 20px;
font-size: 18px;
display: block;
margin-top: 60px;
}
}
12 changes: 12 additions & 0 deletions app/views/catalog/_index_gallery.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@
</div>
</div>
</div>

<% if document_counter + 1 == current_per_page and @response.total != current_per_page %>
<div class='document col-6 col-sm-6 col-md-6 col-lg-4 extra-result-see-more'>
<% current_next_page = @response.next_page.to_s %>
<%= page_parameters = params.merge(:only_path => false, page: current_next_page) %>
<% page_params = page_parameters['page'] %>
<% per_page_params = page_parameters['per_page'] || 10 %>
<% q_params = page_parameters['q'] %>
<% search_field_params = page_parameters['search_field'] %>
<%= link_to "See More >", "/catalog?page=#{page_params}&per_page=#{per_page_params}&q=#{q_params}&search_field=#{search_field_params}" %>
</div>
<% end %>

0 comments on commit e7cdb10

Please sign in to comment.