Skip to content

Commit

Permalink
customise thank you page for each sign up form (#14514)
Browse files Browse the repository at this point in the history
  • Loading branch information
usamabinnadeem-10 authored Nov 28, 2024
1 parent b4579ff commit 5f46cf9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions templates/credentials/sign-up.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h5 class="p-notification__title">Error</h5>
formid="3801",
lpId="7140",
sign_up_open=sign_up_open,
returnURL="/credentials/thank-you" %}
returnURL="/credentials/thank-you?type=sme" %}
{% include "shared/_credentials-signup-sme-form.html" %}
{% endwith %}
{% endif %}
Expand All @@ -31,7 +31,7 @@ <h5 class="p-notification__title">Error</h5>
formid="3801",
lpId="7140",
sign_up_open=sign_up_open,
returnURL="/credentials/thank-you" %}
returnURL="/credentials/thank-you?type=tester" %}
{% include "shared/_credentials-signup-tester-form.html" %}
{% endwith %}
{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions templates/credentials/thank-you.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ <h1 class="u-no-margin--bottom">Ubuntu CUE</h1>
</div>
<div class="p-section--shallow">
<p>
{% if signup_type == 'sme' %}
Once our next exam is ready for community contributions, we’ll review applications and contact candidates with the appropriate profile.
{% else %}
Once our next exam enters the testing phase, we’ll review applications and contact qualified testers with the appropriate profile.
{% endif %}
</p>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
cred_shop_webhook_responses,
cred_shop_keys,
cred_sign_up,
cred_thank_you,
cred_submit_form,
cred_syllabus_data,
cred_your_exams,
Expand Down Expand Up @@ -891,6 +892,9 @@ def takeovers_index():
app.add_url_rule(
"/credentials/sign-up", view_func=cred_sign_up, methods=["GET", "POST"]
)
app.add_url_rule(
"/credentials/thank-you", view_func=cred_thank_you, methods=["GET"]
)
app.add_url_rule(
"/credentials/schedule",
view_func=cred_schedule,
Expand Down
14 changes: 12 additions & 2 deletions webapp/shop/cred/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,19 @@ def extract_json_comment(obj):
return flask.redirect(return_url)

if referrer:
return flask.redirect(f"/thank-you?referrer={referrer}")
return flask.redirect(
f"/thank-you?referrer={referrer}?type={search_type}"
)
else:
return flask.redirect("/thank-you")
return flask.redirect(f"/thank-you?type={search_type}")


@shop_decorator(area="cred", response="html")
def cred_thank_you(**_):
signup_type = flask.request.args.get("type")
return flask.render_template(
"credentials/thank-you.html", signup_type=signup_type
)


@shop_decorator(area="cred", permission="user", response="html")
Expand Down

0 comments on commit 5f46cf9

Please sign in to comment.