Skip to content

Commit fd3f098

Browse files
committed
wip: display proposals list using cells
1 parent dc0c0c3 commit fd3f098

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

app/cells/decidim/profile_cell.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def user_tabs
104104

105105
def group_tabs
106106
items = [:members].tap do |keys|
107+
# keys.append(:badges, :followers, :proposals, :activity)
107108
keys.append(:badges, :followers, :proposals)
108109
keys << :conversations if manageable_group?
109110
end
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
<h2>app/cells/decidim/proposals/show.erb</h2>
2-
<% proposals.each do |proposal| %>
3-
<h3>title</h3>
4-
<p><%= proposal.title %></p>
5-
<h3>body</h3>
6-
<p><%= proposal.body %></p>
7-
<hr>
1+
<%# see : https://github.com/decidim/decidim/blob/release/0.29-stable/decidim-proposals/app/views/decidim/proposals/proposals/_proposals.html.erb %>
2+
3+
<% if proposals.empty? %>
4+
<%= cell("decidim/announcement", t("decidim.proposals.proposals.proposals.empty")) %>
5+
<% else %>
6+
<div class="flex items-center justify-between">
7+
<h2 class="h5 md:h3 decorator" aria-live="polite" aria-atomic="true"><%= t("count", scope: "decidim.proposals.proposals.index", count: @proposals.count) %></h2>
8+
</div>
9+
10+
11+
<div class="<%= proposals_container_class(@view_mode) %>">
12+
<% @proposals.each do |proposal| %>
13+
<%= render partial: "../views/decidim/proposals/proposals/proposal.html", locals: { proposal: proposal, card_size: card_size_for_view_mode(@view_mode) } %>
14+
<% end %>
15+
</div>
816
<% end %>

app/cells/decidim/proposals_cell.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ class ProposalsCell < Decidim::ViewModel
55
include Decidim::CellsPaginateHelper
66
include Decidim::Core::Engine.routes.url_helpers
77
include Decidim::CardHelper
8+
include Decidim::Proposals::ProposalsHelper
89
# include Decidim::Coauthorable
910

11+
# see https://github.com/decidim/decidim/blob/release/0.29-stable/decidim-proposals/app/controllers/decidim/proposals/proposals_controller.rb
1012
def show
13+
proposals
14+
@view_mode = "list"
1115
render :show
1216
end
1317

0 commit comments

Comments
 (0)