Commit 94471697 authored by Lisa Seeto's avatar Lisa Seeto Committed by Robert Lyon

Bug 1844073: Make GDPR statements and agreeing on them clearer

- put consent button in own div so it always displays
- add description as info text underneath the button
- change wording/ styling on modal buttons
- Added in newline for accountsuspended string as it wouldn't ignore the <br /> tag
- change name of confirm-no-button to suspend-account-btn for clarity

Change-Id: I1ca009a76b1b3243512f6b9658439c111f2b80f0
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent bf9d2a85
......@@ -1071,11 +1071,12 @@ function privacy_form($ignoreagreevalue = false, $ignoreformswitch = false) {
'value' => $privacy->id,
);
if (!$ignoreformswitch) {
$description = get_string('register' . $privacy->type, 'admin');
$elements[$privacy->institution . $privacy->type] = array(
'type' => 'switchbox',
'title' => get_string('privacyagreement', 'admin', get_string($privacy->type . 'lowcase', 'admin')),
'description' => $privacy->agreed ? get_string('privacyagreedto', 'admin',
get_string($privacy->type . 'lowcase', 'admin'), format_date(strtotime($privacy->agreedtime))) : '',
get_string($privacy->type . 'lowcase', 'admin'), format_date(strtotime($privacy->agreedtime))) : $description,
'defaultvalue' => $privacy->agreed ? true : false,
'disabled' => ($privacy->agreed && $ignoreagreevalue) ? true : false,
'required' => true,
......
......@@ -1481,6 +1481,7 @@ $string['hasrefused'] = 'has refused the privacy statement';
$string['privacylowcase'] = 'privacy statement';
$string['termsandconditionslowcase'] = 'terms and conditions';
$string['hasrefused'] = 'has refused the %s';
$string['suspendaccount'] = 'Suspend account';
$string['privacyandtotheterms'] = 'privacy statement and to the terms and conditions';
$string['privacyandtheterms'] = 'privacy statement and the terms and conditions';
$string['consentdate'] = 'Date of consent / rejection';
......
......@@ -479,7 +479,8 @@ $string['accountinactivewarninghtml1'] = '<p>Dear %s,</p>
<p>Regards,<br>
%s site administrator</p>';
$string['accountsuspended'] = 'Your account has been suspended as of %s.<br />The reason for your suspension is: %s';
$string['accountsuspended'] = 'Your account has been suspended as of %s.
The reason for your suspension is: %s';
$string['youraccounthasbeensuspended'] = 'Your account has been suspended.';
$string['youraccounthasbeenunsuspended'] = 'Your account has been unsuspended.';
$string['changepasswordinfo'] = 'You are required to change your password before you can proceed.';
......
......@@ -872,3 +872,8 @@ a.online-users {
.controls .btn-group {
z-index: 1;
}
.consentbutton div,
.consentbutton span.description {
padding: 0px !important;
}
......@@ -3,7 +3,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="btn close" data-dismiss="modal" aria-label="{str tag=Close}"><span aria-hidden="true">&times;</span></button>
<button id="close-button" type="button" class="btn close" data-dismiss="modal" aria-label="{str tag=Close}"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
{str tag=refuseprivacy section=admin}
</h4>
......@@ -14,9 +14,11 @@
<textarea id="reason" rows="4" cols="65" placeholder="{str tag=enterreason section=admin}"></textarea>
</p>
<p>{str tag=confirmprivacyrefusal section=admin}</p>
<div class="btn-group">
<button id="confirm-no-button" type="button" class="btn btn-secondary">{str tag="yes"}</button>
<button id="back-button" type="button" class="btn btn-secondary">{str tag="no"}</button>
<div class="default submitcancel form-group">
<button id="suspend-account-btn" class="btn-primary button btn">
{str tag=suspendaccount section=admin}
</button>
<button id="back-button" type="submit" class="btn-secondary submitcancel cancel">{str tag="cancel"}</button>
</div>
</div>
</div>
......@@ -37,7 +39,7 @@
}
});
$j("#confirm-no-button").on('click', function() {
$j("#suspend-account-btn").on('click', function() {
acceptprivacy = true;
$j("#privacy-confirm-form").modal('hide');
formAbortProcessing($j("#agreetoprivacy_submit"));
......@@ -50,13 +52,13 @@
}, 0);
});
$j("#back-button").on('click', function() {
$j("#back-button, #close-button").on('click', function() {
formAbortProcessing($j("#agreetoprivacy_submit"));
$j("#privacy-confirm-form").modal('hide');
});
$('.modal').on('shown.bs.modal', function() {
$('#confirm-no-button').trigger("focus");
$('#suspend-account-btn').trigger("focus");
});
$('.modal').on('d-none.bs.modal', function() {
if (!acceptprivacy) {
......
......@@ -9,7 +9,6 @@
<fieldset class="pieform-fieldset last collapsible">
<legend>
<h4>
<a
{if $institutionprivacy}
href="#dropdowninstprivacy"
......@@ -44,3 +43,5 @@
{$privacy->content|safe}
</div>
{/if}
</div>
<div class="fieldset-body consentbutton collapse {if (!($privacy->agreed && $ignoreagreevalue) || $ignoreformswitch)}show{/if}">
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment