Skip to content

Commit

Permalink
Merge pull request #9571 from jpmartinspt/cube-register-modal
Browse files Browse the repository at this point in the history
CUBE: Show register modal if user as no eDX account
  • Loading branch information
jpmartinspt authored Apr 20, 2021
2 parents f0bc9f1 + 8bec0ff commit cfb5288
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
14 changes: 14 additions & 0 deletions templates/cube/microcerts.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,20 @@ <h2>Apply for beta access</h2>

{% endif %}

{% if not edx_user %}
<div class="p-modal" id="modal">
<section class="p-modal__dialog" role="dialog">
<header class="p-modal__header">
<h2 class="p-modal__title" id="modal-title">edX Account</h2>
</header>
<p>In order to use CUBE you will need to create an account with edX. By clicking the button below you are accepting the <a href="/legal/terms-and-policies/cube-terms" target="_blank" rel="noopener noreferrer">terms of service</a> and an account will be created for you.</p>
<footer class="p-modal__footer">
<a class="p-button p-button--positive u-no-margin--bottom" href="{{edx_register_url}}">Accept and register</a>
</footer>
</section>
</div>
{% endif %}

<!-- Set default Marketo information for contact form below-->
<div class="u-hide" id="contact-form-container" data-form-location="/shared/forms/interactive/cube-beta" data-form-id="3801" data-lp-id="7140" data-return-url="https://www.ubuntu.com/cube/thank-you" data-lp-url="https://pages.ubuntu.com/Contact_Us_Ubuntu_CUBEbetatest_Cube-contact-us-landing-page.html">
</div>
Expand Down
8 changes: 7 additions & 1 deletion webapp/cube/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ def cube_microcerts():
return flask.render_template(
"cube/microcerts.html",
**{
"user": sso_user,
"edx_user": edx_user,
"edx_register_url": (
f"{edx_api.base_url}/"
"auth/login/tpa-saml/"
"?auth_entry=register&next=%2F&idp=ubuntuone"
),
"sso_user": sso_user,
"certified_badge": certified_badge,
"modules": courses,
"passed_courses": passed_courses,
Expand Down

0 comments on commit cfb5288

Please sign in to comment.