Commit bdbb5cfd authored by Liam's avatar Liam Committed by Rebecca Blundell

Bug #1765276: Various changes including:

-Changing .hidden to d-none
-Changing button styles
-Fixing dashboard styles
-Misc

behatnotneeded

Change-Id: I320882f682ef4b33ff7a9836f4eb4438f4a93b93
parent 129fdc86
...@@ -30,7 +30,7 @@ $cancelrequestform = pieform(array( ...@@ -30,7 +30,7 @@ $cancelrequestform = pieform(array(
), ),
'submit' => array( 'submit' => array(
'type' => 'submitcancel', 'type' => 'submitcancel',
'class' => 'btn-default', 'class' => 'btn-secondary',
'value' => array(get_string('yes'), get_string('no')), 'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . "account/index.php", 'goto' => get_config('wwwroot') . "account/index.php",
), ),
......
...@@ -40,7 +40,7 @@ if ($requiresapproval) { ...@@ -40,7 +40,7 @@ if ($requiresapproval) {
'rules' => array('required' => true), 'rules' => array('required' => true),
), ),
'submit' => array( 'submit' => array(
'class' => 'btn-default', 'class' => 'btn-secondary',
'type' => 'submitcancel', 'type' => 'submitcancel',
'value' => array(get_string('senddeletenotification', 'mahara'), get_string('back')), 'value' => array(get_string('senddeletenotification', 'mahara'), get_string('back')),
'goto' => get_config('wwwroot'). 'account/index.php', 'goto' => get_config('wwwroot'). 'account/index.php',
...@@ -61,7 +61,7 @@ else { ...@@ -61,7 +61,7 @@ else {
); );
} }
$elements['submit'] = array( $elements['submit'] = array(
'class' => 'btn-default', 'class' => 'btn-secondary',
'type' => 'submitcancel', 'type' => 'submitcancel',
'value' => array(get_string('deleteaccount1', 'mahara'), get_string('back')), 'value' => array(get_string('deleteaccount1', 'mahara'), get_string('back')),
'goto' => get_config('wwwroot'). 'account/index.php', 'goto' => get_config('wwwroot'). 'account/index.php',
......
...@@ -36,7 +36,7 @@ if (method_exists($authobj, 'change_password')) { ...@@ -36,7 +36,7 @@ if (method_exists($authobj, 'change_password')) {
'password' => array( 'password' => array(
'type' => 'password', 'type' => 'password',
'title' => '', 'title' => '',
'class' => 'hidden', 'class' => 'd-none',
'value' => 'decoypassword', 'value' => 'decoypassword',
), ),
'oldpassword' => array( 'oldpassword' => array(
......
...@@ -30,7 +30,7 @@ if (!empty($member)) { ...@@ -30,7 +30,7 @@ if (!empty($member)) {
$elements[] = array( $elements[] = array(
'type' => 'submit', 'type' => 'submit',
'name' => '_leave_' . $i->institution, 'name' => '_leave_' . $i->institution,
'class' => 'btn-default', 'class' => 'btn-secondary',
'confirm' => get_string('reallyleaveinstitution'), 'confirm' => get_string('reallyleaveinstitution'),
'title' => get_string('youareamemberof', 'mahara', $institutions[$i->institution]->displayname), 'title' => get_string('youareamemberof', 'mahara', $institutions[$i->institution]->displayname),
'value' => get_string('leaveinstitution') 'value' => get_string('leaveinstitution')
...@@ -83,7 +83,7 @@ if (!empty($requested)) { ...@@ -83,7 +83,7 @@ if (!empty($requested)) {
$elements[] = array( $elements[] = array(
'type' => 'submit', 'type' => 'submit',
'name' => '_cancelrequest_' . $i, 'name' => '_cancelrequest_' . $i,
'class' => 'btn-default', 'class' => 'btn-secondary',
'title' => get_string('youhaverequestedmembershipof', 'mahara', 'title' => get_string('youhaverequestedmembershipof', 'mahara',
$institutions[$i]->displayname), $institutions[$i]->displayname),
'value' => get_string('cancelrequest') 'value' => get_string('cancelrequest')
...@@ -131,7 +131,7 @@ if (!empty($invited)) { ...@@ -131,7 +131,7 @@ if (!empty($invited)) {
'primarychoice' => 'confirm', 'primarychoice' => 'confirm',
'title' => get_string('youhavebeeninvitedtojoin', 'mahara', 'title' => get_string('youhavebeeninvitedtojoin', 'mahara',
$institutions[$i]->displayname), $institutions[$i]->displayname),
'class' => 'btn-default', 'class' => 'btn-secondary',
'value' => array(get_string('joininstitution'), get_string('decline')) 'value' => array(get_string('joininstitution'), get_string('decline'))
); );
unset($institutions[$i]); unset($institutions[$i]);
......
...@@ -32,7 +32,7 @@ $deleteform = pieform(array( ...@@ -32,7 +32,7 @@ $deleteform = pieform(array(
'rules' => array('required' => true), 'rules' => array('required' => true),
), ),
'submit' => array( 'submit' => array(
'class' => 'btn-default', 'class' => 'btn-secondary',
'type' => 'submit', 'type' => 'submit',
'value' => get_string('resenddeletionnotification', 'account'), 'value' => get_string('resenddeletionnotification', 'account'),
), ),
......
...@@ -99,7 +99,7 @@ foreach ($iframesources as $url => $name) { ...@@ -99,7 +99,7 @@ foreach ($iframesources as $url => $name) {
'elements' => array( 'elements' => array(
'submit' => array( 'submit' => array(
'type' => 'button', 'type' => 'button',
'class' => 'btn-default btn-sm', 'class' => 'btn-secondary btn-sm',
'usebuttontag' => true, 'usebuttontag' => true,
'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">'. get_string('delete') . '</span>', 'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">'. get_string('delete') . '</span>',
......
...@@ -27,7 +27,7 @@ $form = pieform(array( ...@@ -27,7 +27,7 @@ $form = pieform(array(
'elements' => array( 'elements' => array(
'submit' => array( 'submit' => array(
'type' => 'submitcancel', 'type' => 'submitcancel',
'class' => 'btn-default', 'class' => 'btn-secondary',
'value' => array(get_string('yes'), get_string('no')), 'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'admin/groups/groups.php', 'goto' => get_config('wwwroot') . 'admin/groups/groups.php',
) )
......
...@@ -96,7 +96,7 @@ jQuery(function($) { ...@@ -96,7 +96,7 @@ jQuery(function($) {
// item has class, id, type, name, link, linkedto // item has class, id, type, name, link, linkedto
var edit = $('<button>', { var edit = $('<button>', {
'class':'btn btn-default btn-sm', 'class':'btn btn-secondary btn-sm',
'id':'item' + item.id, 'id':'item' + item.id,
'type':'button', 'type':'button',
'title':{$getstring['edit']}, 'title':{$getstring['edit']},
...@@ -109,7 +109,7 @@ jQuery(function($) { ...@@ -109,7 +109,7 @@ jQuery(function($) {
var del = $('<button>', { var del = $('<button>', {
'class':'btn btn-default btn-sm', 'class':'btn btn-secondary btn-sm',
'id':'item' + item.id, 'id':'item' + item.id,
'type':'button', 'type':'button',
'title':{$getstring['delete']}, 'title':{$getstring['delete']},
...@@ -142,7 +142,7 @@ jQuery(function($) { ...@@ -142,7 +142,7 @@ jQuery(function($) {
// Either a save, a cancel button, or both. // Either a save, a cancel button, or both.
var savecancel = []; var savecancel = [];
var save = $('<input>', {'type':'button','class':'button btn btn-default btn-add-group'}); var save = $('<input>', {'type':'button','class':'button btn btn-secondary btn-add-group'});
save.on('click', function () { saveitem(item.id); }); save.on('click', function () { saveitem(item.id); });
var rowtype = 'add'; var rowtype = 'add';
...@@ -157,7 +157,7 @@ jQuery(function($) { ...@@ -157,7 +157,7 @@ jQuery(function($) {
// The save button says 'update' and there's a cancel button. // The save button says 'update' and there's a cancel button.
var rowtype = 'edit'; var rowtype = 'edit';
save.prop('value',{$getstring['update']}); save.prop('value',{$getstring['update']});
var cancel = $('<input>', {'type':'button','class':'button btn btn-sm btn-default','value':{$getstring['cancel']}}); var cancel = $('<input>', {'type':'button','class':'button btn btn-sm btn-secondary','value':{$getstring['cancel']}});
cancel.on('click', closeopenedits); cancel.on('click', closeopenedits);
savecancel = [save,cancel]; savecancel = [save,cancel];
item.label = {$getstring['edit']}; item.label = {$getstring['edit']};
...@@ -186,8 +186,8 @@ jQuery(function($) { ...@@ -186,8 +186,8 @@ jQuery(function($) {
if (row.hasClass('edit')) { if (row.hasClass('edit')) {
row.remove(); row.remove();
} }
else if (row.hasClass('hidden')) { else if (row.hasClass('d-none')) {
row.removeClass('hidden'); row.removeClass('d-none');
} }
} }
} }
...@@ -196,7 +196,7 @@ jQuery(function($) { ...@@ -196,7 +196,7 @@ jQuery(function($) {
function edititem(item) { function edititem(item) {
closeopenedits(); closeopenedits();
var menuitem = $('#menuitem_'+item.id); var menuitem = $('#menuitem_'+item.id);
menuitem.addClass('hidden'); menuitem.addClass('d-none');
var newrow = editform(item); var newrow = editform(item);
newrow.insertBefore(menuitem) newrow.insertBefore(menuitem)
$('#name' + item.id).trigger("focus"); $('#name' + item.id).trigger("focus");
......
...@@ -55,7 +55,7 @@ $closeform = pieform(array( ...@@ -55,7 +55,7 @@ $closeform = pieform(array(
'submit' => array( 'submit' => array(
'type' => 'submit', 'type' => 'submit',
'value' => get_string($closed ? 'Open' : 'Close', 'admin'), 'value' => get_string($closed ? 'Open' : 'Close', 'admin'),
'class' => $closed ? 'btn-primary' : 'btn-default' 'class' => $closed ? 'btn-primary' : 'btn-secondary'
), ),
), ),
)); ));
...@@ -68,7 +68,7 @@ $clearcachesform = pieform(array( ...@@ -68,7 +68,7 @@ $clearcachesform = pieform(array(
'submit' => array( 'submit' => array(
'type' => 'submit', 'type' => 'submit',
'value' => get_string('clearcachessubmit', 'admin'), 'value' => get_string('clearcachessubmit', 'admin'),
'class' => 'btn-default', 'class' => 'btn-secondary',
), ),
), ),
)); ));
......
...@@ -96,7 +96,7 @@ $previewform = pieform(array( ...@@ -96,7 +96,7 @@ $previewform = pieform(array(
), ),
'submit' => array( 'submit' => array(
'type' => 'submit', 'type' => 'submit',
'class' => 'btn-default', 'class' => 'btn-secondary',
'value' => get_string('preview', 'skin') 'value' => get_string('preview', 'skin')
) )
) )
......
...@@ -86,10 +86,10 @@ jQuery(function($) { ...@@ -86,10 +86,10 @@ jQuery(function($) {
// item has id, type, name, link, linkedto // item has id, type, name, link, linkedto
var type = eval(item.type); var type = eval(item.type);
var linkedto = $('<a>', {'href':item.linkedto, 'text': item.linktext}); var linkedto = $('<a>', {'href':item.linkedto, 'text': item.linktext});
var edit = $('<button>', {'type':'button','class':'button btn btn-default btn-sm','title':{$getstring['edit']}}) var edit = $('<button>', {'type':'button','class':'button btn btn-secondary btn-sm','title':{$getstring['edit']}})
.append($('<span>', {'class':'icon icon-lg icon-pencil', 'role':'presentation'}), $('<span>', {'class':'sr-only','text': {$getstring['edit']}})); .append($('<span>', {'class':'icon icon-lg icon-pencil', 'role':'presentation'}), $('<span>', {'class':'sr-only','text': {$getstring['edit']}}));
edit.on('click', function () { edititem(item); }); edit.on('click', function () { edititem(item); });
var del = $('<button>', {'type':'button','class':'button btn btn-default btn-sm','title': {$getstring['delete']}}) var del = $('<button>', {'type':'button','class':'button btn btn-secondary btn-sm','title': {$getstring['delete']}})
.append($('<span>', {'class':'icon icon-lg icon-trash text-danger', 'role':'presentation'}), $('<span>', {'class':'sr-only','text': {$getstring['delete']}})); .append($('<span>', {'class':'icon icon-lg icon-trash text-danger', 'role':'presentation'}), $('<span>', {'class':'sr-only','text': {$getstring['delete']}}));
del.on('click', function() { delitem(item.id); }); del.on('click', function() { delitem(item.id); });
var buttonGroup = $('<span>', {'class':'btn-group'}).append(edit, del); var buttonGroup = $('<span>', {'class':'btn-group'}).append(edit, del);
...@@ -117,7 +117,7 @@ jQuery(function($) { ...@@ -117,7 +117,7 @@ jQuery(function($) {
// Either a save, a cancel button, or both. // Either a save, a cancel button, or both.
var savecancel = []; var savecancel = [];
var save = $('<button>', {'type':'button','class':'button btn btn-default btn-sm','title': {$getstring['update']}}) var save = $('<button>', {'type':'button','class':'button btn btn-secondary btn-sm','title': {$getstring['update']}})
.append($('<span>', {'class':'icon icon-plus icon-lg', 'role':'presentation'}), $('<span>', {'class':'sr-only','text': {$getstring['update']}})); .append($('<span>', {'class':'icon icon-plus icon-lg', 'role':'presentation'}), $('<span>', {'class':'sr-only','text': {$getstring['update']}}));
save.on('click', function () { saveitem(item.id); }); save.on('click', function () { saveitem(item.id); });
...@@ -207,8 +207,8 @@ jQuery(function($) { ...@@ -207,8 +207,8 @@ jQuery(function($) {
if (row.hasClass('edit')) { if (row.hasClass('edit')) {
row.remove(); row.remove();
} }
else if (row.hasClass('hidden')) { else if (row.hasClass('d-none')) {
row.removeClass('hidden'); row.removeClass('d-none');
} }
} }
} }
...@@ -229,7 +229,7 @@ jQuery(function($) { ...@@ -229,7 +229,7 @@ jQuery(function($) {
function edititem(item) { function edititem(item) {
closeopenedits(); closeopenedits();
var menuitem = $('#menuitem_'+item.id); var menuitem = $('#menuitem_'+item.id);
menuitem.addClass('hidden'); menuitem.addClass('d-none');
var newrow = editform(item); var newrow = editform(item);
newrow.insertBefore(menuitem); newrow.insertBefore(menuitem);
} }
......
...@@ -99,7 +99,7 @@ $networkingform = pieform( ...@@ -99,7 +99,7 @@ $networkingform = pieform(
'value' => 'submit' 'value' => 'submit'
), ),
'deletesubmit' => array( 'deletesubmit' => array(
'class' => 'btn-default text-inline', 'class' => 'btn-secondary text-inline',
'name' => 'submit', // must be called submit so we can access it's value 'name' => 'submit', // must be called submit so we can access it's value
'type' => 'button', 'type' => 'button',
'usebuttontag' => true, 'usebuttontag' => true,
......
...@@ -132,7 +132,7 @@ jQuery(function($) { ...@@ -132,7 +132,7 @@ jQuery(function($) {
var element = todo.shift(); var element = todo.shift();
if (!element) { if (!element) {
$('#installdone').removeClass('hidden'); $('#installdone').removeClass('d-none');
$('html, body').animate({ scrollTop: $('#installdone').offset().top }, 'slow'); $('html, body').animate({ scrollTop: $('#installdone').offset().top }, 'slow');
return; // done return; // done
} }
......
...@@ -117,10 +117,10 @@ jQuery(function($) { ...@@ -117,10 +117,10 @@ jQuery(function($) {
function authloginmsgVisibility() { function authloginmsgVisibility() {
// If Parent authority is 'None' // If Parent authority is 'None'
if ($('#auth_config_parent').val() != 0) { if ($('#auth_config_parent').val() != 0) {
$('#auth_config_authloginmsg_container').addClass('hidden'); $('#auth_config_authloginmsg_container').addClass('d-none');
} }
else { else {
$('#auth_config_authloginmsg_container').removeClass('hidden'); $('#auth_config_authloginmsg_container').removeClass('d-none');
} }
} }
var ssoAllOptions = { var ssoAllOptions = {
...@@ -134,10 +134,10 @@ jQuery(function($) { ...@@ -134,10 +134,10 @@ jQuery(function($) {
var current = $('#auth_config_ssodirection').val(); var current = $('#auth_config_ssodirection').val();
for (var opt in ssoAllOptions) { for (var opt in ssoAllOptions) {
if (ssoAllOptions[opt] == current) { if (ssoAllOptions[opt] == current) {
$('#auth_config_' + opt + '_container').removeClass('hidden'); $('#auth_config_' + opt + '_container').removeClass('d-none');
} }
else { else {
$('#auth_config_' + opt + '_container').addClass('hidden'); $('#auth_config_' + opt + '_container').addClass('d-none');
} }
} }
} }
......
...@@ -63,7 +63,7 @@ $userids = array_keys($users); ...@@ -63,7 +63,7 @@ $userids = array_keys($users);
// Used in all three forms // Used in all three forms
$userelement = array( $userelement = array(
'type' => 'select', 'type' => 'select',
'class' => 'hidden', 'class' => 'd-none',
'multiple' => 'true', 'multiple' => 'true',
'options' => array_combine($userids, $userids), 'options' => array_combine($userids, $userids),
'value' => $userids, 'value' => $userids,
...@@ -106,7 +106,7 @@ $suspendform = pieform(array( ...@@ -106,7 +106,7 @@ $suspendform = pieform(array(
'suspend' => array( 'suspend' => array(
'type' => 'button', 'type' => 'button',
'usebuttontag' => true, 'usebuttontag' => true,
'class' => 'btn-default input-group-btn no-label', 'class' => 'btn-secondary input-group-btn no-label',
'value' => get_string('Suspend', 'admin'), 'value' => get_string('Suspend', 'admin'),
) )
) )
...@@ -136,7 +136,7 @@ if (count($options) > 1) { ...@@ -136,7 +136,7 @@ if (count($options) > 1) {
'changeauth' => array( 'changeauth' => array(
'type' => 'button', 'type' => 'button',
'usebuttontag' => true, 'usebuttontag' => true,
'class' => 'btn-default input-group-btn', 'class' => 'btn-secondary input-group-btn',
'value' => get_string('changeauthmethod', 'admin') 'value' => get_string('changeauthmethod', 'admin')
) )
) )
...@@ -167,7 +167,7 @@ if (is_using_probation()) { ...@@ -167,7 +167,7 @@ if (is_using_probation()) {
'setprobation' => array( 'setprobation' => array(
'type' => 'button', 'type' => 'button',
'usebuttontag' => true, 'usebuttontag' => true,
'class' => 'btn-default input-group-btn no-label', 'class' => 'btn-secondary input-group-btn no-label',
'confirm' => get_string('probationbulkconfirm', 'admin'), 'confirm' => get_string('probationbulkconfirm', 'admin'),
'value' => get_string('probationbulkset', 'admin'), 'value' => get_string('probationbulkset', 'admin'),
) )
...@@ -187,7 +187,7 @@ $deleteform = pieform(array( ...@@ -187,7 +187,7 @@ $deleteform = pieform(array(
'delete' => array( 'delete' => array(
'type' => 'button', 'type' => 'button',
'usebuttontag' => true, 'usebuttontag' => true,
'class' => 'btn-default', 'class' => 'btn-secondary',
'confirm' => get_string('confirmdeleteusers', 'admin'), 'confirm' => get_string('confirmdeleteusers', 'admin'),
'value' => '<span class="icon icon-lg icon-user-times left text-danger" role="presentation" aria-hidden="true"></span>' . get_string('deleteusers', 'admin'), 'value' => '<span class="icon icon-lg icon-user-times left text-danger" role="presentation" aria-hidden="true"></span>' . get_string('deleteusers', 'admin'),
), ),
......
...@@ -680,7 +680,7 @@ if (empty($suspended)) { ...@@ -680,7 +680,7 @@ if (empty($suspended)) {
), ),
'submit' => array( 'submit' => array(
'type' => 'submit', 'type' => 'submit',
'class' => 'btn-default',