From e7e64b2ca385ed375c62d38726189d7231d38076 Mon Sep 17 00:00:00 2001 From: benjamin <benjamin@le-filament.com> Date: Tue, 25 Feb 2025 12:20:11 +0100 Subject: [PATCH] [CLEAN] exclude templates from pre-commit --- .pre-commit-config.yaml | 1 + templates/blog_templates.xml | 44 ++++++++---------------------------- templates/portal_layout.xml | 4 +--- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 207e4c9..9168460 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,6 +57,7 @@ repos: - id: prettier name: prettier (with plugin-xml) entry: prettier + exclude: ^(data/.*|templates/.*)$ args: - --write - --list-different diff --git a/templates/blog_templates.xml b/templates/blog_templates.xml index a9a4427..a7bb1d1 100644 --- a/templates/blog_templates.xml +++ b/templates/blog_templates.xml @@ -5,25 +5,14 @@ <!-- Blog Home --> <template id="blog_home" name="CGScop Extranet Blog list"> <t t-call="scopext_portal.extranet_layout"> - <section - class="flex h-full p-10 even:bg-white w-svw shadow-background first:rounded-tl-[30px] odd:bg-surface" - > + <section class="flex h-full p-10 even:bg-white w-svw shadow-background first:rounded-tl-[30px] odd:bg-surface"> <div class="w-full"> - <div - class="container relative gap-y-8 mx-auto mb-auto default-grid" - > + <div class="container relative gap-y-8 mx-auto mb-auto default-grid"> <div class="col-span-12"> <div t-foreach="category_ids" t-as="category"> - <h3 - t-out="category.name" - class="typo-caption" - t-attf-style="color: {{category.color}};" - /> + <h3 t-out="category.name" class="typo-caption" t-attf-style="color: {{category.color}};" /> <ul> - <li - t-foreach="category.page_ids.filtered(lambda p: p.is_published)" - t-as="page" - > + <li t-foreach="category.page_ids.filtered(lambda p: p.is_published)" t-as="page"> <a t-attf-href="/coop/ur/{{slug(page)}}"> <t t-out="page.name" /> </a> @@ -40,24 +29,16 @@ <!-- Blog Page --> <template id="blog_page" name="CGScop Extranet Blog Page"> <t t-call="scopext_portal.extranet_layout"> - <section - class="flex h-full p-10 even:bg-white w-svw shadow-background first:rounded-tl-[30px] odd:bg-surface" - > + <section class="flex h-full p-10 even:bg-white w-svw shadow-background first:rounded-tl-[30px] odd:bg-surface"> <div class="w-full"> - <div - class="container relative gap-y-8 mx-auto mb-auto default-grid" - > + <div class="container relative gap-y-8 mx-auto mb-auto default-grid"> <!-- Menu --> <div class="col-span-3"> <t t-call="scopext_portal_blog.blog_menu" /> </div> <!-- Contenu --> <div class="col-span-9"> - <h1 - t-out="page_id.name" - class="typo-h1" - t-attf-style="color: {{page_id.category_id.color}};" - /> + <h1 t-out="page_id.name" class="typo-h1" t-attf-style="color: {{page_id.category_id.color}};" /> <div t-field="page_id.content" /> </div> </div> @@ -69,16 +50,9 @@ <!-- Blog Menu --> <template id="blog_menu" name="CGScop Extranet Blog Menu"> <div t-foreach="category_ids" t-as="category"> - <h5 - t-out="category.name" - class="typo-caption" - t-attf-style="color: {{category.color}};" - /> + <h5 t-out="category.name" class="typo-caption" t-attf-style="color: {{category.color}};" /> <ul> - <li - t-foreach="category.page_ids.filtered(lambda p: p.is_published)" - t-as="page" - > + <li t-foreach="category.page_ids.filtered(lambda p: p.is_published)" t-as="page"> <a t-attf-href="/coop/ur/{{slug(page)}}"> <t t-out="page.name" /> </a> diff --git a/templates/portal_layout.xml b/templates/portal_layout.xml index e57b3cd..a2642ab 100644 --- a/templates/portal_layout.xml +++ b/templates/portal_layout.xml @@ -9,9 +9,7 @@ > <xpath expr="//nav" position="inside"> <t t-set="ur_id" t-value="request.env.user.partner_id.ur_id" /> - <t - t-if="ur_id and request.env['scop.portal.blog.category'].get_portal_blog_categories(ur_id)" - > + <t t-if="ur_id and request.env['scop.portal.blog.category'].get_portal_blog_categories(ur_id)"> <t t-call="scopext_portal.nav_lvl1_item"> <t t-set="link" t-value="'/coop/ur'" /> <t t-set="name" t-value="'blog_ur'" /> -- GitLab