Commit Graph
68 Commits
Author SHA1 Message Date
Martin Trigaux 4107d17b01 [FIX] website_profile,forum: avoid relative links
The origin parameter must be an absolute link (starting with a /)
To be consistent and always have a leading slash (and avoid relative
links if the developer forgot to add a leading slash)
2021-12-20 11:39:03 +01:00
Thomas Josse 255cdfe4f6 [IMP] website_profile: improve profile display when no leaderboard
Purpose
=======

This commit improves the front-end when we have no leaderboard yet

Specifications
==============

It hides the `Show All` button when we have no leaderboard.
It also modifies the leaderboard view if a user manages to get to it.

task-2597345

See odoo/enterprise#20480
See odoo/upgrade#2784

Part-of: odoo/odoo#75646
2021-10-22 11:09:17 +00:00
Romain Derie 7d8a8ddea0 [IMP] website(_forum/_profile): remove _get_http_domain method
Before Odoo saas-14.4, one should call `_get_http_domain()` on website to get
its domain. Indeed, that method was in charge of cleaning that domain, as it
was done with commit [1].

Since Odoo saas-14.4, that cleaning is automatically performed on domain before
saving it into database, thanks to commit [2].

Thus, we can now remove the `_get_http_domain()` and use directly the domain as
it is considered clean.

Note that migrated databases coming from version older than Odoo saas-14.4
could still have an incorrect domain (trailing slash, no scheme..).
This will be handled during migration with [3].

[1]: https://github.com/odoo/odoo/commit/3ad775aab717b395a5d11527aeb3596af66afa99
[2]: https://github.com/odoo/odoo/commit/042c95b0219bb0aa13e73385e092fa76ff1a1b0a
[3]: https://github.com/odoo/upgrade/pull/2951

closes odoo/odoo#78766

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-21 15:47:22 +00:00
Fabio Barbero 2d65d022d9 [IMP] website_slides: change confirmation messages for email
Purpose
=======
Clean up messages related to email verification.

Specification
=============
Rephrase messages, add confirmation of email sent and let user change
email.
Do not show "Validation Email sent" if the current user changed their
email address.

PR: https://github.com/odoo/odoo/pull/77617
Task-2647065

closes odoo/odoo#77617

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-12 11:44:40 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
Xavier Morel 32fca57fcb [FIX] *: page['num'] is just an integer, no idea why it'd use t-raw 2021-04-29 05:34:20 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Benoit Socias 20141a0b91 [FIX] various: not translate the close icon of notifications
Same change in several areas where translations existed:
- website editor notification popup
- elearning share popup
- forum remediation filter popup
- event registration attendees popup
- portal rating popup
- stripe payment error popup
And many other locations where there were no translations yet
"&times;" has been replaced by its UTF8 character.
Also introduced aria-label where missing.

Before this commit the close icon was included in translated resources.
For example, in Spanish the "&times;" had been turned into "&veces;"
thus not rendering an icon anymore

After this commit the close icon is not a translated text anymore and
remains an icon across all languages

https://github.com/odoo/odoo/pull/60186
task-2312878

closes odoo/odoo#62250

X-original-commit: 9896af94ebc887d98ccf44e6568ef7eeb5a27172
Related: odoo/enterprise#14937
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-24 15:59:43 +00:00
Csaba Tóth 228dc7892c [FIX] website_profile: wrong company name in template ranks_badges
Steps to reproduce the problem:
* Set up multi company with A and B companies
* Set up user UB connected to B company
* Wet up website to company A
* Install eLearning app
* on the /profile/ranks_badges page with user UB the text writes: "Keep
learning with B. Collect points on the forum ...".

This is wrong, as the website is connected to company A. The text should

closes odoo/odoo#58098

Be: "Keep learning with A. Collect points on the forum ..."
X-original-commit: 0d58423f6180fea908fc747e874798ce4aeadd92
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-21 08:06:05 +00:00
Patrick Hoste eff40d3c7d [IMP] website_profile: minor changes about karma rank display and forum questions
PURPOSE

