Skip to content

Commit

Permalink
mod_survey: added optional survey_feedback block to show instead of t…
Browse files Browse the repository at this point in the history
…he standard 'thank you' text.

Fixes #371
  • Loading branch information
mworrell committed Dec 13, 2012
1 parent 2c8444f commit 6df9f35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion modules/mod_survey/mod_survey.erl
Expand Up @@ -396,7 +396,11 @@ render_next_page(Id, PageNr, Direction, Answers, History, Context) ->
case proplists:get_value(type, Q) of
<<"survey_page_break">> -> lists:reverse(Acc);
<<"survey_stop">> -> lists:reverse([Q|Acc]);
_ -> takepage(L, [Q|Acc])
_ ->
case proplists:get_value(name, Q) of
<<"survey_feedback">> -> takepage(L, Acc);
_ -> takepage(L, [Q|Acc])
end
end.

is_page_end(Block) ->
Expand Down
10 changes: 8 additions & 2 deletions modules/mod_survey/templates/_survey_end.tpl
@@ -1,3 +1,9 @@
<h2>{_ Thank you _}</h2>
{% with id.blocks['survey_feedback'] as blk %}
{% if blk %}
{% include ["blocks/_block_view_",blk.type,".tpl"]|join blk=blk id=id %}
{% else %}
<h2>{_ Thank you _}</h2>

<p>{_ Thank you for filling in our survey. Be sure to come back for other surveys! _}</p>
<p>{_ Thank you for filling in our survey. Be sure to come back for other surveys! _}</p>
{% endif %}
{% endwith %}

0 comments on commit 6df9f35

Please sign in to comment.