If a campaign is done, P2P campaign link is for the nonprofit, not the campaign
This commit is contained in:
parent
d7017db267
commit
0ad9181533
2 changed files with 4 additions and 1 deletions
|
@ -164,6 +164,9 @@ class Campaign < ActiveRecord::Base
|
||||||
(self.end_datetime.to_date - Date.today).to_i
|
(self.end_datetime.to_date - Date.today).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def finished?
|
||||||
|
self.end_datetime && self.end_datetime < Time.now
|
||||||
|
end
|
||||||
|
|
||||||
def child_params
|
def child_params
|
||||||
excluded_for_peer_to_peer = %w(
|
excluded_for_peer_to_peer = %w(
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
|
|
||||||
<% if !@campaign.child_campaign? %>
|
<% if !@campaign.child_campaign? %>
|
||||||
<aside class='u-marginBottom--15 pastelBox--grey'>
|
<aside class='u-marginBottom--15 pastelBox--grey'>
|
||||||
<a class='button u-width--full' target='_blank' if-branded='background-color, dark' href='/peer-to-peer?campaign_id=<%= @peer_to_peer_campaign_param %>'>
|
<a class='button u-width--full' target='_blank' if-branded='background-color, dark' href='<%= @campaign.finished? ? "/peer-to-peer?npo_id=#{@nonprofit.id}" : "/peer-to-peer?campaign_id=#{ @peer_to_peer_campaign_param}" %>'>
|
||||||
Start Your Own Campaign for <%= @nonprofit.name %>
|
Start Your Own Campaign for <%= @nonprofit.name %>
|
||||||
</a>
|
</a>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
Loading…
Reference in a new issue