Overall improve profile related parts of eLearning user experience.

SPECIFICATIONS

Improve display and the text about the karma gain/rank
- remove the double quotes around the rank
- change the text after the xp gained in rank list
- rename Monthly / Weekly gains to this month / this week

Improve the margin between questions and questions categories
- set same margin between questions in different categories

LINKS

Task ID-2241513
PR #55698
2020-08-11 10:20:39 +00:00
Okan SUMER (osu) f759a316f6 [IMP] website_profile: add badge breadcrumb and profile rank
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 https://github.com/odoo/odoo/pull/46634

task-2201708
2020-05-15 08:40:14 +00:00
David Beguin 45f7463e7a [IMP] website_(profile, slides): use badge level image as default badge image
Before this commit, if no image was set on the badge, no image was shown when
displaying the badge.

After this commit, if a badge level is set on the badge and no image is set,
the badge level image will be used for the badge.

This fix / improvement is applied twice

  * when displaying an user profile, its received badges;
  * when displaying current user achievements in eLearning;

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
Sébastien Mottet (oms) e3b5b20b39 [IMP] website_[profile|forum]: show filtering forum on user profile page
- A tag has been added next to the title of each tab in the profile when the user come from a specific forum. The goal is to indicate to the user that the displayed content is specific to a given forum. The tag can be clicked by the user to remove the applied filter.
- Change label in edit profile page from "real name" to "name"
Task Id: 2214425

closes odoo/odoo#48665

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-08 07:21:48 +00:00
Patrick Hoste e711dc08d4 [FIX] website_profile: fix edit profile issue
PURPOSE

Before this commit when an administrator edit another user's profile it
was his own data that displayed for the changes.
This commit fixes this issue.

SPECIFICATION

Add a test in both controller route when displaying the edit view and
when submitting the changes that check if the edited user is the same
as the actual user.

LINKS

Task ID : 2222043
PR : #48262

closes odoo/odoo#48575

X-original-commit: 4ab4de5b57a17002d8b14584c7d39a29e8bca357
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-30 09:24:14 +00:00
Romain Derie 98678199a3 [FIX] *: fix translations inconsistency in 't-set'
This commit fix most `t-set` errors that either led to:
  1. unwanted text to be considered as translatable.
     eg: `<t t-set="classes">text-left bg-100 p4</t>` would create an
     `ir.translation`.
  2. text that should be translatable were not.
     eg: `<t t-set="text" t-value="'Both'"/>` would not create an
     `ir.translation` while it should.

If a text should be translatable, it should never be inside a `t-value`:
  - `<t t-set="text">Both</t>`
If a text should not be translatable, it sould either be inside `t-value`,
`t-valuef` or the `<t>` tag should have `t-translation="off"`:
  - `<t t-set="classes" t-translation="off">text-left bg-100 p4</t>`
  - `<t t-set="classes" t-valuef="text-left bg-100 p4"/>`
  - `<t t-set="classes" t-value="'text-left bg-100 p4'"/>`

https://github.com/odoo/odoo/pull/43660
https://github.com/odoo/enterprise/pull/7839
https://github.com/odoo/design-themes/pull/203

closes odoo/odoo#43660

Related: odoo/enterprise#7839
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2020-01-21 15:32:08 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
David Beguin 5ac64d6e02 [IMP] website_slides_survey: add certification badges section to ranks badge page
This commit adds a section to distinguish the certification badges from the
other badges users may obtain in eLearning. Certification badges are available
on the ranks page, linked to a running survey. Clicking on them directly
redirects into the linked course.

Task ID : 1961053
PR #32594
2019-11-22 15:30:53 +00:00
David Beguin 6f0d36fa67 [REF] gamification : rename stat_* fields into granted_* to ease understanding
In this commit we rename stat_count into granted_count, and stat_count_distinct
into granted_users_count to reflect more what are those variables, aka count
of granted badges.

