Merge pull request #5320 from pichalite/issue-5305

Confirm before removing user and group cover picture
v1.18.x
psychobunny 8 years ago committed by GitHub
commit 22b9f5db92

@ -61,5 +61,6 @@
"new-group.group_name": "Group Name:", "new-group.group_name": "Group Name:",
"upload-group-cover": "Upload group cover", "upload-group-cover": "Upload group cover",
"bulk-invite-instructions": "Enter a list of comma separated usernames to invite to this group", "bulk-invite-instructions": "Enter a list of comma separated usernames to invite to this group",
"bulk-invite": "Bulk Invite" "bulk-invite": "Bulk Invite",
"remove_group_cover_confirm": "Are you sure you want to remove the cover picture?"
} }

@ -67,6 +67,7 @@
"upload_a_picture": "Upload a picture", "upload_a_picture": "Upload a picture",
"remove_uploaded_picture" : "Remove Uploaded Picture", "remove_uploaded_picture" : "Remove Uploaded Picture",
"upload_cover_picture": "Upload cover picture", "upload_cover_picture": "Upload cover picture",
"remove_cover_picture_confirm": "Are you sure you want to remove the cover picture?",
"settings": "Settings", "settings": "Settings",
"show_email": "Show My Email", "show_email": "Show My Email",

@ -168,6 +168,12 @@ define('forum/account/header', [
} }
function removeCover() { function removeCover() {
translator.translate('[[user:remove_cover_picture_confirm]]', function (translated) {
bootbox.confirm(translated, function (confirm) {
if (!confirm) {
return;
}
socket.emit('user.removeCover', { socket.emit('user.removeCover', {
uid: ajaxify.data.uid uid: ajaxify.data.uid
}, function (err) { }, function (err) {
@ -177,6 +183,8 @@ define('forum/account/header', [
app.alertError(err.message); app.alertError(err.message);
} }
}); });
});
});
} }
return AccountHeader; return AccountHeader;

@ -7,8 +7,9 @@ define('forum/groups/details', [
'components', 'components',
'coverPhoto', 'coverPhoto',
'uploader', 'uploader',
'translator',
'vendor/colorpicker/colorpicker' 'vendor/colorpicker/colorpicker'
], function (memberList, iconSelect, components, coverPhoto, uploader) { ], function (memberList, iconSelect, components, coverPhoto, uploader, translator) {
var Details = {}; var Details = {};
var groupName; var groupName;
@ -265,6 +266,12 @@ define('forum/groups/details', [
} }
function removeCover() { function removeCover() {
translator.translate('[[groups:remove_group_cover_confirm]]', function (translated) {
bootbox.confirm(translated, function (confirm) {
if (!confirm) {
return;
}
socket.emit('groups.cover.remove', { socket.emit('groups.cover.remove', {
groupName: ajaxify.data.group.name groupName: ajaxify.data.group.name
}, function (err) { }, function (err) {
@ -274,6 +281,8 @@ define('forum/groups/details', [
app.alertError(err.message); app.alertError(err.message);
} }
}); });
});
});
} }
return Details; return Details;

Loading…
Cancel
Save