mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
feat: merge improvements wip
This commit is contained in:
@@ -45,6 +45,9 @@ module.exports = function (grunt) {
|
|||||||
if (!plugins.includes('nodebb-plugin-composer-default')) {
|
if (!plugins.includes('nodebb-plugin-composer-default')) {
|
||||||
plugins.push('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')
|
const styleUpdated_Client = plugins.map(p => 'node_modules/' + p + '/*.less')
|
||||||
|
|||||||
@@ -115,7 +115,11 @@
|
|||||||
"fork_pid_count": "%1 post(s) selected",
|
"fork_pid_count": "%1 post(s) selected",
|
||||||
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
||||||
"delete_posts_instruction": "Click the posts you want to delete/purge",
|
"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",
|
"move_posts_instruction": "Click the posts you want to move",
|
||||||
"change_owner_instruction": "Click the posts you want to assign to another user",
|
"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_pid_count": "%1 post(s) selected",
|
||||||
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
||||||
"delete_posts_instruction": "Click the posts you want to delete/purge",
|
"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",
|
"move_posts_instruction": "Click the posts you want to move",
|
||||||
"change_owner_instruction": "Click the posts you want to assign to another user",
|
"change_owner_instruction": "Click the posts you want to assign to another user",
|
||||||
"composer.title_placeholder": "Enter your topic title here...",
|
"composer.title_placeholder": "Enter your topic title here...",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ define('forum/topic/merge', function () {
|
|||||||
|
|
||||||
var selectedTids = {};
|
var selectedTids = {};
|
||||||
|
|
||||||
Merge.init = function () {
|
Merge.init = function (callback) {
|
||||||
|
callback = callback || function () {};
|
||||||
if (modal) {
|
if (modal) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -28,11 +29,12 @@ define('forum/topic/merge', function () {
|
|||||||
mergeBtn.on('click', function () {
|
mergeBtn.on('click', function () {
|
||||||
mergeTopics(mergeBtn);
|
mergeTopics(mergeBtn);
|
||||||
});
|
});
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function onTopicClicked(ev) {
|
Merge.addTopic = function (tid, callback) {
|
||||||
var tid = $(this).parents('[component="category/topic"]').attr('data-tid');
|
callback = callback || function () {};
|
||||||
socket.emit('topics.getTopic', tid, function (err, topicData) {
|
socket.emit('topics.getTopic', tid, function (err, topicData) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return app.alertError(err);
|
return app.alertError(err);
|
||||||
@@ -45,7 +47,14 @@ define('forum/topic/merge', function () {
|
|||||||
}
|
}
|
||||||
checkButtonEnable();
|
checkButtonEnable();
|
||||||
showTopicsSelected();
|
showTopicsSelected();
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function onTopicClicked(ev) {
|
||||||
|
var tid = $(this).parents('[component="category/topic"]').attr('data-tid');
|
||||||
|
Merge.addTopic(tid);
|
||||||
|
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
@@ -75,8 +84,12 @@ define('forum/topic/merge', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (tids.length) {
|
if (tids.length) {
|
||||||
app.parseAndTranslate('partials/merge_topics_modal', 'topics', { topics: topics }, function (html) {
|
app.parseAndTranslate('partials/merge_topics_modal', {
|
||||||
modal.find('.topics-section').html(html);
|
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 {
|
} else {
|
||||||
modal.find('.topics-section').translateHtml('[[error:no-topics-selected]]');
|
modal.find('.topics-section').translateHtml('[[error:no-topics-selected]]');
|
||||||
|
|||||||
Reference in New Issue
Block a user