Commit 50031f15 authored by Naomi Guyer's avatar Naomi Guyer Committed by Robert Lyon

Bootstrap bug fixes (bootstrap) BUG 1465107

* Standardised delete form
* Applied styling to institution edit form

Change-Id: I2ee7fa8c07ece3ad56cf0c29d3b10d4dd19319bf
parent 03abd36b
......@@ -26,7 +26,7 @@ $deleteform = pieform(array(
'pluginname' => 'account',
'elements' => array(
'submit' => array(
'class' => 'btn btn-danger',
'class' => 'btn btn-default',
'type' => 'submit',
'value' => get_string('deleteaccount', 'mahara', display_username($USER), full_name($USER)),
),
......
......@@ -29,6 +29,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'admin/groups/groups.php',
)
......
......@@ -22,6 +22,8 @@ define('TITLE', get_string('administergroups', 'admin'));
$quotasform = pieform(array(
'name' => 'groupquotasform',
'class' => 'form-inline',
'renderer' => 'div',
'elements' => array(
'groupid' => array(
'type' => 'hidden',
......@@ -30,13 +32,14 @@ $quotasform = pieform(array(
'quota' => array(
'type' => 'bytes',
'title' => get_string('filequota1', 'admin'),
'description' => get_string('groupfilequotadescription', 'admin'),
'defaultvalue' => $group->quota,
),
'submit' => array(
'type' => 'submit',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-primary no-label',
'value' => get_string('save'),
),
)
),
));
......@@ -73,7 +76,7 @@ $admins = get_column_sql(
$groupadminsform = pieform(array(
'name' => 'groupadminsform',
'renderer' => 'table',
'renderer' => 'div',
'plugintype' => 'core',
'pluginname' => 'admin',
'elements' => array(
......@@ -86,6 +89,7 @@ $groupadminsform = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('save'),
),
),
......
......@@ -54,7 +54,7 @@ $closeform = pieform(array(
'submit' => array(
'type' => 'submit',
'value' => get_string($closed ? 'Open' : 'Close', 'admin'),
'class' => $closed ? 'btn btn-success' : 'btn btn-danger'
'class' => $closed ? 'btn btn-success' : 'btn btn-default'
),
),
));
......
......@@ -730,7 +730,7 @@ $siteoptionform = array(
),
'loggingsettings' => array(
'iconclass'=>'exclamation-triangle',
'class' => 'last',
'class' => 'last mbxl',
'type' => 'fieldset',
'collapsible' => true,
'collapsed' => true,
......@@ -764,8 +764,9 @@ $siteoptionform = array(
);
$siteoptionform['elements']['submit'] = array(
'type' => 'submit',
'class' => 'btn btn-success mtm',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-success',
'value' => get_string('updatesiteoptions', 'admin')
);
......
......@@ -79,6 +79,7 @@ if ($institution && $plugin) {
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('submit'), get_string('cancel')),
'goto' => 'addauthority.php?c=1'
);
......
......@@ -189,6 +189,7 @@ if ($institution || $add) {
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no'))
)
)
......@@ -532,6 +533,7 @@ if ($institution || $add) {
$elements['lockedfields'] = array(
'type' => 'fieldset',
'class' => 'last',
'legend' => get_string('Lockedfields', 'admin'),
'collapsible' => true,
'collapsed' => true,
......@@ -551,11 +553,6 @@ if ($institution || $add) {
'disabled' => $institution != 'mahara' && in_array($field, $sitelockedfields)
);
}
$elements['lockedfieldshelp'] = array(
'value' => '<tr id="lockedfieldshelp"><th colspan="2">'
. get_help_icon('core', 'admin', 'institution', 'lockedfields')
. '</th></tr>'
);
// Check for active plugins institution settings.
$elements['pluginsfields'] = array(
......@@ -582,6 +579,7 @@ if ($institution || $add) {
$elements['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('submit'), get_string('cancel'))
);
......@@ -1059,6 +1057,8 @@ if ($institution && $institution != 'mahara') {
$suspendformdef = array(
'name' => 'institution_suspend',
'plugintype' => 'core',
'renderer' => 'div',
'class' => 'form-as-button last',
'pluginname' => 'admin',
'elements' => array(
'i' => array(
......@@ -1066,9 +1066,10 @@ if ($institution && $institution != 'mahara') {
'value' => $institution,
),
'submit' => array(
'type' => 'submit',
'value' => get_string('suspendinstitution','admin'),
'description' => get_string('suspendinstitutiondescription','admin'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="icon icon-lg text-danger icon-ban prm"></span>' . get_string('suspendinstitution','admin'),
),
)
);
......@@ -1079,6 +1080,7 @@ if ($institution && $institution != 'mahara') {
$suspendformdef = array(
'name' => 'institution_unsuspend',
'plugintype' => 'core',
'renderer' => 'div',
'pluginname' => 'admin',
'elements' => array(
'i' => array(
......@@ -1086,8 +1088,10 @@ if ($institution && $institution != 'mahara') {
'value' => $institution,
),
'submit' => array(
'type' => 'submit',
'value' => get_string('unsuspendinstitution','admin'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="icon icon-lg text-success icon-check prm"></span>' . get_string('unsuspendinstitution','admin'),
'description' => get_string('unsuspendinstitutiondescription','admin'),
),
)
......@@ -1136,6 +1140,7 @@ jQuery(function($) {
$smarty = smarty();
setpageicon($smarty, 'icon-university');
$smarty->assign('INLINEJAVASCRIPT', $themeoptionsjs);
$smarty->assign('institution_form', $institutionform);
$smarty->assign('instancestring', $instancestring);
......@@ -1154,6 +1159,7 @@ if (isset($suspended)) {
}
$smarty->assign('PAGEHEADING', get_string('admininstitutions', 'admin'));
$smarty->assign('subsectionheading', get_field('institution', 'displayname', 'name', $institution));
$smarty->display('admin/users/institutions.tpl');
function theme_sort($a, $b) {
......
......@@ -56,7 +56,7 @@ if ($delete) {
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-danger',
'class' => 'btn btn-default',
'value' => array(get_string('deleteprofile','artefact.internal'), get_string('cancel')),
'goto' => get_config('wwwroot') . '/artefact/internal/index.php?fs=social',
),
......
......@@ -154,7 +154,7 @@ class PluginAuthBrowserid extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -210,7 +210,7 @@ class PluginAuthImap extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -1967,7 +1967,7 @@ class PluginAuthLdap extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -462,7 +462,7 @@ class PluginAuthSaml extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -835,7 +835,7 @@ class PluginAuthXmlrpc extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -204,10 +204,7 @@ function export_submit(Pieform $form, $values) {
}
$smarty = smarty(
$jsfiles,
array('<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'theme/views.css') . '">'),
array(),
array('stylesheets' => array('style/views.css'))
$jsfiles
);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('pagedescription', get_string('exportportfoliodescription', 'export'));
......
......@@ -1496,7 +1496,8 @@ EOF;
else {
$labelclass = '';
}
$nolabeltypes = array('radio', 'emaillist', 'date', 'files', 'checkboxes');
$nolabeltypes = array('radio', 'emaillist', 'date', 'files', 'checkboxes', 'bytes');
if (!empty($element['nolabel']) || in_array($element['type'], $nolabeltypes)) {
// Don't bother with a label for the element.
// Special 'nolabeltypes' have their own label(s) added direct to the form field(s).
......
......@@ -65,16 +65,19 @@ function pieform_element_bytes(Pieform $form, $element) {/*{{{*/
// @todo probably create with an actual input element, as tabindex doesn't work here for one thing
// Same with the select. And do the events using mochikit signal instead of dom events
$numberinput = '<input';
$numberinput = '<div class="with-dropdown js-with-dropdown text">';
$numberinput .= '<label for="' . $formname . '_' . $name . '">' . Pieform::hsc($element['title']) . ': </label><input';
$numberinput .= ' type="text" size="6" name="' . $name . '"';
$numberinput .= ' id="' . $formname . '_' . $name . '" value="' . Pieform::hsc($values['number']) . '" tabindex="' . Pieform::hsc($element['tabindex']) . '"';
$numberinput .= (isset($element['error']) ? ' class="error"' : '');
$numberinput .= 'class="with-dropdown js-with-dropdown form-control text'. (isset($element['error']) ? ' error"' : '') . '"';
if (isset($element['description'])) {
$numberinput .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
$numberinput .= ">\n";
$uselect = '<label for="' . $formname . '_' . $name . '_units" class="accessible-hidden sr-only">' . get_string('units') . '</label>';
$uselect .= '<select name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
$numberinput .= "></div>\n";
$uselect = '<div class="dropdown-connect js-dropdown-connect select">';
$uselect .= '<label for="' . $formname . '_' . $name . '_units" class="accessible-hidden sr-only">' . get_string('units') . '</label>';
$uselect .= '<span class="picker"><select class="form-control dropdown-connect js-dropdown-connect select" name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
$uselect .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
......@@ -83,9 +86,15 @@ function pieform_element_bytes(Pieform $form, $element) {/*{{{*/
$uselect .= "\t<option value=\"$u\"" . (($values['units'] == $u) ? ' selected="selected"' : '') . '>'
. $form->i18n('element', 'bytes', $u, $element) . "</option>\n";
}
$uselect .= "</select>\n";
$uselect .= "</select></span></div>\n";
$fieldset = '<div id="' . $formname . '_' . $name . '_fieldset" class="dropdown-group js-dropdown-group form-group">'
. '<fieldset class="pieform-fieldset dropdown-group js-dropdown-group">'
. $numberinput
. $uselect
. '</fieldset></div>';
return $numberinput . $uselect;
return $fieldset;
}/*}}}*/
/**
......
@charset "UTF-8";
/**
* Stylesheet index for Mahara's Bootstrap theme.
*
......@@ -406,8 +405,8 @@ body {
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
color: #333;
background-color: #fff;
color: #333333;
background-color: white;
}
/* line 36, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_scaffolding.scss */
......@@ -463,8 +462,8 @@ img {
.img-thumbnail {
padding: 4px;
line-height: 1.5;
background-color: #fff;
border: 1px solid #ddd;
background-color: white;
border: 1px solid #dddddd;
border-radius: 3px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
......@@ -698,7 +697,7 @@ a.text-success:hover, .list-group a.tag:hover {
/* line 5, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss */
.text-success, .list-group a.tag, .list-group a.text-success {
color: #449D44;
color: #449d44;
}
/* line 8, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss */
......@@ -795,7 +794,7 @@ a.bg-danger:hover {
.page-header, h1 {
padding-bottom: 9.5px;
margin: 42px 0 21px;
border-bottom: 1px solid #ccc;
border-bottom: 1px solid #cccccc;
}
/* line 149, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_type.scss */
......@@ -977,8 +976,8 @@ code {
kbd {
padding: 2px 4px;
font-size: 90%;
color: #fff;
background-color: #333;
color: white;
background-color: #333333;
border-radius: 3px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
......@@ -1000,8 +999,8 @@ pre {
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #ccc;
background-color: whitesmoke;
border: 1px solid #cccccc;
border-radius: 3px;
}
/* line 55, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_code.scss */
......@@ -2172,12 +2171,12 @@ th {
padding: 8px;
line-height: 1.5;
vertical-align: top;
border-top: 1px solid #ddd;
border-top: 1px solid #dddddd;
}
/* line 41, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd;
border-bottom: 2px solid #dddddd;
}
/* line 50, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table > caption + thead > tr:first-child > th,
......@@ -2190,11 +2189,11 @@ th {
}
/* line 57, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table > tbody + tbody {
border-top: 2px solid #ddd;
border-top: 2px solid #dddddd;
}
/* line 62, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table .table {
background-color: #fff;
background-color: white;
}
/* line 75, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
......@@ -2209,7 +2208,7 @@ th {
/* line 88, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered {
border: 1px solid #ddd;
border: 1px solid #dddddd;
}
/* line 94, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered > thead > tr > th,
......@@ -2218,7 +2217,7 @@ th {
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > tfoot > tr > td {
border: 1px solid #ddd;
border: 1px solid #dddddd;
}
/* line 101, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table-bordered > thead > tr > th,
......@@ -2233,7 +2232,7 @@ th {
/* line 125, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table-hover > tbody > tr:hover {
background-color: #f5f5f5;
background-color: whitesmoke;
}
/* line 135, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
......@@ -2262,7 +2261,7 @@ table th[class*="col-"] {
.table > tfoot > tr > th.active,
.table > tfoot > tr.active > td,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
background-color: whitesmoke;
}
/* line 20, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_table-row.scss */
......@@ -2363,7 +2362,7 @@ table th[class*="col-"] {
margin-bottom: 15.75px;
overflow-y: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #ddd;
border: 1px solid #dddddd;
}
/* line 183, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_tables.scss */
.table-responsive > .table {
......@@ -2497,9 +2496,9 @@ output {
font-size: 14px;
line-height: 1.5;
color: #555555;
background-color: #fff;
background-color: white;
background-image: none;
border: 1px solid #ccc;
border: 1px solid #cccccc;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
......@@ -2516,16 +2515,16 @@ output {
}
/* line 103, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss */
.form-control::-moz-placeholder {
color: #999;
color: #999999;
opacity: 1;
}
/* line 107, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss */
.form-control:-ms-input-placeholder {
color: #999;
color: #999999;
}
/* line 108, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss */
.form-control::-webkit-input-placeholder {
color: #999;
color: #999999;
}
/* line 141, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_forms.scss */
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
......@@ -2796,11 +2795,11 @@ select[multiple].input-lg,
.has-success .checkbox,
.has-success .radio-inline,
.has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label {
color: #449D44;
color: #449d44;
}
/* line 21, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_forms.scss */
.has-success .form-control {
border-color: #449D44;
border-color: #449d44;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
......@@ -2812,13 +2811,13 @@ select[multiple].input-lg,
}
/* line 31, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_forms.scss */
.has-success .input-group-addon {
color: #449D44;
border-color: #449D44;
color: #449d44;
border-color: #449d44;
background-color: #eaf6ea;
}
/* line 37, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_forms.scss */
.has-success .form-control-feedback {
color: #449D44;
color: #449d44;
}
/* line 8, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_forms.scss */
......@@ -3056,7 +3055,7 @@ select[multiple].input-lg,
}
/* line 32, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_buttons.scss */
.btn:hover, .btn:focus, .btn.focus {
color: #333;
color: #333333;
text-decoration: none;
}
/* line 39, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_buttons.scss */
......@@ -3078,13 +3077,13 @@ select[multiple].input-lg,
/* line 60, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_buttons.scss */
.btn-default {
color: #333;
background-color: #F9F9F9;
border-color: #ccc;
color: #333333;
background-color: #f9f9f9;
border-color: #cccccc;
}
/* line 11, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-default:hover, .btn-default:focus, .btn-default.focus, .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle {
color: #333;
color: #333333;
background-color: #e0e0e0;
border-color: #adadad;
}
......@@ -3094,24 +3093,24 @@ select[multiple].input-lg,
}
/* line 29, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled.focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled].focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active {
background-color: #F9F9F9;
border-color: #ccc;
background-color: #f9f9f9;
border-color: #cccccc;
}
/* line 40, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-default .badge {
color: #F9F9F9;
background-color: #333;
color: #f9f9f9;
background-color: #333333;
}
/* line 63, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_buttons.scss */
.btn-primary {
color: #fff;
color: white;
background-color: #a4056a;
border-color: #8b045a;
}
/* line 11, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-primary:hover, .btn-primary:focus, .btn-primary.focus, .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle {
color: #fff;
color: white;
background-color: #73034a;
border-color: #500234;
}
......@@ -3127,18 +3126,18 @@ select[multiple].input-lg,
/* line 40, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-primary .badge {
color: #a4056a;
background-color: #fff;
background-color: white;
}
/* line 67, ../../../lib/bootstrap/assets/stylesheets/bootstrap/_buttons.scss */
.btn-success {
color: #fff;
background-color: #449D44;
color: white;
background-color: #449d44;
border-color: #3c8b3c;
}
/* line 11, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-success:hover, .btn-success:focus, .btn-success.focus, .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle {
color: #fff;
color: white;
background-color: #357935;
border-color: #2a612a;
}
......@@ -3148,13 +3147,13 @@ select[multiple].input-lg,
}
/* line 29, ../../../lib/bootstrap/assets/stylesheets/bootstrap/mixins/_buttons.scss */
.btn-success.disabled, .btn-success.disabled:hover, .btn-success.disabled:focus, .btn-success.disabled.focus, .btn-success.disabled:active, .btn-success.disabled.active, .btn-success[disabled], .btn-success[disabled]:hover, .btn-success[disabled]:focus, .btn-success[disabled].focus, .btn-success[disabled]:active, .btn-success[disabled].active, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success:hover, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success.focus, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success.active {
background-color: #449D44;