Skip to content

Commit

Permalink
remove extra code, override controller
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Apr 23, 2024
1 parent 59ead81 commit b23aabe
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 574 deletions.

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 = []
@avaliablity_options.push [t("global_scope", scope: "decidim.templates.admin.proposal_answer_templates.index"), 0]

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)
end

private

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

This file was deleted.

Loading

0 comments on commit b23aabe

Please sign in to comment.