Skip to content

Commit

Permalink
MDL-81821 theme_boost: Refactor font utility classes for BS5
Browse files Browse the repository at this point in the history
  • Loading branch information
roland04 committed Nov 26, 2024
1 parent 505a85e commit 636ab0f
Show file tree
Hide file tree
Showing 120 changed files with 240 additions and 220 deletions.
10 changes: 5 additions & 5 deletions admin/tool/componentlibrary/content/bootstrap/layout/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ See them in action and compare them in our [Grid example]({{< docsref "/examples
<th></th>
<th>
Extra small<br>
<span class="font-weight-normal">&lt;576px</span>
<span class="fw-normal">&lt;576px</span>
</th>
<th>
Small<br>
<span class="font-weight-normal">&ge;576px</span>
<span class="fw-normal">&ge;576px</span>
</th>
<th>
Medium<br>
<span class="font-weight-normal">&ge;768px</span>
<span class="fw-normal">&ge;768px</span>
</th>
<th>
Large<br>
<span class="font-weight-normal">&ge;992px</span>
<span class="fw-normal">&ge;992px</span>
</th>
<th>
Extra large<br>
<span class="font-weight-normal">&ge;1200px</span>
<span class="fw-normal">&ge;1200px</span>
</th>
</tr>
</thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The parameters for the template context are:
"collapsedcontent": "Hello...",
"expandedcontent": "Hello<br>Is it me you're looking for? I can see it in your eyes",
"extraclasses": "rounded p-2 border",
"buttonextraclasses": "font-weight-bold"
"buttonextraclasses": "fw-bold"
}
{{< /mustache >}}

Expand Down
6 changes: 3 additions & 3 deletions admin/tool/componentlibrary/content/moodle/themes/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ tip: you can use heading classes to style a native heading tag differently.
{{< example >}}
<p class="text-lowercase">Lowercased text.</p>
<p class="text-uppercase">Uppercased text.</p>
<p class="font-weight-bold">Bold text.</p>
<p class="font-weight-normal">Normal weight text.</p>
<p class="font-italic">Italic text.</p>
<p class="fw-bold">Bold text.</p>
<p class="fw-normal">Normal weight text.</p>
<p class="fst-italic">Italic text.</p>

<p class="text-muted">
Muted text with a <a href="#" class="text-reset">reset link</a>.
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/dataprivacy/templates/component_status.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<dl>
{{#fields}}
<div class="row">
<dt class="col-3 font-weight-normal" style="word-wrap:break-word">{{field_name}}</dt>
<dt class="col-3 fw-normal" style="word-wrap:break-word">{{field_name}}</dt>
<dd class="col-9">{{field_summary}}</dd>
</div>
{{/fields}}
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/generator/templates/stepsinformation.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{{{given}}}
{{#example}}
<div class="alert alert-info mb-0 mt-2" role="alert" style="overflow: auto;">
<div class="font-weight-bold mr-2 ">{{#str}} step_example, tool_generator {{/str}}</div>
<div class="fw-bold mr-2 ">{{#str}} step_example, tool_generator {{/str}}</div>
<pre class="mb-0">{{example}}</pre>
</div>
{{/example}}
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/mfa/classes/local/form/verification_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct($attributes = null, $auth = true, ?string $elementla
$attributes['inputmode'] = 'numeric';
$attributes['pattern'] = '[0-9]*';
// Overwrite default classes if set.
$attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'tool-mfa-verification-code font-weight-bold';
$attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'tool-mfa-verification-code fw-bold';
$attributes['maxlength'] = 6;

// If we aren't on the auth page, this might be part of a larger form such as for setup.
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/mfa/templates/verification_form.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</div>
{{#hasadditionalfactors}}
<div class="mb-6 mt-4 border-bottom"></div>
<p class="font-weight-bold mb-1">{{#str}} verifyalt, tool_mfa {{/str}}</p>
<p class="fw-bold mb-1">{{#str}} verifyalt, tool_mfa {{/str}}</p>
{{/hasadditionalfactors}}
{{#additionalfactors}}
<form id="{{uniqid}}-nextfactor" method="POST" action="{{{authurl}}}">
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/policy/classes/output/page_nopermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function export_for_template(renderer_base $output) {
$data = (object) [
'pluginbaseurl' => (new moodle_url('/admin/tool/policy'))->out(false),
'haspermissionagreedocs' => $this->haspermissionagreedocs,
'supportemail' => $OUTPUT->supportemail(['class' => 'font-weight-bold'])
'supportemail' => $OUTPUT->supportemail(['class' => 'fw-bold'])
];

// Get the messages to display.
Expand Down
2 changes: 1 addition & 1 deletion blocks/timeline/templates/course-item.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}}
<li class="list-group-item mt-3 p-0 border-0">
<div data-region="course-events-container" id="course-events-container-{{id}}" data-course-id="{{id}}" class="px-2">
<h4 class="h5 font-weight-bold">{{{fullnamedisplay}}}</h4>
<h4 class="h5 fw-bold">{{{fullnamedisplay}}}</h4>
{{< block_timeline/event-list }}
{{$courseid}}{{id}}{{/courseid}}
{{/ block_timeline/event-list }}
Expand Down
2 changes: 1 addition & 1 deletion blocks/timeline/templates/event-list-content.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div class="pb-2" data-region="event-list-wrapper">
{{#eventsbyday}}
<div class="mt-3" data-region="event-list-content-date" data-timestamp="{{dayTimestamp}}">
<h5 class="h6 d-inline {{^courseview}}font-weight-bold px-2{{/courseview}}">{{#userdate}} {{dayTimestamp}}, {{#str}} strftimedaydate, core_langconfig {{/str}} {{/userdate}}</h5>
<h5 class="h6 d-inline {{^courseview}}fw-bold px-2{{/courseview}}">{{#userdate}} {{dayTimestamp}}, {{#str}} strftimedaydate, core_langconfig {{/str}} {{/userdate}}</h5>
</div>
{{> block_timeline/event-list-items }}
{{/eventsbyday}}
Expand Down
2 changes: 1 addition & 1 deletion course/classes/management_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ public function course_detail(core_course_list_element $course) {
*/
protected function detail_pair($key, $value, $class ='') {
$html = html_writer::start_div('detail-pair row yui3-g '.preg_replace('#[^a-zA-Z0-9_\-]#', '-', $class));
$html .= html_writer::div(html_writer::span($key), 'pair-key col-md-3 yui3-u-1-4 font-weight-bold');
$html .= html_writer::div(html_writer::span($key), 'pair-key col-md-3 yui3-u-1-4 fw-bold');
$html .= html_writer::div(html_writer::span($value), 'pair-value col-md-8 yui3-u-3-4');
$html .= html_writer::end_div();
return $html;
Expand Down
2 changes: 1 addition & 1 deletion course/format/amd/build/local/content/actions.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion course/format/amd/build/local/content/actions.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion course/format/amd/src/local/content/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class extends BaseComponent {
// Component css classes.
this.classes = {
DISABLED: `disabled`,
ITALIC: `font-italic`,
ITALIC: `fst-italic`,
DISPLAYNONE: `d-none`,
};
}
Expand Down
2 changes: 1 addition & 1 deletion course/format/templates/local/content/addsection.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<div class="w-100 text-center">
{{#pix}}t/block, moodle{{/pix}}
</div>
<div class="w-100 font-italic text-center">
<div class="w-100 fst-italic text-center">
{{#str}}maxsectionaddmessage, core_courseformat{{/str}}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{{$expandedcontent}}
{{#pix}}t/unlock, core{{/pix}} {{{text}}}
{{/expandedcontent}}
{{$buttonextraclasses}}font-weight-bold{{/buttonextraclasses}}
{{$buttonextraclasses}}fw-bold{{/buttonextraclasses}}
{{$collapsedextraclasses}}text-truncate pe-2 {{#editing}}mt-2{{/editing}}{{/collapsedextraclasses}}
{{$expandedextraclasses}}
{{^editing}}py-2{{/editing}}
Expand Down
4 changes: 2 additions & 2 deletions course/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ protected function course_contacts(core_course_list_element $course) {
$rolenames = array_map(function ($role) {
return $role->displayname;
}, $coursecontact['roles']);
$name = html_writer::tag('span', implode(", ", $rolenames).': ', ['class' => 'font-weight-bold']);
$name = html_writer::tag('span', implode(", ", $rolenames).': ', ['class' => 'fw-bold']);
$name .= html_writer::link(
\core_user::get_profile_url($coursecontact['user'], context_system::instance()),
$coursecontact['username']
Expand Down Expand Up @@ -636,7 +636,7 @@ protected function course_category_name(coursecat_helper $chelper, core_course_l
if ($chelper->get_show_courses() == self::COURSECAT_SHOW_COURSES_EXPANDED_WITH_CAT) {
if ($cat = core_course_category::get($course->category, IGNORE_MISSING)) {
$content .= html_writer::start_tag('div', ['class' => 'coursecat']);
$content .= html_writer::tag('span', get_string('category').': ', ['class' => 'font-weight-bold']);
$content .= html_writer::tag('span', get_string('category').': ', ['class' => 'fw-bold']);
$content .= html_writer::link(new moodle_url('/course/index.php', ['categoryid' => $cat->id]),
$cat->get_formatted_name(), ['class' => $cat->visible ? '' : 'dimmed']);
$content .= html_writer::end_tag('div');
Expand Down
4 changes: 2 additions & 2 deletions course/templates/bulkactivitycompletion.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
<div class="row mb-1">
<div class="col-6">
<input type="checkbox" class="mastercheck me-1" aria-label="{{#str}}checkall, completion{{/str}}">
<label class="font-weight-bold">{{#str}}activitieslabel, core_completion{{/str}}</label>
<label class="fw-bold">{{#str}}activitieslabel, core_completion{{/str}}</label>
</div>
<div class="col-6">
<label class="font-weight-bold">{{#str}}completion, core_completion{{/str}}</label>
<label class="fw-bold">{{#str}}completion, core_completion{{/str}}</label>
<span>{{{helpicon}}}</span>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions course/templates/completion_automatic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}>
{{#pix}}i/checked{{/pix}}
<strong>{{#str}}completion_automatic:done, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
<strong>{{#str}}completion_automatic:done, core_course{{/str}}</strong> <span class="fw-normal">{{description}}</span>
</div>
{{/statuscomplete}}
{{#statuscompletefail}}
Expand All @@ -45,7 +45,7 @@
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}>
{{#pix}}e/cancel{{/pix}}
<strong>{{#str}}completion_automatic:failed, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
<strong>{{#str}}completion_automatic:failed, core_course{{/str}}</strong> <span class="fw-normal">{{description}}</span>
</div>
{{/statuscompletefail}}
{{#statusincomplete}}
Expand All @@ -54,12 +54,12 @@
}}title="{{.}}" {{!
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}>
<strong>{{#str}}completion_automatic:todo, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
<strong>{{#str}}completion_automatic:todo, core_course{{/str}}</strong> <span class="fw-normal">{{description}}</span>
</div>
{{/statusincomplete}}
{{/istrackeduser}}
{{^istrackeduser}}
<div class="badge rounded-pill bg-light text-dark" role="listitem">
<span class="font-weight-normal">{{description}}</span>
<span class="fw-normal">{{description}}</span>
</div>
{{/istrackeduser}}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
{{name}}
</th>
<td>
<span class="font-weight-bold">{{#str}}registerplatform:platformid, enrol_lti{{/str}}: </span> {{issuer}}<br>
<span class="font-weight-bold">{{#str}}registerplatform:clientid, enrol_lti{{/str}}: </span> {{clientid}}
<span class="fw-bold">{{#str}}registerplatform:platformid, enrol_lti{{/str}}: </span> {{issuer}}<br>
<span class="fw-bold">{{#str}}registerplatform:clientid, enrol_lti{{/str}}: </span> {{clientid}}
</td>
<td>
{{#hasdeployments}}
Expand Down
2 changes: 1 addition & 1 deletion error/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

echo $OUTPUT->header();
echo $OUTPUT->notification(get_string('pagenotexist', 'error', s($ME)), 'error');
echo $OUTPUT->supportemail(['class' => 'text-center d-block mb-3 font-weight-bold']);
echo $OUTPUT->supportemail(['class' => 'text-center d-block mb-3 fw-bold']);

if ($canmessage) {
echo \html_writer::tag('h4', get_string('sendmessage', 'error'));
Expand Down
2 changes: 1 addition & 1 deletion grade/classes/output/gradebook_setup_action_bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function export_for_template(\renderer_base $output): array {
);

$addmenu = new \action_menu($actions);
$addmenu->set_menu_trigger(get_string('add'), 'btn font-weight-bold');
$addmenu->set_menu_trigger(get_string('add'), 'btn fw-bold');
$data['addmenu'] = $addmenu->export_for_template($output);

return $data;
Expand Down
2 changes: 1 addition & 1 deletion grade/edit/tree/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public function get_category_cell($category, $levelclass, $params) {
$categorycell = parent::get_category_cell($category, $levelclass, $params);
$categorycell->colspan = ($this->deepest_level + 2) - $params['level'];
$rowtitle = html_writer::div($params['name'], 'rowtitle');
$categorycell->text = html_writer::div($mastercheckbox . $visibilitytoggle . $moveaction . $rowtitle, 'font-weight-bold');
$categorycell->text = html_writer::div($mastercheckbox . $visibilitytoggle . $moveaction . $rowtitle, 'fw-bold');
return $categorycell;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{{#criterion}}
<div class="mb-3 criterion" data-gradingform-guide-role="criterion">
<div class="d-flex align-items-center">
<h5 class="description font-weight-bold mb-0">{{name}}</h5>
<h5 class="description fw-bold mb-0">{{name}}</h5>
<button
class="btn btn-link px-1"
aria-controls="gradingform_guide-{{uniqid}}-criteria-{{id}}-description"
Expand All @@ -75,7 +75,7 @@
{{# pix }} info, gradingform_guide {{/ pix }}
<span class="sr-only">{{#str}}informationforcriterion, gradingform_guide, {{name}}{{/str}}</span>
</button>
<button class="criterion-toggle btn btn-icon icon-no-margin text-reset p-0 font-weight-bold mb-0 ms-auto"
<button class="criterion-toggle btn btn-icon icon-no-margin text-reset p-0 fw-bold mb-0 ms-auto"
type="button"
data-toggle="collapse"
data-target="#criteria-{{id}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
{{#criteria}}
<div class="mb-3">
<div class="d-flex align-items-center mb-2">
<h5 id="criterion-description-{{id}}" class="px-0 mb-0 description font-weight-bold">{{{description}}}</h5>
<button class="criterion-toggle btn btn-icon icon-no-margin text-reset p-0 font-weight-bold mb-0 ms-auto"
<h5 id="criterion-description-{{id}}" class="px-0 mb-0 description fw-bold">{{{description}}}</h5>
<button class="criterion-toggle btn btn-icon icon-no-margin text-reset p-0 fw-bold mb-0 ms-auto"
type="button"
data-toggle="collapse"
data-target="#criteria-{{id}}"
Expand Down
2 changes: 1 addition & 1 deletion grade/report/singleview/templates/bulkinsert.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{{#str}}blanks, gradereport_singleview{{/str}}
</label>
</div>
<p class ="font-weight-bold">
<p class ="fw-bold">
{{#str}}bulkinsertvalue, gradereport_singleview{{/str}}
</p>
<label for="{{name}}" class="sr-only">{{#str}}bulkinsertvalue, gradereport_singleview{{/str}}</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<span class="d-block small" aria-hidden="true">
{{#str}} selectagrade, gradereport_singleview {{/str}}
</span>
<span class="p-0 font-weight-bold">
<span class="p-0 fw-bold">
{{text}}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion grade/templates/export_action_bar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"labelattributes": [
{
"name": "class",
"value": "font-weight-bold"
"value": "fw-bold"
}
],
"selectedoption": "OpenDocument spreadsheet",
Expand Down
2 changes: 1 addition & 1 deletion grade/templates/export_key_manager_action_bar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"labelattributes": [
{
"name": "class",
"value": "font-weight-bold"
"value": "fw-bold"
}
],
"selectedoption": "Key manager",
Expand Down
2 changes: 1 addition & 1 deletion grade/templates/feedback_modal.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{{/picture}}
</div>
<div class="d-block">
<span class="p-0 font-weight-bold">
<span class="p-0 fw-bold">
{{fullname}}
</span>
{{#additionalfield}}
Expand Down
2 changes: 1 addition & 1 deletion grade/templates/import_action_bar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"labelattributes": [
{
"name": "class",
"value": "font-weight-bold"
"value": "fw-bold"
}
],
"selectedoption": "CSV file",
Expand Down
2 changes: 1 addition & 1 deletion grade/templates/import_key_manager_action_bar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"labelattributes": [
{
"name": "class",
"value": "font-weight-bold"
"value": "fw-bold"
}
],
"selectedoption": "Key manager",
Expand Down
2 changes: 1 addition & 1 deletion grade/templates/searchwidget/searchitem.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{{/profileimage}}
</div>
<div class="d-block pe-3 w-75">
<span class="w-100 p-0 font-weight-bold">
<span class="w-100 p-0 fw-bold">
{{fullname}}
</span>
<span class="w-100 pull-left text-truncate small">
Expand Down
2 changes: 1 addition & 1 deletion group/templates/comboboxsearch/group_selector.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<label class="d-block m-0 small" aria-hidden="true">
{{label}}
</label>
<span class="p-0 font-weight-bold" data-selected-option>
<span class="p-0 fw-bold" data-selected-option>
{{selectedgroup}}
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/moodlenet/share_progress_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ protected function col_name(stdClass $row): string {
}
}
if ($deleted) {
$class = 'font-italic';
$class = 'fst-italic';
}
// Add a link to the resource if it was recorded.
if (!empty($row->resourceurl)) {
// Apply bold to resource links that aren't deleted.
if (!$deleted) {
$class = 'font-weight-bold';
$class = 'fw-bold';
}
$icon = $OUTPUT->pix_icon('i/externallink', get_string('opensinnewwindow'), 'moodle', ['class' => 'ms-1']);
$text = $name . $icon;
Expand Down
Loading

0 comments on commit 636ab0f

Please sign in to comment.