feat: merge improvements wip

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 87ce31d1f5
commit c4bdeae06e

@ -45,6 +45,9 @@ module.exports = function (grunt) {
if (!plugins.includes('nodebb-plugin-composer-default')) {
plugins.push('nodebb-plugin-composer-default');
}
if (!plugins.includes('nodebb-theme-persona')) {
plugins.push('nodebb-theme-persona');
}
}
const styleUpdated_Client = plugins.map(p => 'node_modules/' + p + '/*.less')

@ -115,7 +115,11 @@
"fork_pid_count": "%1 post(s) selected",
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
"delete_posts_instruction": "Click the posts you want to delete/purge",
"merge_topics_instruction": "Click the topics you want to merge",
"merge_topics_instruction": "Click the topics you want to merge or search for them",
"merge-topic-list-title": "List of topics to be merged",
"merge-options": "Merge options",
"merge-select-main-topic": "Select the main topic",
"merge-new-title-for-topic": "New title for topic",
"move_posts_instruction": "Click the posts you want to move",
"change_owner_instruction": "Click the posts you want to assign to another user",

@ -99,7 +99,11 @@
"fork_pid_count": "%1 post(s) selected",
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
"delete_posts_instruction": "Click the posts you want to delete/purge",
"merge_topics_instruction": "Click the topics you want to merge",
"merge_topics_instruction": "Click the topics you want to merge or search for them",
"merge-topic-list-title": "List of topics to be merged",
"merge-options": "Merge options",
"merge-select-main-topic": "Select the main topic",
"merge-new-title-for-topic": "New title for topic",
"move_posts_instruction": "Click the posts you want to move",
"change_owner_instruction": "Click the posts you want to assign to another user",
"composer.title_placeholder": "Enter your topic title here...",

@ -8,7 +8,8 @@ define('forum/topic/merge', function () {
var selectedTids = {};
Merge.init = function () {
Merge.init = function (callback) {
callback = callback || function () {};
if (modal) {
return;
}
@ -28,11 +29,12 @@ define('forum/topic/merge', function () {
mergeBtn.on('click', function () {
mergeTopics(mergeBtn);
});
callback();
});
};
function onTopicClicked(ev) {
var tid = $(this).parents('[component="category/topic"]').attr('data-tid');
Merge.addTopic = function (tid, callback) {
callback = callback || function () {};
socket.emit('topics.getTopic', tid, function (err, topicData) {
if (err) {
return app.alertError(err);
@ -45,7 +47,14 @@ define('forum/topic/merge', function () {
}
checkButtonEnable();
showTopicsSelected();
callback();
});
};
function onTopicClicked(ev) {
var tid = $(this).parents('[component="category/topic"]').attr('data-tid');
Merge.addTopic(tid);
ev.preventDefault();
ev.stopPropagation();
return false;
@ -75,8 +84,12 @@ define('forum/topic/merge', function () {
});
if (tids.length) {
app.parseAndTranslate('partials/merge_topics_modal', 'topics', { topics: topics }, function (html) {
modal.find('.topics-section').html(html);
app.parseAndTranslate('partials/merge_topics_modal', {
config: config,
topics: topics,
}, function (html) {
modal.find('.topics-section').html(html.find('.topics-section').html());
modal.find('.main-topic-select').html(html.find('.main-topic-select').html());
});
} else {
modal.find('.topics-section').translateHtml('[[error:no-topics-selected]]');

Loading…
Cancel
Save