Commit Graph
176 Commits
Author SHA1 Message Date
Patrick Hoste e42ee496f8 [IMP] website_slides: add comments on answers showed after answering a quiz
PURPOSE :

A quiz after a course content is a good way to check if the user gets the previous lesson.
Despite, the user/student may not understand why his answer was wrong/correct.
In this task we'll allow the teacher to add a comment next to the asnwer of a quiz.

SPECIFICATION :

The quiz creator will now be able to comment the answers to inform the frontend user why
his answer is wrong/correct. He will be able to add the comments both in backend and frontend.

Task ID : 2072566
PR : #41188

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-24 08:56:12 +00:00
Debauche Stéphane 01dadaecca [IMP] website_slides: improve error message when google API key is invalid
Currently when there is an issue with the google API key, a generic message
is send to the user, with the error details embedded in it in an ugly way.

Now a message is displayed: "Your Google API key is invalid, please update it
into your settings. Settings > Website > Features > API Key". This is done
by parsing the JSON google sends back after request and determining if the
error is linked to the API key.

Task #2082857

closes odoo/odoo#40547

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-20 12:24:43 +00:00
Thibault Delavallée 5649fc88e8 [REF] {website_}mail: move and replace published field of mail.message to is_internal
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

Website mail defines a website_published field allowing to publish / unpublish
comments on the frontend of some modules. This field has several drawbacks :

  * it is used only for front-end people (portal, public) and has no real
    effect in chatter / classic discussions;
  * it is used only in some advanced front-end module and is not available
    in portal by default;
  * its naming is not really correct as it is not linked to fields coming
    from the website_published mixin and its behavior is not really
    the same;
  * its use is a bit duplicated with internal flag coming from subtype
    allowing to hide messages related to an internal subtype;
  * there are overrides of standard mail.message methods just to handle
    this flag;

In this commit we change that field by an is_internal flag directly on
mail.message model itself. It tells if share people (customers, share users)
are allowed to read the message. This field can be given through posting
API or set manually using widgets. It is also used in access rights custom
methods and managed like the internal flag of subtypes.

Mailgateway was already using an internal flag for internal note replies. It
is renamed to is_internal and propagated as it is now a standard field. It
also eases code understanding.

Portal is updated to allow managing the flag directly. It means customer portal
now natively allows to moderate customer comments without any need of website
modules.

Rating is updated accordingly. An is_internal field is added, replacing the
related on website published.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Florimond Husquinet (fhu) 0a46e086c0 [IMP] website_slide: improve the ways to search through courses
PURPOSE

Purpose of this commit is to improve search capabilities of eLearning
frontend application. Searching tags and content should be easier to
do, update and notice.

SPECIFICATIONS

Before this commit
- There is no visual indication to what are the selected filters.
- The user can only select one tag in each dropdown box.
- When the user selects a tag on one course card, this tag replaces all other
filters.
- When the user enters custom search terms, it replaces all other filters.
- When searching a documentation, a stacktrace appears.

After this commit
- Selected tags appear as little tag boxes under the search bar.
- The custom search terms appear as one tag box.
- It's possible to remove a search tag by clicking on the cross present in each
little box.
- It's possible to select multiple tags in each dropdown box.
- Tags in course cards work the same as tags in dropdown boxes, and add
themselves to the list of filters.
- To generate the list of courses to display, a logical OR is operated between
tags of the same group, and a logical AND is operated between groups of tags.
- A logical AND is operated between the custom search terms and other filters.
- A logical AND is operated between the "My courses" options and other filters.
- Bug when searching a documentation is fixed.

LINKS

Task ID: 2080617
PR #39259

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 10:18:36 +00:00
Hoste Patrick ec9e389f2f [IMP] website_slides: allow to create and update quizzes directly in frontend
Purpose is to ease designing your courses by allowing to create and update
slide quiz directly in frontend, within the slide display.

With this commit you are able to

  * add a quiz to a slide or add a question to an existing quiz;
  * edit an existing question from a quiz:

   * change the title of the Question;
   * add, remove or update answers;
   * change the right answer;
   * delete an existing question;
   * reorder the questions from a quiz;
   * reset the quiz for the current user if he is a website designer, allowing
     to test the quiz and its answers;

