Skip to content

Commit

Permalink
Merge pull request #222 from Crowdtilt/expired_campaign_options
Browse files Browse the repository at this point in the history
Only show expired campaign options when campaign is expired
  • Loading branch information
liuhenry committed Feb 2, 2014
2 parents eecc423 + 5d0dfe6 commit bd04c5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/admin.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Crowdhoster.admin =

$('#reward-add').on 'click', (e) ->
e.preventDefault()
$('#rewards ul').append('<li><table class="table"><tr><th>Reward</th><th>Number Claimed</th><th>Delete?</th></tr><tr><td><label>Minimum Contribution To Claim</label><div class="currency"><input name="reward[][price]" type="text" /><span style="position:absolute">$</span></div><label>Title</label><input name="reward[][title]" type="text" /><br/><label>Image URL (optional)</label><input placeholder="http://www.host.com/image.jpg" name="reward[][image_url]" type="text" /><br/><label>Description</label><textarea name="reward[][description]"></textarea><br/><label>Estimated Delivery Date (i.e. May 2013)</label><input name="reward[][delivery_date]" type="text" /><br/><label>Number Available (leave blank if unlimited)</label><input name="reward[][number]" type="text" /><label>Collect shipping address for this reward?</label><input name="reward[][collect_shipping_flag]" type="checkbox" checked /><label>Display number of reward claimed after campaign has ended?</label><input name="reward[][include_claimed]" type="checkbox" checked /></td><td>0</td><td><input type="checkbox" name="reward[][delete]" value="delete"/></td></tr></table></li>')
$('#rewards ul').append('<li><table class="table"><tr><th>Reward</th><th>Number Claimed</th><th>Delete?</th></tr><tr><td><label>Minimum Contribution To Claim</label><div class="currency"><input name="reward[][price]" type="text" /><span style="position:absolute">$</span></div><label>Title</label><input name="reward[][title]" type="text" /><br/><label>Image URL (optional)</label><input placeholder="http://www.host.com/image.jpg" name="reward[][image_url]" type="text" /><br/><label>Description</label><textarea name="reward[][description]"></textarea><br/><label>Estimated Delivery Date (i.e. May 2013)</label><input name="reward[][delivery_date]" type="text" /><br/><label>Number Available (leave blank if unlimited)</label><input name="reward[][number]" type="text" /><label>Collect shipping address for this reward?</label><input name="reward[][collect_shipping_flag]" type="checkbox" checked /></td><td>0</td><td><input type="checkbox" name="reward[][delete]" value="delete"/></td></tr></table></li>')

$('.faq.sortable').sortable
stop: (e, ui) ->
Expand Down
10 changes: 7 additions & 3 deletions app/views/admin/campaigns/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@
<div class="reference">
<label>How To Reference a Reward (i.e. reward, perk, option)</label>
<%= f.text_field :reward_reference %>
<label>Display number of rewards claimed after campaign has ended?</label>
<%= f.check_box :include_rewards_claimed %>
<% if @campaign.expiration_date && @campaign.expired? %>
<label>Display number of rewards claimed after campaign has ended?</label>
<%= f.check_box :include_rewards_claimed %>
<% end %>
</div>
<ul>
<% @campaign.rewards.order("price ASC").each do |reward| %>
Expand Down Expand Up @@ -138,8 +140,10 @@
<label>Collect shipping address for this reward?</label>
<input name="reward[][collect_shipping_flag]" type="checkbox" <% if reward.collect_shipping_flag %>checked="checked"<% end %>/>
<label>Display number of reward claimed after campaign has ended?</label>
<% if @campaign.expiration_date && @campaign.expired? %>
<input name="reward[][include_claimed]" type="checkbox" <% if reward.include_claimed %>checked="checked"<% end %>/>
<input type="hidden" name="reward[][id]" value="<%= reward.id %>"/>
<% end %>
</td>
<td><%= reward.payments.length %></td>
<td>
Expand Down Expand Up @@ -342,7 +346,7 @@
<label>Activate payments and launch your campaign</label>
<%= f.check_box :production_flag %>
<% else %>
You must set up your payment processor before activating payments and launching your campaign. <br><br>Visit "Payment Settings" from the admin menu to do this.
You must set up your payment processor before activating payments and launching your campaign. <br><br>Visit <%= link_to "Payment Settings", admin_bank_account_path %> from the admin menu to do this.
<% end %>
<% else %>
<p class="explanation">You have activated payments for this campaign, which means transactions WILL be processed. This cannot be undone for this campaign. If you activated payments by mistake, we recommend ending and un-publishing this campaign and creating a new one.</p>
Expand Down

0 comments on commit bd04c5e

Please sign in to comment.