Tuesday, June 25, 2024
1 change · saas-17.2
Enhancements to existing features
Website visitors can now switch event pages between list and grid layouts when both options are enabled. Their choice is remembered during the session, and the list layout has been simplified to make event browsing quicker and cleaner.
Original PR description
[TASK](https://www.odoo.com/web#id=3869970&cids=1&menu_id=6478&action=4043&model=project.task&view_type=form) This commit adds a switcher to the event list view to allow the user to switch between a…
[TASK](https://www.odoo.com/web#id=3869970&cids=1&menu_id=6478&action=4043&model=project.task&view_type=form) This commit adds a switcher to the event list view to allow the user to switch between a list and a grid view of the events. The switcher is only displayed if both grid and list views are enabled in the web editor. Each time the user switches between the views, the preference is sent to the controller and saved in the session as a 'layout_mode' setting. If no preference is set, the default view is the first view enabled of this list : grid, list. This commit also changes the style and layout of the list view to make it more compact and simple. As we want the switcher to be quick, it is not possible to reload the page when the user switches between the views. Instead, we use some javascript to toggle or replace some CSS. Note that as the grid and list view are really different, it was too complicated to switch views by using the same html elements. I have decided to load both views in the DOM and to hide the one that is not displayed.