summaryrefslogtreecommitdiff
path: root/addons/survey/static/src/xml/survey_breadcrumb_templates.xml
blob: 1df7f54a88a881fbaba3558cba87b22d235b81c0 (plain)
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
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">

<t t-name="survey.survey_breadcrumb_template">
    <ol class="breadcrumb justify-content-end bg-transparent">
        <t t-set="canGoBack" t-value="widget.canGoBack"/>
        <t t-foreach="widget.pages" t-as="page">
            <t t-set="isActivePage" t-value="page.id === widget.currentPageId"/>
            <li t-att-class="'breadcrumb-item' + (isActivePage ? ' active font-weight-bold' : '')"
                t-att-data-page-id="page.id"
                t-att-data-page-title="page.title">
                <t t-if="widget.currentPageId === page.id">
                    <!-- Users can only go back and not forward -->
                    <!-- As soon as we reach the current page, set "can_go_back" to False -->
                    <t t-set="canGoBack" t-value="false" />
                </t>
                <t t-if="canGoBack">
                    <a class="text-primary" href="#">
                        <span t-esc="page.title" />
                    </a>
                </t>
                <t t-else="">
                    <span t-att-class="(isActivePage ? 'text-black' : 'text-muted')"
                          t-esc="page.title" />
                </t>
            </li>
        </t>
    </ol>
</t>

</templates>