Add in create_from_template call
This commit is contained in:
parent
758cbf1134
commit
e378434b30
2 changed files with 5 additions and 3 deletions
|
@ -54,7 +54,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a class="button">Create campaign from template</a>
|
<a class="button">Create campaign from template</a>
|
||||||
<!--= on 'click' (create_campaign '<%= raw(template.create_campaign_params.to_json) %>') -->
|
<!--= on 'click' (create_campaign_from_template '<%= raw(template.create_campaign_params.to_json) %>') -->
|
||||||
|
|
||||||
<a class="button red">Delete template</a>
|
<a class="button red">Delete template</a>
|
||||||
<!--= on 'click' (delete_template <%= template.id %>) -->
|
<!--= on 'click' (delete_template <%= template.id %>) -->
|
||||||
|
|
|
@ -74,10 +74,10 @@ appl.def('delete_template', function(id) {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
appl.def('create_campaign', function(campaign_params) {
|
appl.def('create_campaign_from_template', function(campaign_params) {
|
||||||
appl.def('loading', true)
|
appl.def('loading', true)
|
||||||
|
|
||||||
var url = '/nonprofits/' + app.nonprofit_id + '/campaigns'
|
var url = '/nonprofits/' + app.nonprofit_id + '/campaigns/create_from_template'
|
||||||
var params = new Object
|
var params = new Object
|
||||||
params.campaign = JSON.parse(campaign_params)
|
params.campaign = JSON.parse(campaign_params)
|
||||||
params.campaign.profile_id = app.profile_id
|
params.campaign.profile_id = app.profile_id
|
||||||
|
@ -103,3 +103,5 @@ appl.def('create_campaign', function(campaign_params) {
|
||||||
appl.notify(req.responseText)
|
appl.notify(req.responseText)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue