Customize add_contribution_modal title and submit button label on add/edit

This commit is contained in:
Benjamin Renard 2014-01-06 03:06:04 +01:00
parent 936a009ced
commit 2eeb45c6a6

View file

@ -204,6 +204,8 @@ on_show_add_contribution_modal=function(e) {
on_click_add_contribution_btn=function() {
$('#add_contribution_modal #group_name')[0].value=$('#view-group #group_name')[0].value;
$('#add_contribution_modal #edit_id')[0].value='-1';
$($('#add_contribution_modal h4')[0]).html('Ajouter une contribution');
$($('#add_contribution_modal #add_contribution_submit')[0]).html('Ajouter');
$('#add_contribution_modal').modal('show');
}
@ -285,6 +287,8 @@ on_confirm_contribution_delete=function(data) {
on_contribution_edit_btn_click=function(e) {
var group=groups[$('#view-group #group_name')[0].value];
$('#add_contribution_modal #group_name')[0].value=$('#view-group #group_name')[0].value;
$($('#add_contribution_modal h4')[0]).html('Editer une contribution');
$($('#add_contribution_modal #add_contribution_submit')[0]).html('Valider');
contribution_id=$($(e.target).parents('div')[0]).data('id');
contribution=group.contributions[contribution_id];
$('#add_contribution_modal #add_contribution_contributor_name')[0].value=contribution.contributor.name;