Commit 2f3f8e45 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-56657 admin: Style all admin/role pages for boost

parent 0b8e0c37
......@@ -120,7 +120,7 @@ foreach ($settingspage->children as $childpage) {
}
if ($savebutton) {
$outputhtml .= html_writer::start_tag('div', array('class' => 'form-buttons'));
$outputhtml .= html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
$outputhtml .= html_writer::empty_tag('input', array('class' => 'btn btn-primary form-submit', 'type' => 'submit', 'value' => get_string('savechanges','admin')));
$outputhtml .= html_writer::end_tag('div');
}
......
......@@ -133,9 +133,12 @@ echo $OUTPUT->header();
</td>
<td id="buttonscell">
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>" title="<?php print_string('mainadminset', 'core_role'); ?>" />
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>"
title="<?php print_string('add'); ?>" class="btn btn-secondary"/><br />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>"
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/><br />
<input name="main" id="main" type="submit" value="<?php echo get_string('mainadminset', 'core_role'); ?>"
title="<?php print_string('mainadminset', 'core_role'); ?>" class="btn btn-secondary"/>
</p>
</td>
<td id="potentialcell">
......
......@@ -80,7 +80,7 @@ echo $OUTPUT->box($controller->get_intro_text());
echo '<form action="' . $baseurl . '" method="post">';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
echo html_writer::table($table);
echo '<div class="submitbuttons">';
echo '<div class="buttons">';
echo '<input type="submit" class="btn btn-primary" name="submit" value="' . get_string('savechanges') . '"/>';
echo '</div></form>';
......
......@@ -201,11 +201,13 @@ if ($roleid) {
</td>
<td id="buttonscell">
<div id="addcontrols">
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
<input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>"
title="<?php print_string('add'); ?>" class="btn btn-secondary"/><br />
</div>
<div id="removecontrols">
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
<input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>"
title="<?php print_string('remove'); ?>" class="btn btn-secondary"/>
</div>
</td>
<td id="potentialcell">
......
......@@ -172,7 +172,8 @@ echo $OUTPUT->heading('<label for="reportuser">' . $selectheading . '</label>',
$userselector->display();
// Submit button and the end of the form.
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" /></p>';
echo '<p id="chooseusersubmit"><input type="submit" value="' . get_string('showthisuserspermissions', 'core_role') . '" ' .
'class="btn btn-primary"/></p>';
echo '</form>';
echo $OUTPUT->box_end();
......
......@@ -471,13 +471,13 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
}
protected function get_name_field($id) {
return '<input type="text" class="form-control" id="' . $id . '" name="' . $id . '" size="30"
value="' . s($this->role->name) . '" />';
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->name) . '"' .
' class="form-control"/>';
}
protected function get_shortname_field($id) {
return '<input type="text" class="form-control" id="' . $id . '" name="' . $id . '" size="30"
value="' . s($this->role->shortname) . '" />';
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '"' .
' class="form-control"/>';
}
protected function get_description_field($id) {
......
......@@ -54,7 +54,8 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
this.input = Y.Node.create('<input class="form-control m-x-1" type="text"' +
' id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
// Create a label for the search input.
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.util.get_string('filter', 'moodle')+' </label>');
this.label = Y.Node.create('<label for="' + this.input.get('id') + '">' +
M.util.get_string('filter', 'moodle') + ' </label>');
// Create a clear button to clear the input.
this.button = Y.Node.create('<input type="button" class="btn btn-primary"' +
' value="'+M.util.get_string('clear', 'moodle')+'" />').set('disabled', filtervalue=='');
......
......@@ -177,8 +177,10 @@ if (!empty($capabilities)) {
}
echo html_writer::start_tag('div', array('class'=>'submit_buttons'));
echo html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges')));
echo html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel')));
$attrs = array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges'), 'class'=>'btn btn-primary');
echo html_writer::empty_tag('input', $attrs);
$attrs = array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel'), 'class' => 'btn btn-secondary');
echo html_writer::empty_tag('input', $attrs);
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
......
......@@ -24,9 +24,8 @@ p.arrow_button {
}
#addcontrols {
// The margin top is equal the combination of the line-height and margin of a <p>,
// because the visual parent is a <p>.
margin-top: $line-height-base + ($line-height-base / 2);
// This is displayed in a column between 2 20 row multi-selects. This should be just short of half way.
margin-top: 8 * $line-height-base * $font-size-base;
text-align: center;
margin-bottom: 3em;
......
......@@ -131,6 +131,7 @@ a.autolink.glossary:hover {
/* Block which is hidden if javascript enabled, prevents fickering visible when JS from footer used! */
.collapsibleregioncaption {
white-space: nowrap;
min-height: $line-height-base * $font-size-base;
}
.pagelayout-mydashboard.jsenabled .collapsibleregioncaption {
......@@ -155,6 +156,7 @@ a.autolink.glossary:hover {
.jsenabled .collapsibleregion {
overflow: hidden;
box-sizing: content-box;
}
.jsenabled .collapsed .collapsibleregioninner {
......
......@@ -118,11 +118,6 @@ div.backup-section + form,
padding-left: 0;
}
.path-admin .buttons,
.form-buttons { // Add back the padding it would usually get from being inside a .form-horizontal.
padding-left: $display1-size;
}
.form-item .form-setting .defaultsnext > input {
display: inline-block;
}
......
......@@ -227,19 +227,19 @@ abstract class user_selector_base {
}
$output = '<div class="userselector" id="' . $this->name . '_wrapper">' . "\n" .
'<select name="' . $name . '" id="' . $this->name . '" ' .
$multiselect . 'size="' . $this->rows . '">' . "\n";
$multiselect . 'size="' . $this->rows . '" class="form-control no-overflow">' . "\n";
// Populate the select.
$output .= $this->output_options($groupedusers, $search);
// Output the search controls.
$output .= "</select>\n<div>\n";
$output .= "</select>\n<div class=\"form-inline\">\n";
$output .= '<input type="text" name="' . $this->name . '_searchtext" id="' .
$this->name . '_searchtext" size="15" value="' . s($search) . '" />';
$this->name . '_searchtext" size="15" value="' . s($search) . '" class="form-control"/>';
$output .= '<input type="submit" name="' . $this->name . '_searchbutton" id="' .
$this->name . '_searchbutton" value="' . $this->search_button_caption() . '" />';
$this->name . '_searchbutton" value="' . $this->search_button_caption() . '" class="btn btn-secondary"/>';
$output .= '<input type="submit" name="' . $this->name . '_clearbutton" id="' .
$this->name . '_clearbutton" value="' . get_string('clear') . '" />';
$this->name . '_clearbutton" value="' . get_string('clear') . '" class="btn btn-secondary"/>';
// And the search options.
$optionsoutput = false;
......
......@@ -77,7 +77,7 @@ M.core_user.init_user_selector = function (Y, name, hash, extrafields, lastsearc
// Replace the Clear submit button with a clone that is not a submit button.
var clearbtn = Y.one('#' + this.name + '_clearbutton');
this.clearbutton = Y.Node.create('<input type="button" value="' + clearbtn.get('value') + '" />');
this.clearbutton = Y.Node.create('<input type="button" value="' + clearbtn.get('value') + '" class="btn btn-secondary m-x-1"/>');
clearbtn.replace(Y.Node.getDOMNode(this.clearbutton));
this.clearbutton.set('id', this.name + "_clearbutton");
this.clearbutton.on('click', this.handle_clear, this);
......
Supports Markdown
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