mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
Merge pull request #5320 from pichalite/issue-5305
Confirm before removing user and group cover picture
This commit is contained in:
@@ -61,5 +61,6 @@
|
||||
"new-group.group_name": "Group Name:",
|
||||
"upload-group-cover": "Upload group cover",
|
||||
"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",
|
||||
"remove_uploaded_picture" : "Remove Uploaded Picture",
|
||||
"upload_cover_picture": "Upload cover picture",
|
||||
"remove_cover_picture_confirm": "Are you sure you want to remove the cover picture?",
|
||||
|
||||
"settings": "Settings",
|
||||
"show_email": "Show My Email",
|
||||
|
||||
@@ -168,14 +168,22 @@ define('forum/account/header', [
|
||||
}
|
||||
|
||||
function removeCover() {
|
||||
socket.emit('user.removeCover', {
|
||||
uid: ajaxify.data.uid
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
} else {
|
||||
app.alertError(err.message);
|
||||
}
|
||||
translator.translate('[[user:remove_cover_picture_confirm]]', function (translated) {
|
||||
bootbox.confirm(translated, function (confirm) {
|
||||
if (!confirm) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit('user.removeCover', {
|
||||
uid: ajaxify.data.uid
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
} else {
|
||||
app.alertError(err.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,9 @@ define('forum/groups/details', [
|
||||
'components',
|
||||
'coverPhoto',
|
||||
'uploader',
|
||||
'translator',
|
||||
'vendor/colorpicker/colorpicker'
|
||||
], function (memberList, iconSelect, components, coverPhoto, uploader) {
|
||||
], function (memberList, iconSelect, components, coverPhoto, uploader, translator) {
|
||||
|
||||
var Details = {};
|
||||
var groupName;
|
||||
@@ -265,14 +266,22 @@ define('forum/groups/details', [
|
||||
}
|
||||
|
||||
function removeCover() {
|
||||
socket.emit('groups.cover.remove', {
|
||||
groupName: ajaxify.data.group.name
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
} else {
|
||||
app.alertError(err.message);
|
||||
}
|
||||
translator.translate('[[groups:remove_group_cover_confirm]]', function (translated) {
|
||||
bootbox.confirm(translated, function (confirm) {
|
||||
if (!confirm) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit('groups.cover.remove', {
|
||||
groupName: ajaxify.data.group.name
|
||||
}, function (err) {
|
||||
if (!err) {
|
||||
ajaxify.refresh();
|
||||
} else {
|
||||
app.alertError(err.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user