Skip to content

Commit

Permalink
MDL-75670 theme: Refactor form-inline helper class dropped in BS5
Browse files Browse the repository at this point in the history
- Replace .form-inline Bootstrap helper class with .d-flex.flex-wrap.align-items-center
- Refactor .form-inline occurrences in SCSS files or remove when unneeded
  • Loading branch information
roland04 committed Feb 29, 2024
1 parent 4ce883a commit d0d62fd
Show file tree
Hide file tree
Showing 94 changed files with 165 additions and 318 deletions.
2 changes: 1 addition & 1 deletion admin/roles/classes/define_role_table_advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ protected function print_field($name, $caption, $field, $helpicon = null) {
} else {
$extraclass = '';
}
echo '<div class="felement col-md-9 form-inline' . $extraclass . '">';
echo '<div class="felement col-md-9 d-flex flex-wrap align-items-center' . $extraclass . '">';
echo $field;
if (isset($this->errors[$name])) {
echo $OUTPUT->error_text($this->errors[$name]);
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
this.table = Y.one('#'+this.tableid);

// Create a div to hold the search UI.
this.div = Y.Node.create('<div class="capabilitysearchui form-inline"></div>').setStyles({
this.div = Y.Node.create('<div class="capabilitysearchui d-flex flex-wrap align-items-center"></div>').setStyles({
width : this.table.get('offsetWidth'),
marginLeft : 'auto',
marginRight : 'auto'
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/header_search_input.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
}}
<div class="simplesearchform d-flex justify-content-end">
<form autocomplete="off" action="{{action}}" method="get" accept-charset="utf-8" class="mform form-inline simplesearchform">
<form autocomplete="off" action="{{action}}" method="get" accept-charset="utf-8" class="mform d-flex flex-wrap align-items-center simplesearchform">
<div class="input-group">
<label for="searchinput-{{uniqid}}">
<span class="sr-only">{{#str}} search, core {{/str}}</span>
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/setting_configduration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Setting configduration.
}}
<div class="form-duration defaultsnext">
<div class="form-inline">
<div class="d-flex flex-wrap align-items-center">
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
<label class="sr-only" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
<select id="{{id}}u" name="{{name}}[u]" class="form-control custom-select" {{#readonly}}disabled{{/readonly}}>
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/setting_configfile.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Setting configfile.
}}
<div class="form-file defaultsnext">
<div class="form-inline">
<div class="d-flex flex-wrap align-items-center">
<input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="form-control text-ltr" {{#readonly}}readonly{{/readonly}}>
{{#showvalidity}}
{{#valid}}
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/setting_configfilesize.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Setting configfilesize.
}}
<div class="form-filesize defaultsnext">
<div class="form-inline">
<div class="d-flex flex-wrap align-items-center">
<input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
<label class="sr-only" for="{{id}}u">{{#str}}filesizeunits, admin{{/str}}</label>
<select id="{{id}}u" name="{{name}}[u]" class="form-control custom-select" {{#readonly}}disabled{{/readonly}}>
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/setting_configtime.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
Setting configtime.
}}
<div class="form-time defaultsnext">
<div class="form-inline text-ltr">
<div class="d-flex flex-wrap align-items-center text-ltr">
<label class="sr-only" for="{{id}}h">{{#str}}hours{{/str}}</label>
<select id="{{id}}h" name="{{name}}[h]" class="custom-select" {{#readonly}}disabled{{/readonly}}>
{{#hours}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="controls d-flex justify-content-between">
<div class="simplesearchform w-100">
<form autocomplete="off" method="get" accept-charset="utf-8"
class="mform form-inline simplesearchform p-2 justify-content-center">
class="mform d-flex flex-wrap align-items-center simplesearchform p-2 justify-content-center">
<div class="input-group w-100" data-region="docsearch">
<label for="searchinput-componentlibrary">
<span class="sr-only">Search component library</span>
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/lp/templates/competency_picker.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{{/singleFramework}}
<h3 class="mt-1">{{#str}}locatecompetency, tool_lp{{/str}}</h3>

<form data-region="filtercompetencies" class="form-inline" data-frameworkid="{{framework.id}}">
<form data-region="filtercompetencies" class="d-flex flex-wrap align-items-center" data-frameworkid="{{framework.id}}">
<div class="mb-3">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div data-region="competencylinktree">
<h3>{{#str}}locatecompetency, tool_lp{{/str}}</h3>

<form data-region="filtercompetencies" class="form-inline" data-frameworkid="{{framework.id}}">
<form data-region="filtercompetencies" class="d-flex flex-wrap align-items-center" data-frameworkid="{{framework.id}}">
<div class="mb-3">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

<h3 class="mt-1">{{#str}}locatecompetency, tool_lp{{/str}}</h3>

<form data-region="filtercompetencies" data-planid="{{plan.id}}" class="form-inline">
<form data-region="filtercompetencies" data-planid="{{plan.id}}" class="d-flex flex-wrap align-items-center">
<div class="mb-3">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/lp/templates/manage_competencies_page.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<div class="row">
<div class="col-lg-6">
<p>
<form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="form-inline">
<form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="d-flex flex-wrap align-items-center">
<div class="input-group mb-3">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input class="form-control" type="text" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/spamcleaner/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<div class="mdl-align">

<form method="post" action="index.php" class="form-inline spamcleanerform">
<form method="post" action="index.php" class="d-flex flex-wrap align-items-center spamcleanerform">
<div>
<label class="accesshide" for="keyword_el"><?php print_string('spamkeyword', 'tool_spamcleaner') ?></label>
<input type="text" class="form-control" name="keyword" id="keyword_el" value="<?php p($keyword) ?>" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ M.availability_completion.form.getNode = function(json) {
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
'</select></label></span>';
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
var node = Y.Node.create('<span class="d-flex flex-wrap align-items-center">' + html + '</span>');

// Set initial values.
if (json.cm !== undefined &&
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ M.availability_completion.form.getNode = function(json) {
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
'</select></label></span>';
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
var node = Y.Node.create('<span class="d-flex flex-wrap align-items-center">' + html + '</span>');

// Set initial values.
if (json.cm !== undefined &&
Expand Down
2 changes: 1 addition & 1 deletion availability/condition/completion/yui/src/form/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ M.availability_completion.form.getNode = function(json) {
'<option value="2">' + M.util.get_string('option_pass', 'availability_completion') + '</option>' +
'<option value="3">' + M.util.get_string('option_fail', 'availability_completion') + '</option>' +
'</select></label></span>';
var node = Y.Node.create('<span class="form-inline">' + html + '</span>');
var node = Y.Node.create('<span class="d-flex flex-wrap align-items-center">' + html + '</span>');

// Set initial values.
if (json.cm !== undefined &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ M.availability_grade.form.getNode = function(json) {
'</label> <label><span class="accesshide">' + M.util.get_string('label_max', 'availability_grade') +
'</span><input type="text" class="form-control mx-1" name="maxval" title="' +
M.util.get_string('label_max', 'availability_grade') + '"/></label>%</span>';
var node = Y.Node.create('<div class="d-inline-block form-inline">' + html + '</div>');
var node = Y.Node.create('<div class="d-inline-block d-flex flex-wrap align-items-center">' + html + '</div>');

// Set initial values.
if (json.id !== undefined &&
Expand Down
Loading

0 comments on commit d0d62fd

Please sign in to comment.