Skip to content

Commit

Permalink
Fix scope filters
Browse files Browse the repository at this point in the history
Refs #366
  • Loading branch information
carlobeltrame committed Sep 27, 2023
1 parent 35dd269 commit c31d969
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,13 @@
original '5a3fe3b15410bed17da324a66bfaf71d4d0ca7f3'
-->
<%# Overridden view from decidim, for displaying process groups specially, issue #246 %>
<div class="processes-grid-order-by">
<div class="processes-grid-order-by" id="processes-grid-order-by">
<%= render partial: "order_by_processes" %>
</div>
<%= render partial: "decidim/shared/participatory_space_filters/show" %>

<section id="process-groups" class="row section">
<% participatory_process_groups.each do |process_group| %>
<h1 class="section-heading">
<% if has_landing_page(process_group) %>
<%= link_to translated_attribute(process_group.title), participatory_process_group_path(process_group) %>
<% else %>
<%= translated_attribute(process_group.title) %>
<% end %>
</h1>
<div class="row small-up-1 medium-up-2 large-up-3 card-grid">
<%= render(process_group.participatory_processes.where(id: filtered_processes)) %>
</div>
<% if has_landing_page(process_group) %>
<div class="column">
<%= link_to t("decidim.participatory_processes.index.participatory_process_group.more_info"), participatory_process_group_path(process_group), class: 'button button--sc pull-right' %>
</div>
<% end %>
<div style="clear: both"></div>
<% end %>
<%= render partial: "process_groups" %>
</section>

<section id="processes-grid" class="section row collapse">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<% participatory_process_groups.each do |process_group| %>
<h1 class="section-heading">
<% if has_landing_page(process_group) %>
<%= link_to translated_attribute(process_group.title), participatory_process_group_path(process_group) %>
<% else %>
<%= translated_attribute(process_group.title) %>
<% end %>
</h1>
<div class="row small-up-1 medium-up-2 large-up-3 card-grid">
<%= render(process_group.participatory_processes.where(id: filtered_processes)) %>
</div>
<% if has_landing_page(process_group) %>
<div class="column">
<%= link_to t("decidim.participatory_processes.index.participatory_process_group.more_info"), participatory_process_group_path(process_group), class: 'button button--sc pull-right' %>
</div>
<% end %>
<div style="clear: both"></div>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var $order_by_filters = $('#processes-grid-order-by');
var $process_groups = $('#process-groups');
var $grid = $('#processes-grid');
var $loading = $grid.find('.loading');

$order_by_filters.html('<%= j(render(partial: "decidim/participatory_processes/participatory_processes/order_by_processes", locals: { include_filter: true })).strip.html_safe %>');
$process_groups.html('<%= j(render(partial: "decidim/participatory_processes/participatory_processes/process_groups")) %>')
$grid.find('.card-grid').html('<%= j(render(collection)).strip.html_safe %>');
$order_by_filters.foundation();
$loading.hide();

0 comments on commit c31d969

Please sign in to comment.