File: forum_forum_templates.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (57 lines) | stat: -rw-r--r-- 3,113 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="utf-8"?>
<odoo><data>

    <template name="Split regular forums/courses" id="website_slides_forum_index" inherit_id="website_forum.forum_all" active="True">
        <xpath expr="//div[@id='o_wforum_forums_index_list']//*[@t-if='forums']" position="replace">
            <t t-if="forums">
                <t t-set="courses_discussions" t-value="forums.filtered(lambda f: f.slide_channel_id)"/>
                <t t-set="regular_forums" t-value="forums - courses_discussions"/>
                <t t-call="website_forum.forum_all_all_entries">
                    <t t-set="_forums" t-value="regular_forums"/>
                </t>
                <t t-call="website_forum.forum_all_all_entries">
                    <t t-set="_forums" t-value="courses_discussions"/>
                </t>
            </t>
        </xpath>
    </template>
    <template name="Replace Breadcrumb Root" id="website_slides_forum_breadcrumb" inherit_id="website_forum.forum_model_nav" active="True">
        <xpath expr="//nav[@id='o_wforum_nav']" position="before">
            <t t-if="forum and forum.slide_channel_id" t-set="breadcrumb_kind" t-value="'slides'"/>
        </xpath>
        <xpath expr="//div[hasclass('o_wforum_breadcrumb_root_single')]" position="inside">
            <ol t-if="breadcrumb_kind == 'slides'" class="breadcrumb order-first col-10 col-lg flex-grow-1 flex-nowrap my-0 p-0 fs-5">
                <li class="breadcrumb-item">
                    <a t-attf-href="/slides/#{slug(forum.slide_channel_id)}#{'/' + slug(category) if category else ''}" t-out="forum.name"/>
                </li>
                <li class="breadcrumb-item text-nowrap">
                    <a t-attf-href="/forum/#{ slug(forum) }">Forum</a>
                </li>
            </ol>
        </xpath>
        <xpath expr="//div[hasclass('o_wforum_breadcrumb_root_list_or_edit')]" position="inside">
            <ol t-if="breadcrumb_kind == 'slides'" class="breadcrumb order-first col-10 col-lg flex-grow-1 flex-nowrap my-0 p-0 fs-5">
                <li class="breadcrumb-item text-nowrap">
                    <a t-attf-href="/slides/#{slug(forum.slide_channel_id)}#{'/' + slug(category) if category else ''}" t-out="forum.name"/>
                </li>
                <li class="breadcrumb-item text-nowrap">
                    <strong>Forum</strong>
                </li>
            </ol>
        </xpath>
    </template>

    <template name="Add course badge" id="forum_all_all_entries" inherit_id="website_forum.forum_all_all_entries">
        <xpath expr="//t[@t-foreach='sorted_forums']" position="before">
            <t t-if="_forums == courses_discussions">
                <t t-set="forum_badge">Course</t>
            </t>
        </xpath>
        <xpath expr="//t[@t-foreach='sorted_forums']" position="after">
            <div t-if="_forums == courses_discussions" class="d-flex justify-content-center">
                <a href="/slides" class="btn btn-link">Check out our courses <i class="fa fa-long-arrow-right"/></a>
            </div>
        </xpath>
    </template>
</data>
</odoo>