Customize add_contribution_modal title and submit button label on add/edit
Benjamin Renard

Benjamin Renard commited on 2014-01-06 02:06:04
Showing 1 changed files, with 4 additions and 0 deletions.

... ...
@@ -204,6 +204,8 @@ on_show_add_contribution_modal=function(e) {
204 204
 on_click_add_contribution_btn=function() {
205 205
   $('#add_contribution_modal #group_name')[0].value=$('#view-group #group_name')[0].value;
206 206
   $('#add_contribution_modal #edit_id')[0].value='-1';
207
+  $($('#add_contribution_modal h4')[0]).html('Ajouter une contribution');
208
+  $($('#add_contribution_modal #add_contribution_submit')[0]).html('Ajouter');
207 209
   $('#add_contribution_modal').modal('show');
208 210
 }
209 211
 
... ...
@@ -285,6 +287,8 @@ on_confirm_contribution_delete=function(data) {
285 287
 on_contribution_edit_btn_click=function(e) {
286 288
   var group=groups[$('#view-group #group_name')[0].value];
287 289
   $('#add_contribution_modal #group_name')[0].value=$('#view-group #group_name')[0].value;
290
+  $($('#add_contribution_modal h4')[0]).html('Editer une contribution');
291
+  $($('#add_contribution_modal #add_contribution_submit')[0]).html('Valider');
288 292
   contribution_id=$($(e.target).parents('div')[0]).data('id');
289 293
   contribution=group.contributions[contribution_id];
290 294
   $('#add_contribution_modal #add_contribution_contributor_name')[0].value=contribution.contributor.name;
291 295