Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use the following command in your rails console : `Decidim::User.find_each { |us

**Added**:

- **decidim-admin**: Add pagination to private user list. [\#345](https://github.com/OpenSourcePolitics/decidim/pull/345)
- **decidim-budgets**: Re-introduce vote on budget by number of project.[\#330](https://github.com/OpenSourcePolitics/decidim/pull/330)
- **decidim-debates**: Allow debates to be reported [\#199](https://github.com/OpenSourcePolitics/decidim/pull/199)
- **decidim-proposals**: Allow proposals location to be changed on a map [\#296](https://github.com/OpenSourcePolitics/decidim/pull/296)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module HasPrivateUsers

def index
enforce_permission_to :read, :space_private_user
@private_users ||= privatable_to
.participatory_space_private_users
.page(params[:page])
.per(15)

render template: "decidim/admin/participatory_space_private_users/index"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>

<div class="card-section">
<% if privatable_to.participatory_space_private_users.any? %>
<% if @private_users.any? %>
<div class="table-scroll">
<table class="stack">
<thead>
Expand All @@ -22,7 +22,7 @@
</tr>
</thead>
<tbody>
<% privatable_to.participatory_space_private_users.each do |private_user| %>
<% @private_users.each do |private_user| %>
<tr>
<td>
<%= private_user.user.name %><br />
Expand Down Expand Up @@ -54,6 +54,7 @@
</tbody>
</table>
</div>
<%= paginate @private_users, theme: "decidim" %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,16 @@
end
end
end

describe "when managing more than 15 users" do
let(:participatory_space_private_user) { create_list(:participatory_space_private_user, 16, user: user, privatable_to: participatory_process) }

before do
visit current_path
end

it "render pagination" do
expect(page).to have_css(".pagination")
end
end
end