Commit 853ce5307f2cddd9c3cfe08778aaa21fa47a0cbf

Authored by Victor Costa
1 parent 8e9b94ba

Fix new proposal

Showing 2 changed files with 4 additions and 4 deletions   Show diff stats
js/handlebars-helpers.js
@@ -82,7 +82,7 @@ define(['handlebars'], function(Handlebars){ @@ -82,7 +82,7 @@ define(['handlebars'], function(Handlebars){
82 82
83 Handlebars.registerHelper('proposal_action', function(discussion, target) { 83 Handlebars.registerHelper('proposal_action', function(discussion, target) {
84 if(discussion.setting && discussion.setting.moderate_proposals) { 84 if(discussion.setting && discussion.setting.moderate_proposals) {
85 - return '/api/v1/articles/'+target.id+'/children/suggest'; 85 + return '/api/v1/proposals_discussion_plugin/'+target.id+'/propose';
86 } else { 86 } else {
87 return '/api/v1/articles/'+target.id+'/children'; 87 return '/api/v1/articles/'+target.id+'/children';
88 } 88 }
@@ -108,7 +108,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F @@ -108,7 +108,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F
108 } 108 }
109 109
110 if(!logged_in) { 110 if(!logged_in) {
111 - $(this).closest('.support-proposal').find('.send-button a').click(); 111 + $(this).closest('.support-proposal').find('.button-send a').click();
112 e.preventDefault(); 112 e.preventDefault();
113 return; 113 return;
114 } 114 }
@@ -644,12 +644,12 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F @@ -644,12 +644,12 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F
644 Main.updateHash(newHash); 644 Main.updateHash(newHash);
645 }); 645 });
646 646
647 - $( '.send-button a' ).on('click', function(e){ 647 + $( '.button-send a' ).on('click', function(e){
648 e.preventDefault(); 648 e.preventDefault();
649 649
650 //display form to send proposal (or login form for non-logged users) 650 //display form to send proposal (or login form for non-logged users)
651 var $this = $(this); 651 var $this = $(this);
652 - loginButton = $this.parents('.send-button'); 652 + loginButton = $this.parents('.button-send');
653 loginButton.hide(); 653 loginButton.hide();
654 $this.parents('.success-proposal-sent').hide(); 654 $this.parents('.success-proposal-sent').hide();
655 $wrapper = $this.parents('.make-proposal'); 655 $wrapper = $this.parents('.make-proposal');