Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix proposal answer templates #84

Merged
merged 3 commits into from
Apr 23, 2024
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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ module ProposalAnswerTemplatesControllerOverride
extend ActiveSupport::Concern

included do
def avaliablity_options
@avaliablity_options = []

Decidim::Component.includes(:participatory_space).where(manifest_name: accepted_components)
.select { |a| a.participatory_space.decidim_organization_id == current_organization.id }.each do |component|
@avaliablity_options.push [formatted_name(component), component.id]
end

@avaliablity_options.sort_by!(&:first)
@avaliablity_options.prepend [t("global_scope", scope: "decidim.templates.admin.proposal_answer_templates.index"), 0]
end

private

def accepted_components
[:proposals, :reporting_proposals]
end
Expand Down

This file was deleted.

Loading
Loading