New frontend widgets are introduced allowing to manipulate quiz. Slide page
now supports a readonly / taking quiz mode and an edit mode for quizzes
used notably for website designers / course maintainers.

Task ID : 1999636
PR : #35326

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-29 13:36:25 +00:00
David Beguin be3f074a91 [REF] gamification, * : rename challenge.category into challenge.challenge_category
To ease grep in the code, especially that challenge is quite heavily used.

Task ID : 1961053
PR #32594
2019-11-22 14:45:39 +00:00
laa 92cc770c90 [IMP] website_slides: indicate new content on courses to users
Purpose of this commit is to help users knowing there is new content in a
course by adding a visual insight. It is done through a new content arrow
displayed in courses homepage.

Regarding the file "website_slides_templates_homepage.xml", the choice to
incorporate the t-call attribute into a 't' balise was necessary to display
the customize option (part front) associated with the model course_card.

Side dish usability improvements raised during development

  * display completed courses as last instead of first in "my courses";
  * do not show promote strategy field for training courses as it has no
    use, only for documentation courses;

TASK ID 2025186
Closes PR #36703

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20 14:59:07 +00:00
ryv-odoo c7a1a2d964 [REF] rating, various: improve rating.rating ACLs
PURPOSE

Rating model should be available only for internal users. External users
access them only through dedicated routes or controllers using sudo and/or
granting access through tokens. Therefore simplifying ACLs should be feasible.

SPECIFICATIONS

Remove access to rating.rating for public and portal users. Only employees
can access it, with full access given to system admins.

Update various functional flows to use sudo() and check that access is
verified before using sudo.

Impacted modules

  * rating / mail: add groups on some rating related fields as only
    internal users should access them now;
  * rating / mail: set some statistics fields using compute_sudo as their
    value should be accessible for external people even without access to
    the underlying rating.rating records;
  * project: makes some use of rating and has to be updated, notably for
    the public rating page;
  * website_{livechat, rating, slides}: add sudo in public routes as access
    is already granted;
  * website_slides: set statistics field using compute_sudo as their
    value should be accessible for external people;

TASK ID 2053096
PR #36592

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-19 15:46:51 +00:00
Patrick HosteandAurélien Warnon c957949b8c [IMP] website_slides: add an animation when user levels up
PURPOSE

If a user levels up after passing a quiz, we want to clearly show him in the success modal that he
actually passed a level instead of just showing his new rank and xp gauge.

This commit introduces an animation with the progress bar when the user is levelling up.

After reaching the upper bound of the next level:
- The progress bar goes back to 0 ;
- The lower/upper bounds change to reflect the new reached level bounds ;
- The message "Amazing!" becomes "Level Up!" ;
- The motivational phrase changes with a fade out/fade in animation.

LINKS

PR : #39870
Task ID : 2032649

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2019-11-06 13:01:17 +00:00
Jeremy Kersten e19227d3ba [IMP] website*: clean sitemap
From now, you need to explicitely add sitemap=True if you want your controller
into the sitemap.

It's the default value, but if you forgot it, it will raise a Warning on runbot.
It will avoid wrong controller in sitemap and duplicate (empty) content.

From now, if your model contains a field website_id, the modelConverter for
sitemap will automatically add the domain:
   "[('website_id', 'in', (False, current_website_id))]"

It avoid redundant declaration and ugly url in redirect/rewrite view.

Migration: need to remove it from url_from in website.rewrite

task-2065018

closes odoo/odoo#39427

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-28 10:36:56 +00:00
fw-bot d128200f18 [FIX] website_slides: don't crash when the slide has been archived
opw-2089868

closes odoo/odoo#39227

X-original-commit: 2dc54945746223525762d10128bffbc9530a3591
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-23 08:03:41 +00:00
Romain Derie 9b38bcec12 [IMP] website, website_*: improve edit in backend feature
*base, website_blog, website_event, website_forum, website_slides

