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
As image fields have been renamed recently [1] we have to update controllers
of profile in order to write on image_1920, not image anymore.
Task 2067872 (eLearning internal testing)
Task 2058598 (survey internal testing)
PR #36756
[1] See 58a2ffa26f
* 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
closesodoo/odoo#36581
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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>
* = 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
closesodoo/odoo#34261
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
* = 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
closesodoo/odoo#34149
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
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
Install website_slides, create a bunch of users all published on the
website. Using raw sql queries, give some karma to those users. Go to
the `/profile/users` web page. When connected the ranking is correctly
shown, when not connected all users are ranked 0.
The problem is that the public user (id: 4) can only access is own user
which prevent him to access the karma of the other user required to rank
them.
As the injected IR Rules are not adding any value and that a domain is
applied already, it is safe to skip the ir rules.
opw-2029105
closesodoo/odoo#34656
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
closesodoo/odoo#34207
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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
closesodoo/odoo#34138
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit improves a few methods related to the user profiles:
- Change _prepare_all_users_values so that it
works with a batch of users
- Change the _get_user_certificates and rename it to _get_users_certificates
so that it works with a batch of users to avoid doing a search in a
list comprehension.
This method will also be used to get the number of certificates per users
TaskID: 1952064
PR: #32229
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#35052
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
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).