Skip to content

Commit

Permalink
Dev: comment + quick fix to layout_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Apr 19, 2017
1 parent 61c8a9d commit 044d570
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions application/helpers/frontend_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1555,11 +1555,11 @@ function breakOutAndCrash($sTemplateViewPath, $totalquestions, $iTotalGroupsWith
$sMessage = '';

if ($totalquestions == 0){
$aError['message'] = gT("There are no questions in this survey.");
$sMessage = gT("There are no questions in this survey.");
}

if ($iTotalGroupsWithoutQuestions > 0){
$aError['message'] = gT("There are empty question groups in this survey - please create at least one question within a question group.");
$sMessage = gT("There are empty question groups in this survey - please create at least one question within a question group.");
}

renderError($sTitle, $sMessage, $thissurvey, $sTemplateViewPath);
Expand Down
8 changes: 7 additions & 1 deletion templates/default/views/layout_errors.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
It has no obligation to be the same layout than layout.twig, it can be completly different
NOTE: the main purpose of this file is to show how different can be the layouts. This one has a complete different design.
To see it: just try to preview a survey with an empty group.
#}

{% set aError = aSurveyInfo.aError %}
Expand All @@ -34,7 +37,10 @@
ERROR! {{ aSurveyInfo.surveyls_title }}
</title>

{# NOTE: YES, it's very bad to do it here. It a first cycle. I'll see what to do once I'll done all those kind of error page#}
{#
NOTE: YES, it's very bad to do it here. It a first cycle. I'll see what to do once I'll done all those kind of error page
TODO: move it to a separated css file
#}
<style type="text/css">
html{
}
Expand Down

0 comments on commit 044d570

Please sign in to comment.