With this commit:
1. It is now possible to add the 'Edit in backend' entry in the frontend navbar
   for any desired model, not only the ones which have the published mixin.
   It will simply redirect to the main_object form view.
   This commit add it to Forum and Blog.
2. When clicking on 'Edit in backend', it is now possible to land on another
   module than Website.
   That's especially useful for events and slides which are not directly
   related to the website module as they have their own module.
3. Remove the custom Edit in backend from the forum homepage (fa-cog).
   Opportunity was also taken to remove the 'edit welcome message'.
   It will now be editable through the editor (welcome message will appear in
   edit mode). Thus we got rid of the custom edit welcome message controller
   and views.

Closes #36325
2019-10-02 07:13:26 +00:00
Florent Lejoly 8ea761824d [FIX] website_slides: leave course
Currently there is a traceback when trying to leave a course (unsubscribe)
from the frontend on the homepage of a specific course. (when clicking on
"You're enrolled")
This fixes the traceback.

closes odoo/odoo#37384

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-24 13:43:18 +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
laa 443b44c971 [IMP] website_slide: add toggle button achievement
Add an option to add the latest achievements in the right sidebar.

closes odoo/odoo#36870

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-13 13:05:31 +00:00
Thibault Delavallée a08845d2a3 [IMP] website_{rating, slides}: allow to manage attachments when updating reviews
PURPOSE

Allow to manage attachments when updating a frontend review.

SPECIFICATIONS

Currently when posting a review in eLearning or eCommerce one can attach
files to its review thanks for portal composer. Rating popup composer allow
to update its comment and rating. However this edit mode has two limitations.
It does not display attachments previously added and does not allow to add
attachments.

This commit fixes that by

  * giving attachment values to the composer, allowing its display by the
    composer display at startup;
  * allowing to give new attachments and properly handle them in slides
    route;

Uploaded and validated attachments cannot be removed by users. Indeed
message with attachments has probably already be sent to people and removing
attachments would lead to information loss.

LINKS

Task 2066600 (manage attachments)
Task 2058595 (eLearning v13 testing)
2019-09-04 11:41:59 +00:00
laaandMichaël Mattiello c4eba6f5b1 [FIX] website_slides: correctly set sequence of newly added content
Purpose of this commit is to add new content at last position in frontend.
Indeed backend uses last position in embedded list view, frontend should
do the same. Moreover when having a lot of content, having everything at
the bottom of the screen at the same position of Add content / section
buttons makes sens.

Specifications

  * when adding a new category: add it as last category;
  * when adding a new slide in a category: add it as last slide of the
    category;

Specific case of slide without category

  * when adding a new slide without category: add it as last slide of the
    channel (display it as last) but keep it on top in backend view
    (display as first);

Improve content list display in frontend of eLearning

  * contents without section are now at the bottom;
  * fixed alignment of buttons icon (Add Content and Add Section)
  * fixed broken design because of title too long

Task 2049640 (website slides back2basics and fiximp)
Task 2061672 (new content bug report)

Co-Authored-By: Michaël Mattiello <mcm@odoo.com>
Co-Authored-By: Alexis Lacroix <laa@odoo.com>
2019-09-03 15:02:18 +00:00
mcm-odoo 373d59e866 [IMP] website_slides: add a toggle button to display/hide leaderboard
Before this commit, leaderboard was displayed only if user was not connected.
As we feel this is very interesting to show we decided to display it in all
cases (either connected or not) on eLearning frontpage. Activating it is
now done using an entry in the customize menu.

Task 2005981

closes odoo/odoo#35791

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-30 09:31:23 +00:00
mcm-odoo addaec1211 [IMP] website_slides: add modal to (un)subscribe or leave a course
- Before it was not possible to leave a course.
- This commit adds a modal to give the members the possibility to leave
  the course and also subscribe or unsubscribe to get notified or not.
  + Display a warning message when leaving if field enroll value is "payment".

