Commit fbcb1e60336bcd1ef5b781b9943d59cce5057fcd
1 parent
b46d3e4a
Exists in
master
and in
4 other branches
Display response as a valid content type only when the parent is a proposal
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
lib/proposals_discussion_plugin.rb
... | ... | @@ -17,13 +17,15 @@ class ProposalsDiscussionPlugin < Noosfero::Plugin |
17 | 17 | types = [] |
18 | 18 | parent_id = context.params[:parent_id] || (context.params[:article][:parent_id] unless context.params[:article].nil?) |
19 | 19 | parent = parent_id.present? ? context.profile.articles.find(parent_id) : nil |
20 | - types << ProposalsDiscussionPlugin::Response | |
21 | 20 | types << ProposalsDiscussionPlugin::Discussion |
22 | 21 | types << ProposalsDiscussionPlugin::Topic if parent.kind_of?(ProposalsDiscussionPlugin::Discussion) |
23 | 22 | if parent.kind_of?(ProposalsDiscussionPlugin::Topic) || ( parent.kind_of?(ProposalsDiscussionPlugin::Discussion) && !parent.allow_topics) |
24 | 23 | types << ProposalsDiscussionPlugin::Proposal |
25 | 24 | types << ProposalsDiscussionPlugin::Story |
26 | 25 | end |
26 | + if parent.kind_of?(ProposalsDiscussionPlugin::Proposal) | |
27 | + types << ProposalsDiscussionPlugin::Response | |
28 | + end | |
27 | 29 | types |
28 | 30 | else |
29 | 31 | [ProposalsDiscussionPlugin::Discussion, | ... | ... |