Skip to content

Commit bb5b7cf

Browse files
committed
[FIX] website_(slides_)forum: make navigation more consistent
This commit fixes typography in the forum by refining the style of breadcrumbs and headings, making navigation more consistent. task-5079831 closes odoo#230837 X-original-commit: b3555a2 Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
1 parent ce45622 commit bb5b7cf

File tree

3 files changed

+36
-29
lines changed

3 files changed

+36
-29
lines changed

addons/website_forum/static/src/scss/website_forum.scss

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,21 @@ $-forum-sidebar-width: map-get($container-max-widths, sm) / 2;
2626
--o-post-header-height: var(--o-avatar-height);
2727

2828
.o_wforum_content_wrapper {
29-
.o_searchbar_form {
30-
min-width: 200px;
29+
#o_wforum_nav {
30+
.breadcrumb-item {
31+
padding-top: calc(#{$btn-padding-y} + #{$btn-border-width});
32+
padding-bottom: calc(#{$btn-padding-y} + #{$btn-border-width});
33+
font-size: $btn-font-size;
34+
line-height: $btn-line-height;
35+
36+
h1 {
37+
font-family: var(--body-font-family);
38+
}
39+
}
40+
41+
.o_searchbar_form {
42+
min-width: 200px;
43+
}
3144
}
3245
}
3346

addons/website_forum/views/forum_forum_templates_layout.xml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,16 @@
2626
<t t-set="_forum_name" t-value="forum.name if forum else _all_forums"/>
2727
<!-- allows to be overridden such as in website_slides_forum -->
2828
<t t-set="breadcrumb_kind" t-valuef="base"/>
29-
<nav id="o_wforum_nav" t-attf-class="navbar d-flex gap-2 #{ 'mw-xl-75 mw-xxl-100' if _page_name == 'single_question' else '' } px-0" aria-label="breadcrumb">
29+
<nav id="o_wforum_nav" t-attf-class="navbar d-flex gap-2 #{ 'mw-xl-75 mw-xxl-100' if _page_name == 'single_question' else '' } p-0" aria-label="breadcrumb">
3030
<t t-if="_page_name == 'single_question'">
3131
<div class="flex-grow-1">
32-
<div class="o_wforum_breadcrumb_root_single row g-0">
33-
<div t-if="breadcrumb_kind == 'base'" class="col-10">
34-
<a class="btn btn-link px-0 pb-2 fs-5" t-attf-href="/forum/#{ _forum_slug }">
35-
<i class="d-inline-block fa fa-angle-left me-1 small"/><t t-out="_forum_name"/>
36-
</a>
37-
</div>
38-
<div class="d-lg-none col-2 text-end">
39-
<button class="btn position-relative ms-auto fs-5" data-bs-toggle="offcanvas" data-bs-target="#o_wforum_offcanvas">
40-
<i class="fa fa-navicon"/>
41-
</button>
42-
</div>
32+
<div class="o_wforum_breadcrumb_root_single d-flex align-items-center mb-2">
33+
<a t-attf-href="/forum/#{ _forum_slug }">
34+
<i class="d-inline-block fa fa-angle-left me-2 small"/><t t-out="_forum_name"/>
35+
</a>
36+
<button class="btn d-lg-none position-relative ms-auto p-2" data-bs-toggle="offcanvas" data-bs-target="#o_wforum_offcanvas">
37+
<span class="navbar-toggler-icon"/>
38+
</button>
4339
</div>
4440
<div class="d-flex gap-2 align-items-baseline">
4541
<h1 t-attf-class="col-lg-10 my-0 h3" t-out="question.name"/>
@@ -71,31 +67,31 @@
7167
</t>
7268
<t t-elif="_page_name == 'list_questions' or is_edit">
7369
<t t-set="target" t-value="post.parent_id if is_answer else post"/>
74-
<div class="o_wforum_breadcrumb_root_list_or_edit d-flex">
75-
<h1 t-if="breadcrumb_kind=='base'" class="col-10 col-lg flex-grow-1 fs-5">
76-
<span t-if="not is_edit" class="fw-bold mb-0" t-out="_forum_name"/>
70+
<div class="o_wforum_breadcrumb_root_list_or_edit d-flex align-items-center">
71+
<h1 t-if="breadcrumb_kind=='base'" class="col-10 col-lg flex-grow-1 mb-0 h4">
72+
<span t-if="not is_edit" class="mb-0" t-out="_forum_name"/>
7773
<span t-elif="not is_answer" class="fw-bold mb-0">Edit Question</span>
7874
<span t-else="is_answer" class="fw-bold mb-0">Edit Answer</span>
7975
</h1>
8076
</div>
8177
</t>
82-
<ol t-else="" class="breadcrumb col-10 col-lg flex-grow-1 flex-nowrap my-0 p-0 fs-5">
83-
<li class="o_wforum_breadcrumb_root breadcrumb-item text-nowrap text-truncatet">
84-
<h1 class="m-0 fw-normal d-inline h4-fs">
78+
<ol t-else="" class="breadcrumb col-10 col-lg flex-grow-1 flex-nowrap my-0 p-0">
79+
<li class="o_wforum_breadcrumb_root breadcrumb-item text-nowrap text-truncate">
80+
<h1 class="m-0 fw-normal d-inline h6">
8581
<a t-attf-href="/forum/#{ _forum_slug }" t-out="_forum_name"/>
8682
</h1>
8783
</li>
8884
<li t-if="queue_type" class="breadcrumb-item text-nowrap d-none d-lg-flex">
8985
<span>Moderation</span>
9086
</li>
91-
<li class="breadcrumb-item text-nowrap text-truncate">
92-
<span class="fw-bold text-truncate" t-out="_page_name_label"/>
87+
<li class="breadcrumb-item text-nowrap text-truncate active">
88+
<span class="text-truncate" t-out="_page_name_label"/>
9389
</li>
9490
</ol>
9591
<t t-if="_page_name != 'single_question'">
96-
<div class="d-lg-none text-end">
97-
<button class="btn position-relative ms-auto fs-5" data-bs-toggle="offcanvas" data-bs-target="#o_wforum_offcanvas">
98-
<i class="fa fa-navicon"/>
92+
<div class="d-lg-none">
93+
<button class="btn position-relative ms-auto p-2" data-bs-toggle="offcanvas" data-bs-target="#o_wforum_offcanvas">
94+
<span class="navbar-toggler-icon"/>
9995
</button>
10096
</div>
10197
<div t-if="tag or tags or search or question_count or page_name or website_forum_action" t-attf-class="d-flex justify-content-lg-end gap-2 flex-grow-1 flex-wrap flex-md-nowrap w-100 w-lg-auto #{'mw-xl-75' if search else 'mw-xl-50'}">
@@ -219,7 +215,7 @@
219215
<t t-call="website_forum.user_sidebar"/>
220216
<t t-call="website_forum.user_sidebar_mobile"/>
221217
<div class="o_wforum_content_wrapper col-lg-9">
222-
<div class="o_wprofile_email_validation_container d-flex flex-column justify-content-center mb-3 mb-lg-5 pt-2 pt-lg-3">
218+
<div class="o_wprofile_email_validation_container d-flex flex-column justify-content-center mb-3 mb-lg-5 mt-4">
223219
<t t-call="website_profile.email_validation_banner">
224220
<t t-set="redirect_url" t-value="'/forum/%s' % forum.id if forum else '/forum/all/'"/>
225221
<t t-set="additional_validation_email_message"> and join this Forum</t>

addons/website_slides_forum/views/forum_forum_templates.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
<li class="breadcrumb-item text-nowrap">
3535
<a t-attf-href="/slides/#{slug(forum.slide_channel_id)}#{'/' + slug(category) if category else ''}" t-out="forum.name"/>
3636
</li>
37-
<li class="breadcrumb-item text-nowrap">
38-
<strong>Forum</strong>
39-
</li>
37+
<li class="breadcrumb-item text-nowrap active">Forum</li>
4038
</ol>
4139
</xpath>
4240
</template>

0 commit comments

Comments
 (0)