-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert licenses to HTML and force user to read
- Loading branch information
Showing
8 changed files
with
2,117 additions
and
90 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
758 changes: 758 additions & 0 deletions
758
webapp/home/static/home/documents/cellranger-end-user-license.html
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
1,229 changes: 1,229 additions & 0 deletions
1,229
webapp/home/static/home/documents/fgenesh-biocommons-terms.html
Large diffs are not rendered by default.
Oops, something went wrong.
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
108 changes: 108 additions & 0 deletions
108
webapp/home/templates/home/requests/access/snippets/agree-terms-modal.html
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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
{% load static %} | ||
|
||
{{ form.agree_terms.errors }} | ||
|
||
<button | ||
class="ga-btn" | ||
type="button" | ||
data-bs-toggle="modal" | ||
data-bs-target="#termsModal" | ||
> | ||
{{ form.terms.button_text }} | ||
</button> | ||
|
||
<div class="form-check mt-2"> | ||
<input | ||
class="form-check-input" | ||
id="agreeTermsInput" | ||
name="agree_terms" | ||
type="checkbox" | ||
disabled | ||
{% if form.agree_terms.value %}checked{% endif %} | ||
/> | ||
<label id="agreeTermsLabel" for="agreeTermsInput" class="check-label" style="opacity: 0.2;"> | ||
I, the Principal Investigator or End User have read and acknowledged | ||
the {{ form.terms.agreement_name }}. | ||
</label> | ||
</div> | ||
|
||
<div class="modal" tabindex="-1" id="termsModal"> | ||
<div class="modal-dialog modal-xl"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title"></h5> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<iframe | ||
src="{{ form.terms.src }}" | ||
style="width: 100%; height: calc(95vh - 240px);" | ||
frameborder="0" | ||
></iframe> | ||
</div> | ||
<div class="modal-footer justify-content-center"> | ||
<div class="w-100"> | ||
<p class="text-center"> | ||
I, the Principal Investigator or End User have read and acknowledged | ||
the {{ form.terms.agreement_name }}. | ||
</p> | ||
</div> | ||
<div | ||
title="Please scroll to the end to accept" | ||
data-bs-toggle="tooltip" | ||
data-bs-placement="right" | ||
> | ||
<button | ||
type="button" | ||
class="btn btn-primary" | ||
id="agreeTermsButton" | ||
data-bs-dismiss="modal" | ||
onclick="" | ||
disabled | ||
> | ||
Agree | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
function agreeTermsAction(el) { | ||
enableTermsInput(); | ||
$('#agreeTermsInput').attr('checked', true); | ||
} | ||
function enableTermsInput() { | ||
$('#agreeTermsInput').attr('disabled', false); | ||
$('#agreeTermsLabel').css('opacity', '1'); | ||
} | ||
|
||
function enableAgreeTermsButton() { | ||
$('#agreeTermsButton').attr('disabled', false); | ||
$('#agreeTermsButton').attr('onclick', 'agreeTermsAction(this);'); | ||
const tooltip = new bootstrap.Tooltip($('#agreeTermsButton').closest('div')[0]); | ||
tooltip.disable(); | ||
} | ||
|
||
function setEventHandler() { | ||
const termsContainer = $('#termsModal iframe').contents().find('#page-container'); | ||
if (!termsContainer.length) { | ||
return setTimeout(setEventHandler, 100); | ||
} | ||
termsContainer.on('scroll', (event) => { | ||
const scrolledToEnd = $(event.target)[0].scrollHeight | ||
- $(event.target).scrollTop() | ||
- $('#termsModal iframe').height() < 50; | ||
scrolledToEnd && enableAgreeTermsButton(); | ||
}); | ||
} | ||
|
||
$('#termsModal iframe').contents().ready(setEventHandler); | ||
|
||
// Enable terms checkbox so validation messages can be displayed | ||
$('form').submit( () => { | ||
enableTermsInput(); | ||
return true; | ||
}); | ||
</script> | ||
</div> |