Skip to content

Commit

Permalink
Adding pagination to member requests page (#1234)
Browse files Browse the repository at this point in the history
# What it does

Adds pagination for members to the admin -> reports -> member requests
page

# Why it is important

Allows better user experience when viewing membership requests. Resolves
this
[issue](#1213)

# UI Change Screenshot

Before:

![image](https://github.com/chicago-tool-library/circulate/assets/2738059/b896f17a-7e35-4bbd-9ade-b46b026b9a07)

After:

![image](https://github.com/chicago-tool-library/circulate/assets/2738059/314894a2-6c76-4eb5-b6f9-ad5e7681caca)

# Implementation notes

Leveraged existing code in admin -> reports -> membership to add
feature.

# Your bandwidth for additional changes to this PR

I have the time and interest to make additional changes to this PR based
on feedback.
  • Loading branch information
mdecelle authored Jan 13, 2024
1 parent 3ea08ed commit 21caabf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/admin/reports/member_requests_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
module Admin
module Reports
class MemberRequestsController < BaseController
include Pagy::Backend
include MemberOrdering

def index
@members = Member.open.order(index_order)

respond_to do |format|
format.html do
@pagy, @members = pagy_arel(@members, items: 100)
end
end
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/reports/member_requests/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@
<%= tag.div member.desires, class: "responsive-table-cell" %>
<% end %>
</div>

<%== pagy_bootstrap_nav(@pagy) %>
<% end %>

0 comments on commit 21caabf

Please sign in to comment.