Skip to content

Commit

Permalink
Overwrite Bootstrap Link Renderer for WillPaginate
Browse files Browse the repository at this point in the history
Without this fix, the new will_paginate version is not compatible with the old version of bootstrap-will_paginate. This issue is also tracked here: mislav/will_paginate#649

Fixes CODEOCEAN-QK
  • Loading branch information
MrSerth committed Jun 14, 2023
1 parent 677289e commit d1a0012
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/initializers/monkey_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ def average
end
end
end

module WillPaginate
module ActionView
class Bootstrap4LinkRenderer
def previous_or_next_page(page, text, classname, aria_label = nil)
tag :li, link(text, page || '#', class: 'page-link', 'aria-label': aria_label), class: [(classname[0..3] if @options[:page_links]), (classname if @options[:page_links]), ('disabled' unless page), 'page-item'].join(' ')
end
end
end
end
7 changes: 7 additions & 0 deletions spec/features/request_for_comments_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@
visit(request_for_comments_path)
expect(page.find_by_id('q_submission_study_group_id_in')).not_to be_nil
end

it 'works with the pagination' do
submission = create(:submission)
create_list(:rfc, 25, submission:, exercise: submission.exercise)
visit(request_for_comments_path)
expect(page).to have_css('ul.pagination')
end
end

0 comments on commit d1a0012

Please sign in to comment.