Skip to content

Commit

Permalink
user_part: Update the user view proposal to display the category fiel…
Browse files Browse the repository at this point in the history
…d as required or not, depending on the admin’s choice
  • Loading branch information
BarbaraOliveira13 committed May 14, 2024
1 parent d871530 commit c1057f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def new
@step = Decidim::Proposals::ProposalsController::STEP1
@proposal ||= Decidim::Proposals::Proposal.new(component: current_component)
@form = form_proposal_model
@form.require_category = current_component.settings.require_category
@form.body = translated_proposal_body_template
@form.attachment = form_attachment_new
end
Expand All @@ -56,6 +57,7 @@ def create
enforce_permission_to :create, :proposal
@step = Decidim::Proposals::ProposalsController::STEP1
@form = form(Decidim::Proposals::ProposalForm).from_params(proposal_creation_params)
@form.require_category = Decidim::SimpleProposal.require_category

@proposal = Decidim::Proposals::Proposal.new(@form.attributes.except(
:user_group_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<% if @form.categories_enabled? %>
<div class="field">
<%= form.categories_select :category_id, @form.categories, include_blank: t("decidim.proposals.proposals.edit.select_a_category") %>
<%= form.categories_select :category_id, @form.categories, include_blank: t("decidim.proposals.proposals.edit.select_a_category")%>
</div>
<% end %>

Expand Down

0 comments on commit c1057f6

Please sign in to comment.