summaryrefslogtreecommitdiff
path: root/addons/survey/views/survey_templates_management.xml
blob: 4612b6c062cf935f52b0cccb425835531b8532ba (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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8"?>
<odoo><data>

    <!-- ============================================================ -->
    <!--                Errors / Corner case management               -->
    <!-- ============================================================ -->

    <!-- Forbidden error messages-->
    <template id="survey_403_page" name="Survey: custom 403 page">
        <t t-call="survey.layout">
            <div id="wrap">
                <div class="container">
                    <h1 class="mt32">403: Forbidden</h1>
                    <p>The page you were looking for could not be authorized.</p>
                    <p>Maybe you were looking for
                        <a t-attf-href="/web#view_type=form&amp;model=survey.survey&amp;id=#{survey.id}&amp;action=survey.action_survey_form">this page</a> ?
                    </p>
                </div>
            </div>
        </t>
    </template>

    <!-- Error: void survey -->
    <template id="survey_void_content" name="Survey: void content">
        <t t-call="survey.layout">
            <t t-if="answer.test_entry" t-call="survey.survey_button_form_view" />
            <div class="wrap">
                <div class="container">
                    <div class="jumbotron mt32">
                        <h1><span t-field="survey.title"/> survey is void</h1>
                        <p>Please make sure you have at least one question in your survey. You also need at least one section if you chose the "Page per section" layout.<br />
                            <a t-att-href="'/web#view_type=form&amp;model=survey.survey&amp;id=%s&amp;action=survey.action_survey_form' % survey.id"
                                class="btn btn-secondary"
                                groups="survey.group_survey_manager">Edit in backend</a>
                        </p>
                    </div>
                </div>
            </div>
        </t>
    </template>

    <!-- Error: auth required  -->
    <template id="survey_auth_required" name="Survey: login required">
        <t t-call="survey.layout">
            <div class="wrap">
                <div class="container">
                    <div class="jumbotron mt32">
                        <h1>Login required</h1>
                        <p>This survey is open only to registered people. Please
                            <a t-att-href="redirect_url">log in</a>.
                        </p>
                    </div>
                </div>
            </div>
        </t>
    </template>

    <!-- Expired (closed) survey page -->
    <template id="survey_closed_expired" name="Survey: expired">
        <t t-call="survey.layout">
            <div class="wrap">
                <div class="container">
                    <div class="jumbotron mt32">
                        <h1><span t-field="survey.title"/> survey expired</h1>
                        <p>This survey is now closed. Thank you for your interest !</p>
                    </div>
                </div>
            </div>
        </t>
    </template>

    <!-- ============================================================ -->
    <!--                       Tools / Utilities                      -->
    <!-- ============================================================ -->

    <template id="survey_button_form_view" name="Survey: back to form view">
        <div groups="survey.group_survey_manager" t-ignore="true" class="alert alert-info alert-dismissible rounded-0 fade show d-print-none css_editable_mode_hidden mb-0">
            <div t-ignore="true" class="text-center">
                <a t-attf-href="/web#view_type=form&amp;model=survey.survey&amp;id=#{survey.id}&amp;action=survey.action_survey_form"><i class="fa fa-fw fa-arrow-right"/><span t-if="answer and answer.test_entry">This is a test survey. </span>Edit Survey</a>
            </div>
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"> &#215; </button>
        </div>
    </template>

    <template id="survey_button_retake" name="Survey: retake button">
        <div>
            <t t-if="not answer.scoring_success and not answer.is_session_answer">
                <t t-if="survey.is_attempts_limited">
                    <t t-set="attempts_left" t-value="survey._get_number_of_attempts_lefts(answer.partner_id, answer.email, answer.invite_token)" />
                    <t t-if="attempts_left > 0">
                        <p><span>Number of attemps left</span>: <span t-esc="attempts_left"></span></p>
                        <p><a role="button" class="btn btn-primary btn-lg" t-att-href="'/survey/retry/%s/%s' % (survey.access_token, answer.access_token)">
                        Retry</a></p>
                    </t>
                </t>
                <t t-else="">
                    <p><a role="button" class="btn btn-primary btn-lg" t-att-href="'/survey/retry/%s/%s' % (survey.access_token, answer.access_token)">
                        Retry</a></p>
                </t>
            </t>
        </div>
    </template>

    <!-- Survey Home page - Session Code
    Used in 'session mode' to give an easy access to the survey through the '/s' route. -->
    <template id="survey_session_code" name="Survey: Access Code page">
        <t t-call="survey.layout">
            <div class="wrap o_survey_wrap pb16 d-flex">
                <div class="container o_survey_quick_access d-flex flex-column">
                    <div class="d-flex flex-grow-1 align-items-center">
                        <div class="col-lg-12">
                            <div class="text-center mb32">
                                <h3>Please enter the code</h3>
                            </div>
                            <div class="row">
                            <div class="offset-md-4 col-md-4 text-center">
                                <input id="session_code" type="text" placeholder="4812"
                                       class="form-control o_survey_question_text_box font-weight-bold bg-transparent text-primary text-center rounded-0 p-2 w-100"/>
                            </div>
                            <div class="col-3 text-center o_survey_error text-danger d-none pt-2" role="alert">
                                <span>Code is incorrect. Please try again.</span>
                            </div>
                            </div>
                            <div class="text-center mt32 p-2">
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </div>
                            <div class="text-center p-2">
                                <span class="text-muted">The code is found on the screen in front of you</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </t>
    </template>

    <template id="survey_navigation" name="Survey: Navigation">
        <button t-if="can_go_back"
            type="submit" class="btn p-0 shadow-none o_survey_navigation_submit" name="button_submit" value="previous" t-att-data-previous-page-id="previous_page_id">
            <i class="border-left fa fa-chevron-left p-2" />
        </button>
        <button t-if="survey and survey.questions_layout in ['page_per_question', 'page_per_section'] and answer and answer.state != 'done' and not answer.is_session_answer"
            type="submit" class="btn p-0 shadow-none o_survey_navigation_submit" t-att-value="'next' if not survey_last else 'finish'">
            <i class="border-left fa fa-chevron-right p-2" />
        </button>
    </template>

</data>
</odoo>