diff --git a/app/controllers/campaigns_controller.rb b/app/controllers/campaigns_controller.rb index 12fcdefa..4939fdfb 100644 --- a/app/controllers/campaigns_controller.rb +++ b/app/controllers/campaigns_controller.rb @@ -36,7 +36,7 @@ class CampaignsController < ApplicationController @nonprofit = current_nonprofit @url = Format::Url.concat(root_url, @campaign.url) - if @campaign.parent_campaign + if @campaign.child_campaign? @parent_campaign = @campaign.parent_campaign @peer_to_peer_campaign_param = @parent_campaign.id else diff --git a/app/models/campaign.rb b/app/models/campaign.rb index 3185816e..b9a49488 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -179,6 +179,10 @@ class Campaign < ActiveRecord::Base attributes.except(*excluded_for_peer_to_peer) end + def child_campaign? + true if parent_campaign.present? + end + def user_reason_for_supporting if reason_for_supporting.present? reason_for_supporting diff --git a/app/views/campaigns/_settings_modal.html.erb b/app/views/campaigns/_settings_modal.html.erb index d6c39777..cf6dc367 100644 --- a/app/views/campaigns/_settings_modal.html.erb +++ b/app/views/campaigns/_settings_modal.html.erb @@ -4,6 +4,19 @@ <%= render 'common/modal_header', title: 'Campaign Settings' %>
+ <% if @campaign.child_campaign? %> + + + <% else %> + + <% end %> -
- -
- - -
- -

-