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(
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . "account/index.php",
),
......
......@@ -40,7 +40,7 @@ if ($requiresapproval) {
'rules' => array('required' => true),
),
'submit' => array(
'class' => 'btn-default',
'class' => 'btn-secondary',
'type' => 'submitcancel',
'value' => array(get_string('senddeletenotification', 'mahara'), get_string('back')),
'goto' => get_config('wwwroot'). 'account/index.php',
......@@ -61,7 +61,7 @@ else {
);
}
$elements['submit'] = array(
'class' => 'btn-default',
'class' => 'btn-secondary',
'type' => 'submitcancel',
'value' => array(get_string('deleteaccount1', 'mahara'), get_string('back')),
'goto' => get_config('wwwroot'). 'account/index.php',
......
......@@ -36,7 +36,7 @@ if (method_exists($authobj, 'change_password')) {
'password' => array(
'type' => 'password',
'title' => '',
'class' => 'hidden',
'class' => 'd-none',
'value' => 'decoypassword',
),
'oldpassword' => array(
......
......@@ -30,7 +30,7 @@ if (!empty($member)) {
$elements[] = array(
'type' => 'submit',
'name' => '_leave_' . $i->institution,
'class' => 'btn-default',
'class' => 'btn-secondary',
'confirm' => get_string('reallyleaveinstitution'),
'title' => get_string('youareamemberof', 'mahara', $institutions[$i->institution]->displayname),
'value' => get_string('leaveinstitution')
......@@ -83,7 +83,7 @@ if (!empty($requested)) {
$elements[] = array(
'type' => 'submit',
'name' => '_cancelrequest_' . $i,
'class' => 'btn-default',
'class' => 'btn-secondary',
'title' => get_string('youhaverequestedmembershipof', 'mahara',
$institutions[$i]->displayname),
'value' => get_string('cancelrequest')
......@@ -131,7 +131,7 @@ if (!empty($invited)) {
'primarychoice' => 'confirm',
'title' => get_string('youhavebeeninvitedtojoin', 'mahara',
$institutions[$i]->displayname),
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => array(get_string('joininstitution'), get_string('decline'))
);
unset($institutions[$i]);
......
......@@ -32,7 +32,7 @@ $deleteform = pieform(array(
'rules' => array('required' => true),
),
'submit' => array(
'class' => 'btn-default',
'class' => 'btn-secondary',
'type' => 'submit',
'value' => get_string('resenddeletionnotification', 'account'),
),
......
......@@ -99,7 +99,7 @@ foreach ($iframesources as $url => $name) {
'elements' => array(
'submit' => array(
'type' => 'button',
'class' => 'btn-default btn-sm',
'class' => 'btn-secondary btn-sm',
'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>',
......
......@@ -27,7 +27,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'admin/groups/groups.php',
)
......
......@@ -96,7 +96,7 @@ jQuery(function($) {
// item has class, id, type, name, link, linkedto
var edit = $('<button>', {
'class':'btn btn-default btn-sm',
'class':'btn btn-secondary btn-sm',
'id':'item' + item.id,
'type':'button',
'title':{$getstring['edit']},
......@@ -109,7 +109,7 @@ jQuery(function($) {
var del = $('<button>', {
'class':'btn btn-default btn-sm',
'class':'btn btn-secondary btn-sm',
'id':'item' + item.id,
'type':'button',
'title':{$getstring['delete']},
......@@ -142,7 +142,7 @@ jQuery(function($) {
// Either a save, a cancel button, or both.
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); });
var rowtype = 'add';
......@@ -157,7 +157,7 @@ jQuery(function($) {
// The save button says 'update' and there's a cancel button.
var rowtype = 'edit';
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);
savecancel = [save,cancel];
item.label = {$getstring['edit']};
......@@ -186,8 +186,8 @@ jQuery(function($) {
if (row.hasClass('edit')) {
row.remove();
}
else if (row.hasClass('hidden')) {
row.removeClass('hidden');
else if (row.hasClass('d-none')) {
row.removeClass('d-none');
}
}
}
......@@ -196,7 +196,7 @@ jQuery(function($) {
function edititem(item) {
closeopenedits();
var menuitem = $('#menuitem_'+item.id);
menuitem.addClass('hidden');
menuitem.addClass('d-none');
var newrow = editform(item);
newrow.insertBefore(menuitem)
$('#name' + item.id).trigger("focus");
......
......@@ -55,7 +55,7 @@ $closeform = pieform(array(
'submit' => array(
'type' => 'submit',
'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(
'submit' => array(
'type' => 'submit',
'value' => get_string('clearcachessubmit', 'admin'),
'class' => 'btn-default',
'class' => 'btn-secondary',
),
),
));
......
......@@ -96,7 +96,7 @@ $previewform = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => get_string('preview', 'skin')
)
)
......
......@@ -86,10 +86,10 @@ jQuery(function($) {
// item has id, type, name, link, linkedto
var type = eval(item.type);
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']}}));
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']}}));
del.on('click', function() { delitem(item.id); });
var buttonGroup = $('<span>', {'class':'btn-group'}).append(edit, del);
......@@ -117,7 +117,7 @@ jQuery(function($) {
// Either a save, a cancel button, or both.
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']}}));
save.on('click', function () { saveitem(item.id); });
......@@ -207,8 +207,8 @@ jQuery(function($) {
if (row.hasClass('edit')) {
row.remove();
}
else if (row.hasClass('hidden')) {
row.removeClass('hidden');
else if (row.hasClass('d-none')) {
row.removeClass('d-none');
}
}
}
......@@ -229,7 +229,7 @@ jQuery(function($) {
function edititem(item) {
closeopenedits();
var menuitem = $('#menuitem_'+item.id);
menuitem.addClass('hidden');
menuitem.addClass('d-none');
var newrow = editform(item);
newrow.insertBefore(menuitem);
}
......
......@@ -99,7 +99,7 @@ $networkingform = pieform(
'value' => 'submit'
),
'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
'type' => 'button',
'usebuttontag' => true,
......
......@@ -132,7 +132,7 @@ jQuery(function($) {
var element = todo.shift();
if (!element) {
$('#installdone').removeClass('hidden');
$('#installdone').removeClass('d-none');
$('html, body').animate({ scrollTop: $('#installdone').offset().top }, 'slow');
return; // done
}
......
......@@ -117,10 +117,10 @@ jQuery(function($) {
function authloginmsgVisibility() {
// If Parent authority is 'None'
if ($('#auth_config_parent').val() != 0) {
$('#auth_config_authloginmsg_container').addClass('hidden');
$('#auth_config_authloginmsg_container').addClass('d-none');
}
else {
$('#auth_config_authloginmsg_container').removeClass('hidden');
$('#auth_config_authloginmsg_container').removeClass('d-none');
}
}
var ssoAllOptions = {
......@@ -134,10 +134,10 @@ jQuery(function($) {
var current = $('#auth_config_ssodirection').val();
for (var opt in ssoAllOptions) {
if (ssoAllOptions[opt] == current) {
$('#auth_config_' + opt + '_container').removeClass('hidden');
$('#auth_config_' + opt + '_container').removeClass('d-none');
}
else {
$('#auth_config_' + opt + '_container').addClass('hidden');
$('#auth_config_' + opt + '_container').addClass('d-none');
}
}
}
......
......@@ -63,7 +63,7 @@ $userids = array_keys($users);
// Used in all three forms
$userelement = array(
'type' => 'select',
'class' => 'hidden',
'class' => 'd-none',
'multiple' => 'true',
'options' => array_combine($userids, $userids),
'value' => $userids,
......@@ -106,7 +106,7 @@ $suspendform = pieform(array(
'suspend' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default input-group-btn no-label',
'class' => 'btn-secondary input-group-btn no-label',
'value' => get_string('Suspend', 'admin'),
)
)
......@@ -136,7 +136,7 @@ if (count($options) > 1) {
'changeauth' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default input-group-btn',
'class' => 'btn-secondary input-group-btn',
'value' => get_string('changeauthmethod', 'admin')
)
)
......@@ -167,7 +167,7 @@ if (is_using_probation()) {
'setprobation' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default input-group-btn no-label',
'class' => 'btn-secondary input-group-btn no-label',
'confirm' => get_string('probationbulkconfirm', 'admin'),
'value' => get_string('probationbulkset', 'admin'),
)
......@@ -187,7 +187,7 @@ $deleteform = pieform(array(
'delete' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-secondary',
'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'),
),
......
......@@ -680,7 +680,7 @@ if (empty($suspended)) {
),
'submit' => array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => get_string('suspenduser','admin'),
),
)
......@@ -699,7 +699,7 @@ else {
),
'submit' => array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => get_string('unsuspenduser','admin'),
),
)
......@@ -749,7 +749,7 @@ $deleteform = pieform(array(
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => '<span class="icon icon-trash icon-lg text-danger left" role="presentation" aria-hidden="true"></span><span>'. get_string('deleteuser', 'admin') . '</span>',
'confirm' => get_string('confirmdeleteuser', 'admin'),
),
......@@ -845,7 +845,7 @@ foreach ($institutions as $i) {
),
$i->institution.'_remove' => array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => get_string('removeuserfrominstitution', 'admin'),
'confirm' => get_string('confirmremoveuserfrominstitution', 'admin'),
)
......
......@@ -208,7 +208,7 @@ if ($institution || $add) {
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => array(get_string('yes'), get_string('no'))
)
)
......@@ -1243,7 +1243,7 @@ if ($institution && $institution != 'mahara') {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => '<span class="icon icon-lg text-danger icon-ban left" role="presentation" aria-hidden="true"></span>' . get_string('suspendinstitution','admin'),
),
)
......@@ -1265,7 +1265,7 @@ if ($institution && $institution != 'mahara') {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => '<span class="icon icon-lg text-success icon-check left" role="presentation" aria-hidden="true"></span>' . get_string('unsuspendinstitution','admin'),
),
)
......
......@@ -177,14 +177,14 @@ if ($usertype == 'lastinstitution') {
if ($usertype == 'requesters') {
$userlistform['elements']['reject'] = array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => get_string('declinerequests', 'admin'),
);
}
if (($usertype == 'nonmembers' || $usertype == 'lastinstitution') && $USER->get('admin')) {
$userlistform['elements']['add'] = array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => get_string('addmembers', 'admin'),
);
}
......
......@@ -188,7 +188,7 @@ $form = pieform_instance(array(
'isformgroup' => false,
'elements' => array(
'unsuspend' => array(
'class' => 'btn-default text-inline',
'class' => 'btn-secondary text-inline',
'type' => 'submit',
'isformgroup' => false,
'renderelementsonly' => true,
......@@ -196,7 +196,7 @@ $form = pieform_instance(array(
'value' => get_string('unsuspendusers', 'admin')
),
'unexpire' => array(
'class' => 'btn-default text-inline',
'class' => 'btn-secondary text-inline',
'type' => 'submit',
'isformgroup' => false,
'renderelementsonly' => true,
......@@ -204,7 +204,7 @@ $form = pieform_instance(array(
'value' => get_string('unexpireusers', 'admin')
),
'delete' => array(
'class' => 'btn-default text-inline',
'class' => 'btn-secondary text-inline',
'type' => 'submit',
'isformgroup' => false,
'renderelementsonly' => true,
......
......@@ -211,7 +211,7 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
),
'annotationreadonlymsg' => array(
'type' => 'html',
'class' => 'message info' . ($textreadonly ? '' : ' hidden'),
'class' => 'message info' . ($textreadonly ? '' : ' d-none'),
'value' => get_string('annotationreadonlymessage', 'blocktype.annotation/annotation'),
'help' => true,
),
......@@ -222,7 +222,7 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
),
'tags' => array(
'type' => 'tags',
'class' => $readonly ? 'hidden' : '',
'class' => $readonly ? 'd-none' : '',
'width' => '100%',
'title' => get_string('tags'),
'description' => get_string('tagsdescprofile'),
......@@ -230,7 +230,7 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
),
'tagsreadonly' => array(
'type' => 'html',
'class' => $readonly ? '' : 'hidden',
'class' => $readonly ? '' : 'd-none',
'width' => '100%',
'title' => get_string('tags'),
'value' => '<div id="instconf_tagsreadonly_display">' . (is_array($tags) ? hsc(join(', ', $tags)) : '') . '</div>',
......@@ -279,7 +279,7 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
'defaultvalue' => (($evidence) ? $evidence->element : null),
);
array_walk($selectdescriptions, function (&$a, $b) {
$a = '<div class="hidden" id="option_' . $b . '">' . $a . '</div>';
$a = '<div class="d-none" id="option_' . $b . '">' . $a . '</div>';
});
$elements['smartevidencedesc'] = array(
'type' => 'html',
......@@ -445,8 +445,8 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
return <<<EOF
jQuery(function($) {
function show_se_desc(id) {
$("#instconf_smartevidencedesc_container div:not(.description)").addClass('hidden');
$("#option_" + id).removeClass('hidden');
$("#instconf_smartevidencedesc_container div:not(.description)").addClass('d-none');
$("#option_" + id).removeClass('d-none');
}
if ($("#instconf_smartevidence").length) {
// block title will be overwritten with framework choice so make it disabled
......
......@@ -982,7 +982,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
$submit = array(
'type' => 'submit',
'value' => get_string('placeannotationfeedback', 'artefact.annotation'),
'class' => 'btn-default'
'class' => 'btn-secondary'
);
$form['elements']['submit'] = $submit;
// Dont use the 'Processing...' bit on the submit button
......@@ -1339,7 +1339,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
}
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => array(get_string('placeannotationfeedback', 'artefact.annotation'), get_string('cancel')),
'goto' => '/' . $view->get_url(false),
);
......@@ -1398,7 +1398,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default btn-sm',
'class' => 'btn-secondary btn-sm',
'value' => '<span class="icon icon-trash text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">' . get_string('delete') . '</span>',
'elementtitle' => get_string('delete'),
'confirm' => get_string('reallydeletethisannotationfeedback', 'artefact.annotation'),
......
......@@ -598,7 +598,7 @@ class ArtefactTypeBlog extends ArtefactType {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default btn-sm last',
'class' => 'btn-secondary btn-sm last',
'alt' => get_string('deletespecific', 'mahara', $title),
'elementtitle' => get_string('delete'),
'confirm' => $confirm,
......@@ -1225,7 +1225,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
),'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default btn-sm publish',
'class' => 'btn-secondary btn-sm publish',
'value' => $strchangepoststatus,
),
),
......@@ -1251,7 +1251,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default btn-sm last',
'class' => 'btn-secondary btn-sm last',
'elementtitle' => get_string('delete'),
'confirm' => get_string('deleteblogpost?', 'artefact.blog'),
'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">' . get_string('deletespecific', 'mahara', $title) . '</span>',
......
......@@ -172,11 +172,11 @@ function changepoststatus_success(form, data) {
}
}
function delete_success(form, data) {
jQuery('#postdetails_' + data.id).addClass('hidden');
jQuery('#postdetails_' + data.id).addClass('d-none');
if (jQuery('#postfiles_' + data.id).length) {
jQuery('#postfiles_' + data.id).addClass('hidden');
}
jQuery('#postdescription_' + data.id).addClass('hidden');
jQuery('#postdescription_' + data.id).addClass('d-none');
jQuery('#posttitle_' + data.id).addClass('hidden');
var results = jQuery('#blogpost_pagination div.results').html();
var oldcount = parseInt(results, 10);
......
......@@ -987,7 +987,7 @@ class ArtefactTypeComment extends ArtefactType {
}
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn-default',
'class' => 'btn-secondary',
'value' => array(get_string('Comment', 'artefact.comment'), get_string('cancel')),
);
// This is a placeholder where we can display the parent comment's text
......@@ -1036,7 +1036,7 @@ class ArtefactTypeComment extends ArtefactType {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-default btn-sm',
'class' => 'btn-secondary btn-sm',
'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span> <span class="sr-only">' . get_string('delete') . '</span>',
'confirm' => get_string('reallydeletethiscomment', 'artefact.comment'),
'name' => 'delete_comment_submit',
......
$j('#instconf_select_container input[type="radio"][value="0"]').on("click", function() {