task-1985511
2019-08-22 13:11:31 +00:00
Hardik Prajapati 230c544caa [FIX] website_slides: fixed the traceback when add a new section on a course
in this commit, we have set the correct attribute(field's name) to fix
the traceback while we adding a new section on a course using website

task-2053822

closes odoo/odoo#35786

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-19 06:21:06 +00:00
mcm-odoo 2ab0bd3236 [IMP] website_slides: add button to install Surveys application in Slide Upload modal
PURPOSE

Ease discovering of eLearning features by allowing to install surveys
directly from frontend in order to allow certification.

SPECIFICATIONS

Add a button in Upload a document to install Surveys. This button only
appears if surveys is not installed.

When button is clicked, ask for confirmation before installing survey.

LImitate this feature to group system: system people should see the button
and use standard ACLS about module installation.

LINK

Task ID 2026846
2019-08-12 15:40:36 +00:00
Aurélien Warnon 5e4f37a1f8 [REF] website_slides: remove index_content field from slide.slide
The 'index_content' field was only filled when uploading from the frontend.
That would lead to inconsistent results when creating/updating 'presentation' slides from the slide.slide form view.
The field was also not cleaned if the slide content changed.

As it's usage was not very clear (only on a 'search', and not very intuitive), we simply removed the field.
2019-08-12 15:40:36 +00:00
Aurélien Warnon 5269d8c27f [REF] website_slides: improve duration computation of a slide/course
The completion time of a slide now has default values for slides of type

  * video (duration of the YouTube video);
  * PDF (number of pages * 5 minutes);

This computation is done when uploading a slide in frontend or by an onchange
in backend. Field can still be given / modified by elearning people as
result may not be reliable (pdf parsing is not accurate, and/or you may
estimate time differently from strict page-based computation).

The course will sum up all durations of its (active) slides. Display has been
changed from "x minutes" to "x hours y minutes".

Task ID 2007294
2019-08-12 15:40:36 +00:00
Aurélien Warnon 654e9dd658 [FIX] website_slides: fix error message display on upload
When uploading twice the same video for a channel, the error message displayed unhandled html.
We removed the html to avoid having to use $el.html() for better safety (and it should not happen often anyway).
2019-08-08 08:37:22 +00:00
qmo-odoo b180c66a80 [REF] website_slides: replace slide.category by slide with is_category flag
PURPOSE

Like already done for sale order, invoice of survey, purpose of this commit
is to remove category model and replace by a flagged line (slide). It allows
to easily reorder slides in an embedded list view.

SPECIFICATIONS

Instead of having a fully fledged slide.category model, slide.slide will serve
that purpose with a is_category flag. This will allow to drag and drop slides
and sections in the channel form view.

This change had an impact on the way slides were added/sorted on the front-end.
In fact, whenever a slide is added from the front-end, a resequencing of all
the slides in the course has to be triggered.

Category of a slide is now a computed field based on the sequence. Order
of slides is based on sequence, with categories splitting the slide list based
on is_category flag.

In this commit tests are added. Some cleaning in tests is also performed to
speedup a bit tests (savepointcase) and some cleaning / renaming to ease
their understanding.

Future commit will add JS necessary to manage slides in the section list view.

LINKS

TaskID: 1978731
PR: #33255
2019-08-08 08:29:34 +00:00
Jérémy HennecartandThibault Delavallée 4587e6a396 [REF] website_slides: make eLearning an application with its own menu structure
PURPOSE

eLearning should have its own application in manager. Indeed this is becoming
a big application and having it embedded inside Website application is not
enough anymore. It should also hold updated and easy-to-use menus,
navigation, actions and views in backend.

SPECIFICATIONS

Update manifest and make website_slides an application separated from
website embedded menus.

Implement new menu structure

  * Courses
    * Courses
      List view: Course Name, # Views, # Attendees, # Ratings, Revenues,
      Reviews
    * Contents

  * Reporting
    * Courses: list view on slide.channel model, ordered by # views.
        * add a graph view (group by content)
    * Contents: graph view on slide.slide model
        Area Graph: X month
        Y measure: # Views (others measures: Attendees, ...)
        Group by: course (color)
    * Reviews: see kanban of latest reviews;
    * Quiz: list view on slide.question model.
        List view: Add # Quizz Trials, # Quizz Passed, Avg Attempts

  * Configuration
    * Settings
      * Allow Forum on Courses (installs website_slides_forum)
      * Allow Certifications (installs website_slides_survey)
      * Allow Selling Courses (installs website_sale_slides)
    * Course Tags
      * See channel.tags.group with label Course Tags, form view allow to
        configure group tags
      * https://drive.google.com/a/odoo.com/file/d/1G0g2UnG5cZG55EXQ5icbgwe7T2eSZskT/view?usp=drivesdk
      * On click: open :https://drive.google.com/a/odoo.com/file/d/1I_PW3aZAbrslXadiYqmVF-_6dGXx8knd/view?usp=drivesdk
    * Content Tags

This structure will gain new items in sub-modules, notably bridge with
form and website_sale. Those will be implemented in next commits.

LINKS

Task 1978729
PR #35061

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
2019-08-05 08:40:33 +00:00
Thibault Delavallée ad9d7c5c06 [FIX] website_slides: fix breadcrumb when viewing a slide from a category search
Template expects a category record but controller gives the ID of it.
Oversight of 4ccd859bd4

LINKS

Task 1978729
PR #35061
2019-08-05 08:30:06 +00:00
Romain Derie cc1d78a80b [IMP] *: correctly read/write website_published
The `website_published` field from the website's mixins is basically a readonly
from `is_published` field.
On read, this field will simply read `is_published` and check if the record's
website_id is accessible (only for the multi mixin).
On write, it will always write on `is_published`.

This commit improves a few things:
- A lot of code was writting on website_published which was just then writting
  on is_published. Writting directly on is_published makes more sense.
- Some backend fields would still reference `website_published` instead of
  `is_published` which would just go through the related for no reason.
  Plus, using `is_published` will make the field tooltip more accurate as we
  are not in a website context ('Visible on current website' to 'Is Published')
- Filter and search on tree view were still using the `website_published`
  related field, which is just a readonly when we are not in a frontend
  context.
- Some create and write function would have security check on
  `website_published` value but that was wrong as the user could bypass that by
  simply writting on `is_published`. For the write method, check `is_published`
  is more accurate as it will cover both case since `website_published` will
  then call the write method on `is_published`
2019-08-03 09:51: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
Patrick Hoste 38b5a666c5 [IMP] website_slides: add a share button on the fullscreen view
A share button has been added to the fullscreen view to avoid
exiting the view to access the share tab on the full description
of the slide.

Task ID : 1984509

closes odoo/odoo#33418

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-19 08:31:20 +00:00
Patrick Hoste af690f678f [IMP] website_slides: allow to toggle free preview from frontend
Purpose of this commit is to ease slides / lessons management in eLearning
frontend.

The publisher will now be able to see if a slide is in preview mode from
the slide list in frontend of eLearning.

He'll be able to activate/deactivate the free preview mode with a button.

Task 1999705.

closes odoo/odoo#34182

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-19 06:57:44 +00:00
qmo-odoo c90d374800 [IMP] website_slides: removed rating mixin and access token on slide model
Indeed we don't rate slides, we rate courses. Therefore rating mixin is not
necessary as well as access token.

Access token field as we are using the _mail_post_access and a karma check.

Commit linked to task 1952064.
2019-07-18 14:19:19 +00:00
Martin Trigaux 1f5a4649a6 [MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 13:59:35 +00:00
Christophe Simonis 5e81b18e24 [MERGE] forward port branch saas-12.3 up to 0247d2f35f 2019-06-27 20:45:52 +02:00
Christophe Simonis cf51b5f25d [MERGE] forward port branch saas-12.3 up to 793933a128 2019-06-25 14:23:48 +02:00
qmo-odoo cd8afe8546 [IMP] website(_sale)_slides: Add login,join,buy button on quiz
This commit improves the elearning onboarding on the quizzes

If the user is not logged in, a log in button will show up under
the quiz

If he is logged in but not a member of the course and the course is public,
a join button will appear under the quiz

If the course needs to be bought, a buy button will appear under the quiz.

If the course is on invite only, a message under the quiz will inform the
user about it

TaskID: 2003986
PR: #33861

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-24 10:51:27 +00:00
Thibault Delavallée d5f8e39923 [FIX] website_profile: fix leaderboard / top3 computation
Contains some small fixes

  * correctly order leaderboard by descending karma, not creation date;
  * top 3 users displayed in footer banner should be published, otherwise
    displayed images do not match the top 3 displayed in the page displayed
    when clicking;
  * correctly say Leaderboard is an overall leaderboard, not only limited
    to the current week;

Linked to task 2005840
Related to PR #34220
2019-06-28 13:43:19 +00:00
Priyanka Kakadiya e6bfad41f2 [FIX] website_slides: fix archived slides traceback
before this commit:
When a user tries to see an archived slide, it throws an internal server error
instead of 404 page

after this commit:
404 page will be shown if a slide is archived

task- 2018147

closes odoo/odoo#34198

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-18 05:58:56 +00:00
qmo-odoo 4ccd859bd4 [FIX] website_slides: Fix the breadcrumbs on a slide content
This commit adds the name of the currently viewed slide
to the breadcrumbs at the top of the page

Task ID: 1999672
PR: #33635
2019-06-14 13:18:26 +00:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Aurélien Warnon d763186497 [FIX] website_slides[_forum]: correctly redirect to review on linked forum
When the channel has a linked forum, the "Review" link on the forum should redirect the user
to the "Review" tab on the course page.

Task #2003222

closes odoo/odoo#33786

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-13 06:39:32 +00:00
Aurélien Warnonand@stefanorigano <sri@odoo.com> 3a487bdde3 [IMP] website_slides: add top 3 users avatars in courses home footer
This commit improves the footer image of the slides home page by adding
the top 3 users avatars (ordered by karm desc) in the image.
We only fetch users that have an image set as avatar.

Task #2003222

Co-authored-by: @stefanorigano <sri@odoo.com>
2019-06-13 06:39:32 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Thibault Delavallée 8c642167e9 [FIX] website_slides: propose to signup instead of login
When joining a course of liking a slide if the user is not logged there
is a popover asking him to login. If auth signup allows user creation
link instead redirects to signup instead of login to save a click and
improve onboarding.

closes odoo/odoo#33755

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-29 13:40:04 +00:00
Denis Ledoux b85a135a89 [FIX] website_slides: order channels by the natural order when unspecified
In the backend, the user has the possibility in the channels list to drag and drop
channels to define their order, thanks to the `sequence`.

This order was then not respected in the front-end when displaying the slides channel
`/slides/all`.
This was basically not possible for the user to control the order in which
the channels were displayed.

With this revision, when the order is not specified to the controller,
or is wrong, it fallbacks to `None`, which therefore follows the slides channel natural
order, which is `sequence, id`. The user can now control the order of the slides channels
in the front-end.

closes odoo/odoo#33745

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-29 09:49:43 +00:00
Sébastien Theys d445f46806 [FIX] *: convert image route size param to int and use named param
* = tools, base, web, website_profile, website_slides

Before this commit it was impossible to pass those parameters in the URL because
they were received as string but expected as int.

The opportunity is also taken to properly use named parameters when calling
`image_process`.

closes odoo/odoo#33506

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-21 10:34:40 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
qmo-odoo b6f185b45d [FIX] website_slides: Remove read access on slide.answer
This commit removes the read access on slide.answer for all
users except website_publisher and admin

Task: #1947884
PR: #32083

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-06 06:24:38 +00:00
Sébastien Theys 7d3fe51100 [FIX] http,web,website_*: return the correct Content-Type for images
* = website_profile, website_slides

Before this commit, the returned Content-Type was not always correct, for
example if the image tool was changing the format, which happens when given
a BMP (converted to PNG), or other types being converted to JPEG.

The previous method `force_contenttype` was too specific and it wasn't available
in every controller. It didn't even need to be a controller method because it
didn't use self.

Now we create a generic helper to ease updating headers.
The Content-Type is only updated when it is safe to do. It is especially unsafe
for example for SVG files.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00