summaryrefslogtreecommitdiff
path: root/addons/survey/static/src/xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/survey/static/src/xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/survey/static/src/xml')
-rw-r--r--addons/survey/static/src/xml/survey_breadcrumb_templates.xml31
-rw-r--r--addons/survey/static/src/xml/survey_session_text_answer_template.xml11
2 files changed, 42 insertions, 0 deletions
diff --git a/addons/survey/static/src/xml/survey_breadcrumb_templates.xml b/addons/survey/static/src/xml/survey_breadcrumb_templates.xml
new file mode 100644
index 00000000..1df7f54a
--- /dev/null
+++ b/addons/survey/static/src/xml/survey_breadcrumb_templates.xml
@@ -0,0 +1,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>
diff --git a/addons/survey/static/src/xml/survey_session_text_answer_template.xml b/addons/survey/static/src/xml/survey_session_text_answer_template.xml
new file mode 100644
index 00000000..d37e0864
--- /dev/null
+++ b/addons/survey/static/src/xml/survey_session_text_answer_template.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+
+<div t-name="survey.survey_session_text_answer" class="o_survey_session_text_answer d-inline-block m-1">
+ <div class="o_survey_session_text_answer_container d-inline-block p-2 font-weight-bold"
+ t-attf-style="border-color: #{borderColor}">
+ <span class="d-inline-block" t-esc="value" />
+ </div>
+</div>
+
+</templates>