[IMP] survey: improve some survey pages
Survey has several side pages related to corner cases: closed surveys, void surveys, ... those templates need a bit of polishing. Other main templates are left untouched and will probably be improved in other tasks. This commit is linked to task ID 1911586 and PR #28986.
This commit is contained in:
@@ -117,13 +117,13 @@ class Survey(http.Controller):
|
||||
answer_sudo = access_data['answer_sudo']
|
||||
|
||||
if error_key == 'survey_void' and access_data['can_answer']:
|
||||
return request.render("survey.nopages", {'survey': survey_sudo})
|
||||
return request.render("survey.survey_void", {'survey': survey_sudo})
|
||||
elif error_key == 'survey_closed' and access_data['can_answer']:
|
||||
return request.render("survey.notopen")
|
||||
return request.render("survey.survey_expired", {'survey': survey_sudo})
|
||||
elif error_key == 'survey_auth' and answer_sudo.token:
|
||||
return request.render("survey.auth_required", {'survey': survey_sudo, 'token': answer_sudo.token})
|
||||
elif error_key == 'answer_deadline' and answer_sudo.token:
|
||||
return request.render("survey.notopen")
|
||||
return request.render("survey.survey_expired", {'survey': survey_sudo})
|
||||
|
||||
return werkzeug.utils.redirect("/")
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
</template>
|
||||
|
||||
<!-- Message when the survey is not open -->
|
||||
<template id="notopen" name="Survey not open">
|
||||
<template id="survey_expired" name="Survey Expired">
|
||||
<t t-call="survey.layout">
|
||||
<div class="wrap">
|
||||
<div class="container">
|
||||
<div class="jumbotron mt32">
|
||||
<h1>Not open</h1>
|
||||
<p>This survey is not open. Thank you for your interest!</p>
|
||||
<h1><span t-field="survey.title"/> survey expired</h1>
|
||||
<p>This survey is now closed. Thank you for your interest !</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,14 +64,18 @@
|
||||
</template>
|
||||
|
||||
<!-- Message when the survey has no pages -->
|
||||
<template id="nopages" name="Survey has no pages">
|
||||
<template id="survey_void" name="Survey has no pages">
|
||||
<t t-call="survey.layout">
|
||||
<div class="wrap">
|
||||
<div class="container">
|
||||
<t t-call="survey.back" />
|
||||
<div class="jumbotron mt32">
|
||||
<h1>Not ready</h1>
|
||||
<p>This survey has no pages by now!</p>
|
||||
<h1><span t-field="survey.title"/> survey is void</h1>
|
||||
<p>This survey has no question defined currently.<br />
|
||||
<a t-att-href="'/web#view_type=form&model=survey.survey&id=%s&action=survey.action_survey_form' % survey.id"
|
||||
class="btn btn-secondary"
|
||||
groups="survey.group_survey_manager">Edit in backend</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user