Task ID: 1961053
PR #32594
2019-11-22 14:44:39 +00:00
Thibault Delavallée 60bd39ae38 [FIX] website_profile: ensure top3 users cards have same height
Task ID 2003505
PR #34594
2019-11-05 15:08:34 +00:00
Thibault Delavallée 1d468caf94 [IMP] website_profile: handle both groupby and search in users page
Purpose is to support both search term and karma gain group by in the
URL, using keep_query.

Clean some code and move karma computation to res.users model to avoid
having sql in controllers.

Also fix some display issues.

LINKS

Task ID 2003505
PR #34594
2019-11-05 15:08:34 +00:00
Patrick Hoste bfbc7c6a18 [IMP] gamification: track karma change on users
PURPOSE

Allow karma gain tracking enabling notably display of top users based on
weekly / monthly gain in website profile.

SPECIFCIATIONS

Each time a user gains karma a record is created in the gamification karma
tracking model. Scheduled activity runs to consolidate the records into
monthly gain records to avoid having crowdy table and unnecessary noise
in karma gain.

This model is made private and only accessible through some dedicated
compute methods / controllers used in website profile.

In website profile module buttons are added to see users ranking based
on their total karma (like before) but also by last week and last month
gains (using the newly introduced tracking model).

LINKS

Task ID 2003505
PR #34594
2019-11-05 15:08:34 +00:00
mcm-odoo b29d0385ad [IMP] website_slides: add call to actions in user profile
Before this task, when the user arrived on his profile,
some empty sections didn't had any call to actions

task-2080615

closes odoo/odoo#38029

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-18 13:04:08 +00:00
c8c8eb3d56 [IMP] website_forum, *: revamp design
* web_editor, website_profile

Part of https://github.com/odoo/odoo/pull/35749
task-2024197

Co-authored-by: Jérémy Kersten <jke@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Co-authored-by: fja-odoo <fja@odoo.com>
2019-10-01 16:52:20 +00:00
Debauche Stéphane 34791aa403 [IMP] website_slides: clean navigation and breadcrumb with profile / courses
SPECIFICATIONS

  * Remove the /home from the breadcrumb in user profile
  * Rename the Home (on a specific course) into "Courses"

Task 2062640

closes odoo/odoo#36900

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-24 11:23:25 +00:00
Sébastien Theys b6288e5446 [IMP] *: remove image_64 and clean views
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...

64px is close enough to 128px that it can be removed without a big impact on
download size.

It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.

The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.

If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.

Views
=====

