fix: #8779, fix move all

add new language keys
v1.18.x
Barış Soner Uşaklı 4 years ago
parent 1f43e98f8b
commit e6440c0d21

@ -91,7 +91,9 @@
"thread_tools.merge_topics": "Merge Topics",
"thread_tools.merge": "Merge",
"topic_move_success": "This topic will be moved shortly. Click here to undo.",
"topic_move_success": "This topic will be moved to \"%1\" shortly. Click here to undo.",
"topic_move_multiple_success": "These topics will be moved to \"%1\" shortly. Click here to undo.",
"topic_move_all_success": "All topics will be moved to \"%1\" shortly. Click here to undo.",
"topic_move_undone": "Topic move undone",
"topic_move_posts_success": "Posts will be moved shortly. Click here to undo.",
"topic_move_posts_undone": "Post move undone",

@ -20,7 +20,10 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySel
return app.alertError(err.message);
}
parseModal(categories, function () {
app.parseAndTranslate('partials/move_thread_modal', {
categories: categories,
}, function (html) {
modal = $(html);
modal.on('hidden.bs.modal', function () {
modal.remove();
});
@ -39,14 +42,6 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySel
});
}
function parseModal(categories, callback) {
app.parseAndTranslate('partials/move_thread_modal', { categories: categories }, function (html) {
modal = $(html);
callback();
});
}
function onCategorySelected(category) {
selectedCategory = category;
modal.find('#move_thread_commit').prop('disabled', false);
@ -59,11 +54,16 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySel
commitEl.prop('disabled', true);
modal.modal('hide');
var message = '[[topic:topic_move_success, ' + selectedCategory.name + ']]';
if (Move.tids && Move.tids.length > 1) {
message = '[[topic:topic_move_multiple_success, ' + selectedCategory.name + ']]';
} else if (!Move.tids) {
message = '[[topic:topic_move_all_success, ' + selectedCategory.name + ']]';
}
alerts.alert({
alert_id: 'tids_move_' + Move.tids.join('-'),
alert_id: 'tids_move_' + (Move.tids ? Move.tids.join('-') : 'all'),
title: '[[topic:thread_tools.move]]',
message: '[[topic:topic_move_success, ' + selectedCategory.name + ']]',
message: message,
type: 'success',
timeout: 10000,
timeoutfn: function () {

Loading…
Cancel
Save