diff --git a/app/resources/surveys/SurveysController.jl b/app/resources/surveys/SurveysController.jl index c32e7c0..dd73478 100644 --- a/app/resources/surveys/SurveysController.jl +++ b/app/resources/surveys/SurveysController.jl @@ -41,8 +41,15 @@ function new() end function completed(uid) + uidstr = string(uid, base=UID_ENCBASE) + links = map(["txt", "org", "json"]) do fmt + (fmt, linkto(:result, + survey = string(SURVEY.id, base=10), + responsefile = string(uidstr, '.', fmt), + preserve_query = false)) + end res = html(:surveys, :thanks, layout=:base; - uid=string(uid, base=UID_ENCBASE), survey=SURVEY) + uid=uidstr, survey=SURVEY, resultlinks=links) Genie.Cookies.set!(res, "response-id", "", Dict{String, Any}("maxage" => -1)) Genie.Cookies.set!(res, "response-page", 0, Dict{String, Any}("maxage" => -1)) end diff --git a/app/resources/surveys/views/thanks.jl.html b/app/resources/surveys/views/thanks.jl.html index 2adcaef..7ff9cb0 100644 --- a/app/resources/surveys/views/thanks.jl.html +++ b/app/resources/surveys/views/thanks.jl.html @@ -11,6 +11,11 @@

Thank you for taking part in the survey!

We hope to see you next year 🙂
-

+

You can view your results as + <% map(resultlinks) do (fmt, url) %> + $(fmt) + <% end |> l -> join(l, ", ", ", or ")%> + .

+
Go Home