Skip to content

Commit

Permalink
Display meetings count in directory page (decidim#7972)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferblape authored May 10, 2021
1 parent 44de707 commit 6ac3b64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<div class="wrapper">
<div class="row">
<h1 class="section-heading"><%= t(".meetings") %></h1>
<h1 class="section-heading" id="meetings-count">
<%= render partial: "decidim/meetings/meetings/count" %>
</h1>

<%= cell "decidim/meetings/meetings_map", search.results %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var $meetings = $('#meetings');
var $meetingsCount = $('#meetings-count');

$meetings.html('<%= j(render partial: "meetings").strip.html_safe %>');
$meetingsCount.html('<%= j(render partial: "decidim/meetings/meetings/count").strip.html_safe %>');

var $dropdownMenu = $('.dropdown.menu', $meetings);
$dropdownMenu.foundation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
within "#meetings" do
expect(page).to have_css(".card--meeting", count: 6)
end

expect(page).to have_css("#meetings-count", text: "6 MEETINGS")
end

context "when there's a past meeting" do
Expand All @@ -38,6 +40,7 @@
end

expect(page).to have_content(past_meeting.title["en"])
expect(page).to have_css("#meetings-count", text: "1 MEETING")
end
end

Expand Down Expand Up @@ -76,6 +79,7 @@

expect(page).to have_content(assembly_meeting.title["en"])
expect(page).to have_css(".card--meeting", count: 1)
expect(page).to have_css("#meetings-count", text: "1 MEETING")
end
end
end

0 comments on commit 6ac3b64

Please sign in to comment.