Skip to content
Open
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
2 changes: 1 addition & 1 deletion app/controllers/campaigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def check_published
end

def check_exp
if @campaign.expired?
if @campaign.expired? && [email protected]_closed_project_payment?
redirect_to campaign_home_url(@campaign), :flash => { :error => "Campaign is expired!" }
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/campaign.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Campaign < ActiveRecord::Base
:stats_number_of_contributions, :stats_raised_amount, :stats_tilt_percent,
:stats_unique_contributors, :published_flag, :collect_shipping_flag, :production_flag,
:include_rewards, :reward_reference, :collect_additional_info, :additional_info_label,
:include_comments, :comments_shortname, :include_rewards_claimed
:include_comments, :comments_shortname, :include_rewards_claimed, :accept_closed_project_payment

attr_accessor :main_image_delete, :video_placeholder_delete, :facebook_image_delete

Expand Down
6 changes: 5 additions & 1 deletion app/views/admin/campaigns/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@
<label><i class="icon-ok"></i> Payments activated</label>
<% end %>
</div>

<div class="field clearfix">
<p class="explanation">Accept payments after campaign has tilted and expired</p>
<label>Force Payment Acceptance?</label>
<%= f.check_box :accept_closed_project_payment %>
</div>
</fieldset>

<% if @campaign.persisted? %>
Expand Down
24 changes: 18 additions & 6 deletions app/views/theme/views/campaign.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,15 @@
</ul>
</div>
<% end %>
<span class="blue_button expired">
<%= @campaign.primary_call_to_action_button %>
</span>
<% if @campaign.accept_closed_project_payment %>
<a href="<%= url_for checkout_amount_path(@campaign) %>" class="blue_button" id="main_cta">
<%= @campaign.primary_call_to_action_button %>
</a>
<% else %>
<span class="blue_button expired">
<%= @campaign.primary_call_to_action_button %>
</span>
<% end %>
<% else %>
<a href="<%= url_for checkout_amount_path(@campaign) %>" class="blue_button" id="main_cta">
<%= @campaign.primary_call_to_action_button %>
Expand Down Expand Up @@ -200,9 +206,15 @@
<div><%= raw(@campaign.secondary_call_to_action_description) %></div>
<div class="center">
<% if @campaign.expired? %>
<span class="blue_button expired">
<%= @campaign.secondary_call_to_action_button %>
</span>
<% if @campaign.accept_closed_project_payment %>
<a href="<%= url_for checkout_amount_path(@campaign) %>" class="blue_button" id="secondary_cta">
<%= @campaign.secondary_call_to_action_button %>
</a>
<% else %>
<span class="blue_button expired">
<%= @campaign.secondary_call_to_action_button %>
</span>
<% end %>
<% else %>
<a href="<%= url_for checkout_amount_path(@campaign) %>" class="blue_button" id="secondary_cta">
<%= @campaign.secondary_call_to_action_button %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddAcceptClosedProjectPaymentToCampaigns < ActiveRecord::Migration
def change
add_column :campaigns, :accept_closed_project_payment, :boolean
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20140116122844) do
ActiveRecord::Schema.define(:version => 20140118102307) do

create_table "campaigns", :force => true do |t|
t.string "name"
Expand Down Expand Up @@ -71,6 +71,7 @@
t.boolean "include_comments", :default => false, :null => false
t.string "comments_shortname"
t.boolean "include_rewards_claimed"
t.boolean "accept_closed_project_payment"
end

add_index "campaigns", ["slug"], :name => "index_campaigns_on_slug", :unique => true
Expand Down