From c32e7b27fec09dc72e5ae41d37037bf2f173651f Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Tue, 1 Aug 2023 16:29:04 +0200 Subject: [PATCH] [IMP] website, *: prevent abuse of h1 and use font size classes *: website_event, website_forum, website_livechat, website_mass_mailing, website_slides This commit permits to reduce the risk to have a wrong h1 tag or multiple h1 tags on the same page. This commit replaces some h1 tags with a h2 in snippets. In addition, this commit removes some font sizes written in the style attribute and replaces them with a font size class now that they are possible to use and edit as an user. task-1958098 Part-of: odoo/odoo#129791 Co-authored-by: qsm-odoo --- addons/website/static/tests/tours/link_tools.js | 4 ++-- .../static/tests/tours/snippet_table_of_content.js | 8 ++++---- addons/website/static/tests/tours/text_animations.js | 2 +- addons/website/views/new_page_template_templates.xml | 4 ++-- addons/website/views/snippets/s_banner.xml | 2 +- addons/website/views/snippets/s_carousel.xml | 6 +++--- addons/website/views/snippets/s_cover.xml | 2 +- .../views/snippets/s_mega_menu_big_icons_subtitles.xml | 2 +- addons/website/views/snippets/s_mega_menu_cards.xml | 2 +- .../views/snippets/s_mega_menu_images_subtitles.xml | 6 +++--- .../website/views/snippets/s_mega_menu_little_icons.xml | 4 ++-- addons/website/views/snippets/s_mega_menu_thumbnails.xml | 8 ++++---- addons/website/views/snippets/s_picture.xml | 2 +- addons/website/views/snippets/s_popup.xml | 2 +- addons/website/views/snippets/s_table_of_content.xml | 4 ++-- addons/website/views/snippets/s_text_cover.xml | 2 +- addons/website/views/snippets/s_title.xml | 2 +- addons/website_event/views/event_templates_page_misc.xml | 4 +--- addons/website_forum/models/forum_forum.py | 2 +- .../views/forum_forum_templates_forum_all.xml | 2 +- addons/website_livechat/views/website_livechat.xml | 6 +++--- addons/website_mass_mailing/views/snippets_templates.xml | 2 +- addons/website_slides/data/slide_slide_demo.xml | 6 +++--- 23 files changed, 41 insertions(+), 43 deletions(-) diff --git a/addons/website/static/tests/tours/link_tools.js b/addons/website/static/tests/tours/link_tools.js index 6ad8351152b..1e14c78a18e 100644 --- a/addons/website/static/tests/tours/link_tools.js +++ b/addons/website/static/tests/tours/link_tools.js @@ -320,7 +320,7 @@ wTourUtils.registerWebsitePreviewTour('link_tools', { wTourUtils.clickOnElement("mega menu", "iframe header .o_mega_menu_toggle"), wTourUtils.changeOption("MegaMenuLayout", "we-toggler"), wTourUtils.changeOption("MegaMenuLayout", '[data-select-label="Cards"]'), - wTourUtils.clickOnElement("card's text", "iframe header .s_mega_menu_cards font"), + wTourUtils.clickOnElement("card's text", "iframe header .s_mega_menu_cards p"), { content: "Enter an URL", trigger: "#o_link_dialog_url_input", @@ -328,7 +328,7 @@ wTourUtils.registerWebsitePreviewTour('link_tools', { }, { content: "Check nothing is lost", - trigger: "iframe header .s_mega_menu_cards a[href='https://www.odoo.com']:has(img):has(h4):has(p font)", + trigger: "iframe header .s_mega_menu_cards a[href='https://www.odoo.com']:has(img):has(h4):has(p)", run: () => {}, // This is a check. }, ...wTourUtils.clickOnSave(), diff --git a/addons/website/static/tests/tours/snippet_table_of_content.js b/addons/website/static/tests/tours/snippet_table_of_content.js index 0c5c0a2dd03..2f82ebd30a7 100644 --- a/addons/website/static/tests/tours/snippet_table_of_content.js +++ b/addons/website/static/tests/tours/snippet_table_of_content.js @@ -4,8 +4,8 @@ import wTourUtils from '@website/js/tours/tour_utils'; const scrollToHeading = function (position) { return { - content: `Scroll to h1 number ${position}`, - trigger: `iframe h1:eq(${position})`, + content: `Scroll to h2 number ${position}`, + trigger: `iframe h2:eq(${position})`, run: function () { this.$anchor[0].scrollIntoView(true); }, @@ -41,7 +41,7 @@ wTourUtils.registerWebsitePreviewTour('snippet_table_of_content', { ...wTourUtils.clickOnEditAndWaitEditMode(), { content: "Click on the first TOC's title", - trigger: 'iframe .s_table_of_content:eq(0) h1', + trigger: 'iframe .s_table_of_content:eq(0) h2', }, { content: "Hide the first TOC on mobile", @@ -49,7 +49,7 @@ wTourUtils.registerWebsitePreviewTour('snippet_table_of_content', { }, { content: "Click on the second TOC's title", - trigger: 'iframe .s_table_of_content:eq(1) h1', + trigger: 'iframe .s_table_of_content:eq(1) h2', }, { content: "Hide the second TOC on desktop", diff --git a/addons/website/static/tests/tours/text_animations.js b/addons/website/static/tests/tours/text_animations.js index 7ca74cc2b56..a88b8a1a3ea 100644 --- a/addons/website/static/tests/tours/text_animations.js +++ b/addons/website/static/tests/tours/text_animations.js @@ -13,7 +13,7 @@ wTourUtils.registerWebsitePreviewTour("text_animations", { }), { content: "Click on the snippet title", - trigger: "iframe .s_cover h1 > font", + trigger: "iframe .s_cover h1", run: "dblclick", // Make sure the title is selected. }, { diff --git a/addons/website/views/new_page_template_templates.xml b/addons/website/views/new_page_template_templates.xml index e4c6c2762c0..9eed0a79192 100644 --- a/addons/website/views/new_page_template_templates.xml +++ b/addons/website/views/new_page_template_templates.xml @@ -1093,10 +1093,10 @@ overridden by modules), because: Intuitive system Design features - + table_of_content_heading_1_1 - + table_of_content_heading_1_2 diff --git a/addons/website/views/snippets/s_banner.xml b/addons/website/views/snippets/s_banner.xml index 9d327879485..f22b1bc3262 100644 --- a/addons/website/views/snippets/s_banner.xml +++ b/addons/website/views/snippets/s_banner.xml @@ -6,7 +6,7 @@
-

Sell Online. Easily.

+

Sell Online. Easily.

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.


diff --git a/addons/website/views/snippets/s_carousel.xml b/addons/website/views/snippets/s_carousel.xml index e87a6db88a1..937a50c77a3 100644 --- a/addons/website/views/snippets/s_carousel.xml +++ b/addons/website/views/snippets/s_carousel.xml @@ -18,7 +18,7 @@