Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master forum back2basics osu #46634

Open
wants to merge 5 commits into
base: master
from

Conversation

@robodoo robodoo added the seen 🙂 label Mar 2, 2020
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch 2 times, most recently from d36a5ae to 87408f8 Mar 2, 2020
@C3POdoo C3POdoo added the RD label Mar 2, 2020
@robodoo robodoo added the CI 🤖 label Mar 2, 2020
Copy link
Contributor

kos94ok-3D left a comment

Use read group instead of len(x2many).

@api.depends('user_ids')
def _compute_rank_users_count(self):
for record in self:
record.rank_users_count = len(record.user_ids)

This comment has been minimized.

Copy link
@kos94ok-3D

kos94ok-3D Mar 3, 2020

Contributor

Why do you not use read_group?

for post in self:
post.child_count = process(post)
post.child_count = len(post.child_ids)

This comment has been minimized.

Copy link
@kos94ok-3D

kos94ok-3D Mar 3, 2020

Contributor

The same as above

@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 87408f8 to 430a121 Mar 4, 2020
@robodoo robodoo removed the CI 🤖 label Mar 4, 2020
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 2e31956 to a3bd95d Mar 11, 2020
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit improve the tree and form view of gamification.karma.rank
and correct a bug on auto generated email when a user pass to the
next rank.

- Add a stat button in form view and column in tree view to know
  how many users have the current rank
- Split Description and Motivational in 2 pages
- Hide the line that mention the next rank the user can get when
  there is no more rank to get in email templates
- Add a menu to access badges tree view

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit rename every "Question" references by "Post"
to make it appropriate for both forum's type (Question and Discussion)
It renames some other fields/labels to be shorter or with a
capital letter at the start.

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit add a lot of features and information about forum.forum,
forum.post, forum.tag.

- Correct the forum and post tree view to correctly render the number
  of posts, answers, views and favorites
- Add a Status column to post tree view
- Add a color to tags
- Add stat buttons to redirect to the frontend
- Add stat buttons to highlight datas in forum.forum and forum.post
- Make the tree view of forum.tag editable
- Add buttons to change the state of a forum.post in the form view

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of odoo#46634

task-2201708
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 98931eb to 50c9c73 Mar 19, 2020
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit add a lot of features and information about forum.forum,
forum.post, forum.tag.

- Correct the forum and post tree view to correctly render the number
  of posts, answers, views and favorites
- Add a Status column to post tree view
- Add a color to tags
- Add stat buttons to redirect to the frontend
- Add stat buttons to highlight datas in forum.forum and forum.post
- Make the tree view of forum.tag editable
- Add buttons to change the state of a forum.post in the form view

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 19, 2020
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of odoo#46634

task-2201708
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 50c9c73 to 6f7354d Mar 19, 2020
@robodoo robodoo added the CI 🤖 label Mar 19, 2020
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 25, 2020
This commit improve the tree and form view of gamification.karma.rank
and correct a bug on auto generated email when a user pass to the
next rank.

- Add a stat button in form view and column in tree view to know
  how many users have the current rank
- Split Description and Motivational in 2 pages
- Hide the line that mention the next rank the user can get when
  there is no more rank to get in email templates
- Add a menu to access badges tree view

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 25, 2020
This commit rename every "Question" references by "Post"
to make it appropriate for both forum's type (Question and Discussion)
It renames some other fields/labels to be shorter or with a
capital letter at the start.

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 25, 2020
This commit add a lot of features and information about forum.forum,
forum.post, forum.tag.

- Correct the forum and post tree view to correctly render the number
  of posts, answers, views and favorites
- Add a Status column to post tree view
- Add a color to tags
- Add stat buttons to redirect to the frontend
- Add stat buttons to highlight datas in forum.forum and forum.post
- Make the tree view of forum.tag editable
- Add buttons to change the state of a forum.post in the form view

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 25, 2020
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 25, 2020
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of odoo#46634

task-2201708
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 6f7354d to e41ff47 Mar 25, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 25, 2020
Copy link
Contributor

qsm-odoo left a comment

First batch of comments

% if object.next_rank_id.name
<p>Continue your work to become a <strong>${object.next_rank_id.name}</strong> !</p>
% endif
Comment on lines 23 to 25

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 26, 2020

Contributor

Reading the code this feels like it is a bug fix?

This comment has been minimized.

Copy link
@Esperax

Esperax Mar 27, 2020

Author

Kind of, but there is a line about it in the PAD. What should I do ?

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 27, 2020

Contributor

As for all fixes, whether or not they come from a pad, they should be done in the version in which the bug occurred.

@@ -611,7 +611,7 @@
<t t-if="no_filters"> All</t>
<t t-elif="filters == 'solved'"> Solved</t>
<t t-elif="filters == 'unsolved'"> Unsolved</t>
<t t-elif="filters == 'unanswered'"> Unsolved</t>
<t t-elif="filters == 'unanswered'"> Unanswered</t>

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 26, 2020

Contributor

Bug fix ?

This comment has been minimized.

Copy link
@Esperax

Esperax Mar 27, 2020

Author

Yes, I saw it when I was hiding "Solved" and "Unsolved" filter for a "Discussion" forum. What should I do in this case ?

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 27, 2020

Contributor

Again: bug fix in the oldest branch which has the bug.

@@ -145,6 +145,31 @@ $bronze: #eea91e;
.forum_answer img, .question-block img {
max-width: 100%
}

.o_wforum_index_entry_tags {
@for $size from 1 through length($o-colors) {

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 26, 2020

Contributor
  • "$size" for an index?
  • I am bit scared of this, what is the purpose of these new 50 rules with hardcoded colors ?

This comment has been minimized.

Copy link
@Esperax

Esperax Mar 27, 2020

Author

I just used what was already used by others modules for coloring tags.
The color widget for a field shows specifics colors, and their ids is used in the class creation to get the right color.

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 27, 2020

Contributor

For the backend maybe, it is the website here. But ok, keep them and we'll see but adapt the rules correctly (see other comments)

$background-color: white;
// no color selected
@if $size == 1 {
& {

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 26, 2020

Contributor

?

addons/website_forum/static/src/js/website_forum.js Outdated Show resolved Hide resolved
addons/website_forum/static/src/js/website_forum.js Outdated Show resolved Hide resolved
@@ -27,6 +27,7 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({
'click .o_wforum_favourite_toggle': '_onFavoriteQuestionClick',
'click .comment_delete': '_onDeleteCommentClick',
'click .js_close_intro': '_onCloseIntroClick',
'click .o_wforum_submit_post': '_onSubmitForm'

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 26, 2020

Contributor
  • Missing trailing comma.
  • Why not on submit?

This comment has been minimized.

Copy link
@Esperax

Esperax Mar 27, 2020

Author

How does it will interact with the submit listener in website_forum.share.js ?
'submit .js_website_submit_form:has(:not(.karma_required).oe_social_share_call)': '_onShareCallClick',
Afraid it will trigger that event even if the title or the textarea is empty

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 27, 2020

Contributor

Ideally, both widgets should listen to submit, the first one should preventDefault the event if the form is not correct and the second one should check that the event is not default prevented. But this only works if the widgets are executed in the right order, which we cannot do. What you can do, is include the social share code directly in the same widget as the validation, is it possible?

This comment has been minimized.

Copy link
@Esperax

Esperax Mar 27, 2020

Author

Yes it is. But, for now, my verification is in a website forum widget that inherit from public widget. So, this verification is only available in website_forum. But if we want it available for every website module, it should be redirected to website. And so, the social share code will no longer be in the same widget because it's a website_forum feature.
I guess it can stick with it even in website because it will only be triggered by submit buttons with a specific class (an these buttons will only be in website_forum views). But it will feel wrong to have a website_forum feature in website.
So, I guess it depends if we want the verification being available for the whole website or only for website_forum

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 27, 2020

Contributor

It would still be possible with an include. Anyways, do it just in forum for now.

<button type="submit" t-attf-class="btn btn-primary #{forum.allow_share and 'oe_social_share_call'} #{(user.karma &lt; forum.karma_ask) and 'karma_required'}"
t-att-data-karma="forum.karma_ask"
data-hashtags="#question" data-social-target-type="question">Post Your Question</button>
<a href="#" role="button" t-attf-class="btn btn-primary o_wforum_submit_post #{forum.allow_share and 'oe_social_share_call'} #{(user.karma &lt; forum.karma_ask) and 'karma_required'}"

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Mar 26, 2020

Contributor

Why not keep the submit and prevent default the form submit?

This commit improve the tree and form view of gamification.karma.rank
and correct a bug on auto generated email when a user pass to the
next rank.

- Add a stat button in form view and column in tree view to know
  how many users have the current rank
- Split Description and Motivational in 2 pages
- Hide the line that mention the next rank the user can get when
  there is no more rank to get in email templates
- Add a menu to access badges tree view

Part of #46634

task-2201708
This commit rename every "Question" references by "Post"
to make it appropriate for both forum's type (Question and Discussion)
It renames some other fields/labels to be shorter or with a
capital letter at the start.

Part of #46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 27, 2020
This commit add a lot of features and information about forum.forum,
forum.post, forum.tag.

- Correct the forum and post tree view to correctly render the number
  of posts, answers, views and favorites
- Add a Status column to post tree view
- Add a color to tags
- Add stat buttons to redirect to the frontend
- Add stat buttons to highlight datas in forum.forum and forum.post
- Make the tree view of forum.tag editable
- Add buttons to change the state of a forum.post in the form view

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 27, 2020
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 27, 2020
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of odoo#46634

task-2201708
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from e41ff47 to 261aa8d Mar 27, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 27, 2020
This commit add a lot of features and information about forum.forum,
forum.post, forum.tag.

- Correct the forum and post tree view to correctly render the number
  of posts, answers, views and favorites
- Add a Status column to post tree view
- Add a color to tags
- Add stat buttons to redirect to the frontend
- Add stat buttons to highlight datas in forum.forum and forum.post
- Make the tree view of forum.tag editable
- Add buttons to change the state of a forum.post in the form view

Part of #46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 27, 2020
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one for the first 3 elements, the last one is on a
  new page accessible from a link below the accordion
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications

Part of odoo#46634

task-2201708
Esperax added a commit to odoo-dev/odoo that referenced this pull request Mar 27, 2020
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of odoo#46634

task-2201708
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 261aa8d to 3869032 Mar 27, 2020
@robodoo robodoo removed the CI 🤖 label Mar 27, 2020
Esperax added 2 commits Mar 19, 2020
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of #46634

task-2201708
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one for the first 3 elements, the last one is on a
  new page accessible from a link below the accordion
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications

Part of #46634

task-2201708
@Esperax Esperax force-pushed the odoo-dev:master-forum-back2basics-osu branch from 3869032 to 4bb55b4 Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.