-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added sandbox btn block to create account btn and connect to sp buttons
- Loading branch information
Showing
4 changed files
with
70 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,16 @@ <h2 class="mt-0">Choose an account</h2> | |
|
||
<p>Create a new account or Join an existing account. Not sure which account type to create? <a class="default-a" href="mailto:[email protected]">Contact us</a>.</p> | ||
<div class="flex-this gap-1"> | ||
<a id="create-account" class="primary-btn disabled-btn">Create</a> | ||
{% if envi == 'SANDBOX' %} | ||
<div class="btn-with-helptext"> | ||
<a id="create-account" class="primary-btn disabled-btn">Create</a> | ||
<span id="helptext" class="btn-help-text hide" style="left: 0%;"> | ||
Creating this account is unavailable in the Sandbox | ||
</span> | ||
</div> | ||
{% else %} | ||
<a id="create-account" class="primary-btn disabled-btn">Create</a> | ||
{% endif %} | ||
<a id="join-account" class="primary-btn disabled-btn">Join</a> | ||
</div> | ||
|
||
|
@@ -143,11 +152,16 @@ <h2 class="mt-0">Choose an account</h2> | |
var joinBtn = document.getElementById('join-account'); | ||
var accountCards = document.getElementsByClassName('account-card'); | ||
var i; | ||
var envi = "{{ envi }}" | ||
var helptext = document.getElementById('helptext'); | ||
|
||
function showButtons(e) { | ||
for (i = 0; i < accountCards.length; i++) { | ||
accountCards[i].classList.remove('card-selected'); | ||
} | ||
if (helptext) { | ||
helptext.classList.add('hide'); | ||
} | ||
|
||
selectedCard = e.closest('.account-card'); | ||
selectedCard.classList.add('card-selected'); | ||
|
@@ -181,14 +195,19 @@ <h2 class="mt-0">Choose an account</h2> | |
joinBtn.classList.remove('action-btn'); | ||
joinBtn.classList.add('disabled-btn'); | ||
} | ||
else if (e.value == 'service-provider') { | ||
else if (e.value == 'service-provider' && !(envi == 'SANDBOX')) { | ||
createBtn.classList.remove('disabled-btn'); | ||
createBtn.classList.add('action-btn'); | ||
createBtn.setAttribute('href', '{% url "prep-service-provider" %}'); | ||
|
||
joinBtn.classList.remove('action-btn'); | ||
joinBtn.classList.add('disabled-btn'); | ||
} | ||
else if (e.value == 'service-provider' && envi == 'SANDBOX') { | ||
createBtn.classList.remove('action-btn'); | ||
createBtn.classList.add('disabled-btn'); | ||
helptext.classList.remove('hide'); | ||
} | ||
} | ||
</script> | ||
{% endblock %} |