Merge pull request #41 from marcelklehr/fix/survey-description

Update survey.js and set description correctly
This commit is contained in:
Affan Hussain 2019-07-28 09:31:01 -07:00 committed by GitHub
commit aeddd93e65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 15 deletions

File diff suppressed because one or more lines are too long

View file

@ -39,7 +39,8 @@ $(document).ready(function () {
questions = JSON.parse(questionJSON)
var surveyJSON = {
title: form.title + ': ' + form.description,
title: form.title,
description: form.description,
questions: []
};
@ -56,4 +57,4 @@ $(document).ready(function () {
onUpdateQuestionCssClasses: cssUpdate,
onComplete: sendDataToServer,
});
});
});

View file

@ -285,17 +285,21 @@ class PageController extends Controller {
if ($this->hasUserAccess($form)) {
$renderAs = $this->userId !== null ? 'user' : 'public';
return new TemplateResponse('forms', 'vote.tmpl', [
'form' => $form,
'questions' => $this->getQuestions($form->getId()),
'votes' => $votes,
'participant' => $participants,
'notification' => $notification,
'userId' => $this->userId,
'userMgr' => $this->userMgr,
'urlGenerator' => $this->urlGenerator,
'avatarManager' => $this->avatarManager
$res = new TemplateResponse('forms', 'vote.tmpl', [
'form' => $form,
'questions' => $this->getQuestions($form->getId()),
'votes' => $votes,
'participant' => $participants,
'notification' => $notification,
'userId' => $this->userId,
'userMgr' => $this->userMgr,
'urlGenerator' => $this->urlGenerator,
'avatarManager' => $this->avatarManager
], $renderAs);
$csp = new ContentSecurityPolicy();
$csp->allowEvalScript(true);
$res->setContentSecurityPolicy($csp);
return $res;
} else {
User::checkLoggedIn();
return new TemplateResponse('forms', 'no.acc.tmpl', []);