diff --git a/addons/website_forum/controllers/website_forum.py b/addons/website_forum/controllers/website_forum.py
index 98b4c3d17ab..994939bbcc1 100644
--- a/addons/website_forum/controllers/website_forum.py
+++ b/addons/website_forum/controllers/website_forum.py
@@ -122,6 +122,7 @@ class WebsiteForum(WebsiteProfile):
my=my,
create_uid=author.id,
include_answers=include_answers,
+ my_profile=request.env.user == author,
**post
)
question_count, details, fuzzy_search_term = request.website._search_with_fuzzy(
diff --git a/addons/website_forum/views/forum_forum_templates_post.xml b/addons/website_forum/views/forum_forum_templates_post.xml
index 750c2cd6ada..2f77d978267 100644
--- a/addons/website_forum/views/forum_forum_templates_post.xml
+++ b/addons/website_forum/views/forum_forum_templates_post.xml
@@ -35,9 +35,9 @@
+ t-value="'/forum/' + slug(question_tag.forum_id) + '?' + keep_query( 'search', 'sorting', 'my', 'create_uid',)"/>
+ t-value="'/forum/' + slug(question_tag.forum_id) + '/tag/' + slug(question_tag) + '/questions?' + keep_query( 'search', 'sorting', 'my', 'create_uid', filters='tag')"/>
-
+
Questions
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -101,10 +114,24 @@
-
+
Answers
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -127,16 +154,31 @@
-
Votes
+
+ Votes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -182,17 +224,21 @@
-
You haven't given any votes yet.
+
+ Help moderating the forums by upvoting and downvoting posts.
+
+ Go To Forums
+
+
+
You haven't given any votes yet.
diff --git a/addons/website_profile/static/src/js/website_profile.js b/addons/website_profile/static/src/js/website_profile.js
index a1bfcd50632..d17dd5b72a9 100644
--- a/addons/website_profile/static/src/js/website_profile.js
+++ b/addons/website_profile/static/src/js/website_profile.js
@@ -46,28 +46,36 @@ publicWidget.registry.websiteProfileEditor = publicWidget.Widget.extend({
'click .o_forum_profile_pic_edit': '_onEditProfilePicClick',
'change .o_forum_file_upload': '_onFileUploadChange',
'click .o_forum_profile_pic_clear': '_onProfilePicClearClick',
+ 'click .o_forum_profile_bio_edit': '_onProfileBioEditClick',
+ 'click .o_forum_profile_bio_cancel_edit': '_onProfileBioCancelEditClick',
},
/**
* @override
*/
start: async function () {
- var def = this._super.apply(this, arguments);
+ const def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
- var $textarea = this.$('textarea.o_wysiwyg_loader');
+ const $textarea = this.$("textarea.o_wysiwyg_loader");
- this._wysiwyg = await loadWysiwygFromTextarea(this, $textarea[0], {
+ const options = {
recordInfo: {
context: this._getContext(),
- res_model: 'res.users',
- res_id: parseInt(this.$('input[name=user_id]').val()),
+ res_model: "res.users",
+ res_id: parseInt(this.$("input[name=user_id]").val()),
},
resizable: true,
userGeneratedContent: true,
- });
+ };
+
+ if ($textarea[0].attributes.placeholder) {
+ options.placeholder = $textarea[0].attributes.placeholder.value;
+ }
+
+ this._wysiwyg = await loadWysiwygFromTextarea(this, $textarea[0], options);
return Promise.all([def]);
},
@@ -113,6 +121,30 @@ publicWidget.registry.websiteProfileEditor = publicWidget.Widget.extend({
type: 'hidden',
}));
},
+
+ /**
+ * @private
+ * @param {Event} ev
+ */
+ _onProfileBioEditClick: function (ev) {
+ ev.preventDefault();
+ ev.currentTarget.classList.add("d-none");
+ document.querySelector(".o_forum_profile_bio_cancel_edit").classList.remove("d-none");
+ document.querySelector(".o_forum_profile_bio").classList.add("d-none");
+ document.querySelector(".o_forum_profile_bio_form").classList.remove("d-none");
+ },
+
+ /**
+ * @private
+ * @param {Event} ev
+ */
+ _onProfileBioCancelEditClick: function (ev) {
+ ev.preventDefault();
+ ev.currentTarget.classList.add("d-none");
+ document.querySelector(".o_forum_profile_bio_edit").classList.remove("d-none");
+ document.querySelector(".o_forum_profile_bio_form").classList.add("d-none");
+ document.querySelector(".o_forum_profile_bio").classList.remove("d-none");
+ },
});
publicWidget.registry.websiteProfileNextRankCard = publicWidget.Widget.extend({
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index ee981e11c0b..620061d4bcc 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -99,7 +99,7 @@
-
+