- remove width and height attributes when existing CSS rules are overriding them
  (eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
  of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
  image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules

task-2060865

closes odoo/odoo#36147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-19 10:23:39 +00:00
Thibault Delavallée 98f847be3a [FIX] website_{slides, profile}: fix display of not square user image
When having not square images for user avatar several issues appear

  * website_slides: heroes of the week banner is broken as circles are not
    circles anymore. They look more like UFOs or funny snowmen;
  * website_slides: my user status / leaderboard / achievements card display
    is broken as image may take much more width than planned;
  * website_slides: channel page view displays user avatar when having joined
    it, and it is broken;
  * website_profile: user avatars in top 3 of users karma ranking is broken.

In this commit we apply strict rules on width / height combined to an object
fit in order to always have a bioutifoul displayed circled image.

Task 2065425 (avatar ratio badly displayed)
PR #36756
2019-09-13 10:05:15 +00:00
qsm-odoo 8025205bb4 [IMP] web_editor, *: introduce wysiwyg frontend loader
* website_forum, website_profile

- Share some code between website_forum and website_profile by exposing
  a function in web_editor to instantiate a wysiwyg instance on a
  textarea

- Use no-lazy loaded JS to add a visual loading effect while the
  wysiwyg is not yet available.

This is made in preparation of task-2024197
(see https://github.com/odoo/odoo/pull/35749)

Thanks to @stefanorigano

closes odoo/odoo#36581

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-09-10 12:12:28 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
David Beguin b091014686 [FIX] elearning : show only website_published badges in profile
Before, we were adding a card slot for each badge but displaying information on this
slot only if the badge was website_published. This led to empty slots.

Now, we add only the section if the badge is website_published.

Also, the badge count should only display the number of website_published
received badge of the user. As the profile page is only displayed the information
about 'frontend' achievements (elearning and forum) of the user.

Task ID:2045192
PR #35321

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-31 09:08:44 +00:00
fja-odoo 736353b169 [IMP] website, *: improve published smart button
* = web, website_blog, website_crm_partner_assign, website_event,
website_event_track, website_forum, website_hr_recruitment,
website_livechat, website_partner, website_profile, website_sale,
website_sale_delivery, website_slides

The published button name is a bit ambiguous, now it will clearly state
what it does with a new title : "Go to Website". The "Published",
"Unpublished" state is shown with the globe icon changing color
(green and red) and a title on the button.

Badge and Delivery don't have a website page, the button will then be
a publish/unpublish button in the backend.

task-2002435

closes odoo/odoo#34261

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-08-08 16:05:33 +00:00
fja-odoo 5dac8f8f29 [REF] website, *: remove hardcoded image urls
* = website_forum, website_profile, website_sale,
website_sale_comparison, website_slides, website_slides_survey

Some image links were hard coded in the xml views of website, now they
are replaced with website.image_url(model, field).

Part of https://github.com/odoo/odoo/pull/34149
task-2007400

closes odoo/odoo#34149

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-05 13:24:22 +00:00
Sébastien Theys 1e9772889b [IMP] *: use image.mixin when appropriate
The following models are already using big images, or they might need big images
in the future:

- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00
Thibault Delavallée cd039b64d4 [FIX] gamification, website_{profile, slides}: correctly display next rank
This fix correctly displayed motivational of next rank to achieve depending
on current karma. Indeed description_motivational field is not the
motivational to reach next rank but to reach the current rank, taken from
previous rank point of view. That way a given rank is configured by modifying
only 1 data.

When not having any karma points (newly created user) the next rank is computed
as being the first available rank. Motivational phrases and badges are updated
accordingly. This commit partially reverts 489c8623e2.

Result

  * new user with no karma: next rank is the first rank;
  * user with karma and next rank: as currently;
  * user being at final rank: next rank is just current rank with a 100%
    circle;

Linked to task 2005840
Related to PR #34220
2019-06-28 13:45:33 +00:00
Thibault Delavallée f66453a0f5 [FIX] website_profile: correctly display rank position image in top 3 users
As user is a loop variable we can directly use its index instead of a rank
position that is not always correctly computed when not being logged due
to access rights issues.

Linked to task 2005840
Related to PR #34220
2019-06-28 13:43:19 +00:00
mgh-odoo 798aa51a00 [FIX] website_{profile, forum}: migrate events from forum to profile
After this commit  https://github.com/odoo/odoo/commit/ff870099c588e56 some of the events are left
in website_forum, that caused some buttons to be inactive. In order to fix that
events moved to website_profile.

Note: code is moved as it is. Cleaning class / namespace will be done in master
to avoid issues due to stable version.

Related to task 2006045

closes odoo/odoo#34138

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-28 05:02:45 +00:00
sri-odoo d334313125 [FIX] website_profile: fix ranks' imgs alignment
task-2025167

closes odoo/odoo#34238

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-27 10:24:50 +00:00
mgh-odoo 75fb46d848 [FIX] website_profile: use wysiwyg editor instead of textarea for biography
Currently, while editing user profile from frontend, biography is displayed in
textarea despite of being an HTML field.

This commit fixes the behavior by providing users with wysiwyg ediotr to
update their biography while editing profile from frondend.

task-2007731

closes odoo/odoo#34207

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-21 12:48:04 +00:00
Aurélien Warnon 489c8623e2 [IMP] website_[profile,slides]: improve karma rank layout
This commit improves the karma rank layout displayed on the courses home page
and on the user profile.

Task #2003222
2019-06-13 06:39:32 +00:00
Patrick Hoste 94c332b499 [FIX] website_profile: changes the display of the users search error message
The error message now display a message containing the term of
the search and it is also not always displayed as it was before

Task ID : 2036652

closes odoo/odoo#35052

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-22 07:38:23 +00:00
David Beguin 3e5d2e7942 [FIX] website_profile : fix text wrap for badge card in user profile
Task ID : 1935136
Closes PR #31486
2019-07-15 08:16:43 +00:00
Jeremy Kersten 9f56353b79 [FIX] w_profile: don't call _get_users_karma_position without users
Before this commit, if you was searching something that return no results,
you will call the sql query generating an error syntax:

Traceback:
ERROR: syntax error at or near ")"
LINE 8:             WHERE sub.id IN ()

Now, we don't make more useless query if we know that there are no users.
+ preventive fix the call of this method without user_ids

This commit is related to #14667

closes odoo/odoo#33715

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-28 09:51:38 +00:00
Jeremy Kersten 45e1d196f9 [FIX] website_profile: use company from the partner
This commit closes #14667 again

closes odoo/odoo#33697

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-27 10:14:23 +00:00
Quentin Mourier 369143c986 [FIX] website_profile: allow to edit its profile
Move code from website_forum allowing to edit its own profile. Otherwise
fields to update are not white listed. Also add an unpublished flag when
seeing unpublished users in order to know it if you have access to
depending on ACLs.

Linked to task 1978530
Related to PR #33559
2019-05-22 09:16:30 +00:00
Goffin Simon 9fe9715e99 [FIX] website_profile: Impossible to edit website profile
Steps to reproduce the bug:

- Create a new profile P with "free signup"
- Log with P
- Go to website profile of P
- Send an email to valide the email of P
- Click on the generated link in the verfification email
- P is able to edit his profile
- Open a new session with P

Bug:

P was not able to edit his profile because the variable "validation_email_done" is
reset to False. Now the karma on the user is checked (inspired from website_profile
in template "email_validation_banner")

opw:1984576

closes odoo/odoo#33335

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-13 13:10:43 +00:00
qmo-odoo f4b5b709a1 [FIX] website_profile: allow administrators to update profiles
Before this commit, only the users who validated their email could change
their own profile. In addition to that behavior we let administrators update
all profiles.

Commit linked to task ID 1978530 (fixes linked to internal testing).
2019-05-03 09:43:12 +00:00
sri-odoo e621e728e4 [IMP] website_profile: reduce bootstrap customization and improve circular progress design
Purpose: reduce some customization and ease eLearning link with themes. For
that purpose use the body class name propagation recently added.

Also mask the initial part of the circular progress, removing the border
radius effect.

Linked to task 1958372
Related to PR #32648
2019-04-23 09:34:41 +00:00
qmo-odoo 7c8834459e [IMP] website_slides,_profile: Improve elearning UX
This commit changes:
  - In elearning homepage, change "Heroes of the week"
    to "leaderboard of the week"
  - In user profile, change "Rank: Master" to
    "Current Rank: Master"
  - In the "Edit Profile" view, remove the required
    on the description text area

Task: #1961116
PR: #32621

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-11 15:02:13 +00:00
David Beguin a515e21b6e [FIX] website_profile : set badge image instead of badge level icon in badge page
Set badge image if any instead of forcing badge level icon in badge page.
If badge has no image, use the badge level icon. And if no badge level, show default placeholder icon.

Task ID: 1961700
PR #32255

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-29 14:46:57 +00:00