wip
This commit is contained in:
parent
f621d89d51
commit
9d20974abd
4 changed files with 362 additions and 338 deletions
|
@ -34,7 +34,8 @@ class Campaign < ActiveRecord::Base
|
||||||
:receipt_message, # text
|
:receipt_message, # text
|
||||||
:hide_custom_amounts, # boolean
|
:hide_custom_amounts, # boolean
|
||||||
:parent_campaign_id,
|
:parent_campaign_id,
|
||||||
:reason_for_supporting
|
:reason_for_supporting,
|
||||||
|
:default_reason_for_supporting
|
||||||
|
|
||||||
validate :end_datetime_cannot_be_in_past, :on => :create
|
validate :end_datetime_cannot_be_in_past, :on => :create
|
||||||
validates :profile, :presence => true
|
validates :profile, :presence => true
|
||||||
|
@ -177,4 +178,12 @@ class Campaign < ActiveRecord::Base
|
||||||
excluded_for_peer_to_peer.push(customizable_attributes_list)
|
excluded_for_peer_to_peer.push(customizable_attributes_list)
|
||||||
attributes.except(*excluded_for_peer_to_peer)
|
attributes.except(*excluded_for_peer_to_peer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_reason_for_supporting
|
||||||
|
if reason_for_supporting.present?
|
||||||
|
reason_for_supporting
|
||||||
|
else
|
||||||
|
default_reason_for_supporting
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,18 +38,16 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='group'>
|
<div class='group'>
|
||||||
<fieldset class='field col-4'>
|
<fieldset class='field col-12'>
|
||||||
<label>Add a profile image</label>
|
<label>
|
||||||
<div class='image-upload u-margin--0' style='background-image: url("<%= @profile.picture %>");'>
|
Add a profile image
|
||||||
|
</label>
|
||||||
|
<small>Uploading your picture will greatly increase the chances of a successful campaign.</small>
|
||||||
|
<div class='image-upload u-marginTop--15' style='background-image: url("<%= @profile.picture %>");'>
|
||||||
<span><i class='fa fa-image'></i> Upload</span>
|
<span><i class='fa fa-image'></i> Upload</span>
|
||||||
<input type='file' name='profile[picture]' >
|
<input type='file' name='profile[picture]' >
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class='col-right-8'>
|
|
||||||
<label>What's your reason for supporting <%= @campaign.name %>?</label>
|
|
||||||
<textarea rows='4' name='campaign[reason_for_supporting]' placeholder='' required></textarea>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render 'components/forms/submit_button', button_text: 'Next', scope: 'new_p2p_campaign_wiz', branded: true %>
|
<%= render 'components/forms/submit_button', button_text: 'Next', scope: 'new_p2p_campaign_wiz', branded: true %>
|
||||||
|
@ -64,6 +62,13 @@
|
||||||
<!--= log new_p2p_campaign -->
|
<!--= log new_p2p_campaign -->
|
||||||
|
|
||||||
<div class='u-margin--auto'>
|
<div class='u-margin--auto'>
|
||||||
|
<fieldset class='col-right-12'>
|
||||||
|
<label>What's your reason for supporting <%= @campaign.name %>?</label>
|
||||||
|
<small>Be concise and honest about your intentions.</small>
|
||||||
|
|
||||||
|
<textarea class='u-marginTop--15' rows='4' name='campaign[reason_for_supporting]' value='campaign[reason_for_supporting]' required></textarea>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class='group u-marginBottom--0'>
|
<fieldset class='group u-marginBottom--0'>
|
||||||
<label class='u-paddingTop--5'>Goal Amount</label>
|
<label class='u-paddingTop--5'>Goal Amount</label>
|
||||||
<div class='prepend--dollar'>
|
<div class='prepend--dollar'>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddDefaultReasonForSupportingToCampaigns < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :campaigns, :default_reason_for_supporting, :text
|
||||||
|
end
|
||||||
|
end
|
663
db/structure.sql
663
db/structure.sql
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue