Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[MERGE][ADD] website{_profile,_slides,_forum,*} : new profile page yayy #30988
Conversation
robodoo
added
the
seen 🙂
label
Feb 11, 2019
dbeguin
changed the title
[IMP] website_profile, _forum, _slides, _slides_forum : review website_profile page and add slides info
[IMP][ADD] website_profile, _forum, _slides, _slides_forum : review website_profile page and add slides info
Feb 11, 2019
dbeguin
requested a review
from
tde-banana-odoo
Feb 11, 2019
dbeguin
force-pushed the
odoo-dev:master-elearning-website-profile-dbe
branch
from
9285dce
to
f50f103
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
C3POdoo
added
the
RD
label
Feb 11, 2019
mreficent
reviewed
Feb 11, 2019
res = super(Users, self).get_gamification_redirection_data() | ||
res.append({ | ||
'url': '/slides', | ||
'label': 'Go to Elearning' |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
reviewed
Feb 11, 2019
First technical review (mainly profile + slides_profile). |
def _prepare_user_values(self, **kwargs): | ||
values = { | ||
'user': request.env.user, | ||
'is_public_user': request.env.user.id == request.website.user_id.id, |
This comment has been minimized.
This comment has been minimized.
|
||
@http.route(['/profile/user/<int:user_id>'], type='http', auth="public", website=True) | ||
def open_user(self, user_id=0, **post): | ||
# isn't that a security hole ? |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
It is. I would at least in profile display on website_published users. I would also display only users with at least one karma point, meaning they participated to forum / slide somehow.
We could think of a hook method to generate a domain that addons can call / customize. Maybe a _check_user_profile_access method to inherit ?
return values | ||
|
||
@http.route(['/profile/user/<int:user_id>'], type='http', auth="public", website=True) | ||
def open_user(self, user_id=0, **post): |
This comment has been minimized.
This comment has been minimized.
return request.render("website_profile.user_detail_main", values) | ||
|
||
@http.route('/profile/edit', type='http', auth="user", website=True) | ||
def edit_profile(self, **kwargs): |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
Naming: def view_user_profile_edition ? As it does not edit a profile, it just display the form in order to edit a profile.
return werkzeug.utils.redirect("/profile/user/%d" % user.id) | ||
|
||
@http.route('/profile/ranks', type='http', auth="public", website=True) | ||
def ranks(self, **searches): |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
**kwargs ? It doe snot support search if I am not wrong, having kwargs is useful notably for debug mode but that's all I think.
|
||
# Users with high karma can see users with karma <= 0 for | ||
# moderation purposes, IFF they have posted something (see below) | ||
if (not user or (user.karma < 1 and current_user.karma < channel.karma_unlink_all)): |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
Post-commented thingy: this is an example of why we should have a unique check method to access a user profile so that we don't have custom implementation in various controllers :) .
<?xml version="1.0" ?> | ||
<odoo> | ||
<data> | ||
<template id="profile_header" name="Slides Profile Header"> |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
Guidelining note (check other templates): define on a one liner to save indentation :) . It is easier to read / maintain.
else: | ||
forums = request.env['forum.forum'].search([]) | ||
|
||
values = { |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
Same as for slides (in short): use existing preparation methods :) .
@@ -46,8 +46,111 @@ | |||
<div t-field="forum.welcome_message"/> | |||
</div> | |||
|
|||
<div class="container mt16 mb32 o_wforum_navbar_container"> | |||
<div class="navbar navbar-expand-md navbar-light"> | |||
<div class="container mt16 mb32 "> |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dbeguin
Feb 11, 2019
Author
Contributor
I had to make the nav header a separate template to call it in here but also in forum_user_profile_main template.
class Forum(models.Model): | ||
_inherit = 'forum.forum' | ||
|
||
slide_channel_id = fields.Many2one('slide.channel', 'Course') |
This comment has been minimized.
This comment has been minimized.
tde-banana-odoo
Feb 11, 2019
Contributor
Main issue: handle privaty / security as I don't think forums have real security checks. This should be clarified.
dbeguin
force-pushed the
odoo-dev:master-elearning-website-profile-dbe
branch
from
f50f103
to
0429e48
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 11, 2019
dbeguin
force-pushed the
odoo-dev:master-elearning-website-profile-dbe
branch
from
0429e48
to
56e2975
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
dbeguin
force-pushed the
odoo-dev:master-elearning-website-profile-dbe
branch
from
56e2975
to
71b3422
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
dbeguin
force-pushed the
odoo-dev:master-elearning-website-profile-dbe
branch
from
71b3422
to
638ec17
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 12, 2019
This comment has been minimized.
This comment has been minimized.
@robodoo r+ rebase-merge |
robodoo
added
the
r+ 👌
label
Feb 14, 2019
This comment has been minimized.
This comment has been minimized.
Merge method set to rebase and merge, using the PR as merge commit message |
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
robodoo
added
the
CI 🤖
label
Feb 14, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
added a commit
to odoo-dev/odoo
that referenced
this pull request
Feb 14, 2019
pushed a commit
that referenced
this pull request
Feb 14, 2019
pushed a commit
that referenced
this pull request
Feb 14, 2019
pushed a commit
that referenced
this pull request
Feb 14, 2019
pushed a commit
that referenced
this pull request
Feb 14, 2019
pushed a commit
that referenced
this pull request
Feb 14, 2019
added a commit
that referenced
this pull request
Feb 14, 2019
robodoo
added
merging 👷
merged 🎉
and removed
merging 👷
labels
Feb 14, 2019
This comment has been minimized.
This comment has been minimized.
Merged, thanks! |
dbeguin commentedFeb 11, 2019
•
edited by tde-banana-odoo
Purpose of this merge is to provide a completely new and improved user profile
page linked to gamification, slides and forum. Those frontend applications
now heavily rely on website profile and add their own custom content like
channel or forum participation or challenges results. This merge is linked
to the currently under development eLearning feature [1][2].
This merge contains notably
website_profile;
A new bridge module is added that is website_slide_forum. It makes a link
between those two applications. Publishers can create a forum linked to a
course allowing participants to communicate and ask questions related to a
course.
Profile page is contextualized. When coming from a channel informations about
this channel is displayed. Linked forum information is added. When coming from
a specific forum only information related to this forum is displayed.
Otherwise a profile page with aggregated information is displayed.
Some other improvements are done: ranks, karma, badges from gamification are
included in forum and eLearning, 'new badge notifications' mechanism is removed
as email are send, and various other improvements. See sub commits for more
details.
Merge linked to task ID 1922159.
[1] see task ID 1902304 (main eLearning task) PR #29876;
[2] see task ID 1936153 (new homepage for slides) PR #30770;