From 6e2c4bd4d22257517890438dd806caa925837be5 Mon Sep 17 00:00:00 2001 From: Veronica Pimenova Date: Wed, 9 Oct 2024 17:24:52 -0400 Subject: [PATCH] Revert "Merge pull request #26 from CMU-313/anonymous-feature" This reverts commit 1ba80bc212892fa77181aff1b6ad19f57aaaefa2, reversing changes made to aef0de0fce430ef4a9481a9297c71a3c3c4567fe. --- .../package.json | 43 ++++++++ .../partials/composer-title-container.tpl | 50 +++++++++ .../composer-title-container.tpl.save | 100 ++++++++++++++++++ src/posts/create.js | 3 + src/posts/data.js | 8 ++ 5 files changed, 204 insertions(+) create mode 100644 node_modules/nodebb-plugin-composer-default/package.json create mode 100644 node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl create mode 100644 node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl.save diff --git a/node_modules/nodebb-plugin-composer-default/package.json b/node_modules/nodebb-plugin-composer-default/package.json new file mode 100644 index 0000000000..625184980c --- /dev/null +++ b/node_modules/nodebb-plugin-composer-default/package.json @@ -0,0 +1,43 @@ +{ + "name": "nodebb-plugin-composer-default", + "version": "10.2.36", + "description": "Default composer for NodeBB", + "main": "library.js", + "repository": { + "type": "git", + "url": "https://github.com/NodeBB/nodebb-plugin-composer-default" + }, + "scripts": { + "lint": "eslint ." + }, + "keywords": [ + "nodebb", + "plugin", + "composer", + "markdown" + ], + "author": { + "name": "NodeBB Team", + "email": "sales@nodebb.org" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/NodeBB/nodebb-plugin-composer-default/issues" + }, + "readmeFilename": "README.md", + "nbbpm": { + "compatibility": "^3.0.0" + }, + "dependencies": { + "@textcomplete/contenteditable": "^0.1.12", + "@textcomplete/core": "^0.1.12", + "@textcomplete/textarea": "^0.1.12", + "screenfull": "^5.0.2", + "validator": "^13.7.0" + }, + "devDependencies": { + "eslint": "^7.32.0", + "eslint-config-nodebb": "^0.0.1", + "eslint-plugin-import": "^2.23.4" + } +} diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl new file mode 100644 index 0000000000..b46ea269a2 --- /dev/null +++ b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl @@ -0,0 +1,50 @@ +
+ {{{ if isTopic }}} +
+ +
+ {{{ end }}} + + {{{ if showHandleInput }}} +
+ +
+ {{{ end }}} + +
+ {{{ if isTopicOrMain }}} + + {{{ else }}} + {{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}} + {{{ end }}} + +
+ +
+
+ + +
+ + +
+ +
+ + +
+
+
+
diff --git a/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl.save b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl.save new file mode 100644 index 0000000000..45811dd8f7 --- /dev/null +++ b/node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-title-container.tpl.save @@ -0,0 +1,100 @@ +X + + +lass="title-container align-items-center gap-2 d-flex"> + {{{ if isTopic }}} +
+ +
+ {{{ end }}} + + {{{ if showHandleInput }}} +
+ +
+ {{{ end }}} + +
+ {{{ if isTopicOrMain }}} + + {{{ else }}} + {{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}} + {{{ end }}} + +
+ +
+<<<<<<< HEAD +
+ + +
+======= +>>>>>>> origin/isAnswered + + +
+ +
+ + +
+
+
+
+ {{{ if isTopic }}} +
+ +
+ {{{ end }}} + + {{{ if showHandleInput }}} +
+ +
+ {{{ end }}} + +
+ {{{ if isTopicOrMain }}} + + {{{ else }}} + + {{{ end }}} + +
+ +
+
+ + +
+ + +
+ +
+ +
+
+
+
diff --git a/src/posts/create.js b/src/posts/create.js index 7f6c4ae3a5..3c2f34732c 100644 --- a/src/posts/create.js +++ b/src/posts/create.js @@ -35,7 +35,10 @@ module.exports = function (Posts) { tid: tid, content: content, timestamp: timestamp, +<<<<<<< HEAD anonymous: data.anonymous ? 1 : 0, // Added anonymous status +======= +>>>>>>> parent of 1ba80bc2 (Merge pull request #26 from CMU-313/anonymous-feature) }; if (data.toPid) { diff --git a/src/posts/data.js b/src/posts/data.js index 0e7b16f94a..62b248619e 100644 --- a/src/posts/data.js +++ b/src/posts/data.js @@ -22,17 +22,22 @@ module.exports = function (Posts) { posts: postData, fields: fields, }); +<<<<<<< HEAD result.posts.forEach((post) => { modifyPost(post, fields); if (post.anonymous === 1) { post.uid = null; } }); +======= + result.posts.forEach(post => modifyPost(post, fields)); +>>>>>>> parent of 1ba80bc2 (Merge pull request #26 from CMU-313/anonymous-feature) return result.posts; }; Posts.getPostData = async function (pid) { const posts = await Posts.getPostsFields([pid], []); +<<<<<<< HEAD if (posts && posts.length) { const post = posts[0]; if (post.anonymous === 1) { @@ -41,6 +46,9 @@ module.exports = function (Posts) { return post; } return null; +======= + return posts && posts.length ? posts[0] : null; +>>>>>>> parent of 1ba80bc2 (Merge pull request #26 from CMU-313/anonymous-feature) }; Posts.getPostsData = async function (pids) {