Skip to content

Commit

Permalink
Upgrade: Update Bootstrap classes for Moodle 4.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Aug 24, 2024
1 parent e40f641 commit 39be9ad
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2024-08-24 - Upgrade: Update Bootstrap classes for Moodle 4.4.
* 2024-08-11 - Updated Moodle Plugin CI to latest upstream recommendations
* 2024-07-24 - Test: Fix broken Behat scenario 'Suppress 'Chat to course participants' link', resolves #696
* 2024-07-23 - Bugfix: Fix unparsable example JSON in Mustache template
Expand Down
4 changes: 2 additions & 2 deletions classes/table/flavours_overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ public function col_appliesto($data) {
if ($data->applytocategories == true) {
$badges[] = \html_writer::tag('span',
get_string('categories'),
['class' => 'badge badge-primary']);
['class' => 'badge bg-primary text-light']);
}

// If apply-to-cohorts is enabled, add a badge.
if ($data->applytocohorts == true) {
$badges[] = \html_writer::tag('span',
get_string('cohorts', 'cohort'),
['class' => 'badge badge-primary']);
['class' => 'badge bg-primary text-light']);
}

// Implode and return the badges.
Expand Down
10 changes: 5 additions & 5 deletions classes/table/smartmenus_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function col_type($data) {
$type = \theme_boost_union\smartmenu_item::get_types($data->type);

// Return the type as badge.
return \html_writer::tag('span', $type, ['class' => 'badge badge-primary']);
return \html_writer::tag('span', $type, ['class' => 'badge bg-primary text-light']);
}

/**
Expand All @@ -138,7 +138,7 @@ public function col_restrictions($data) {
$rolelist = $DB->get_records_list('role', 'id', $roles);
$rolenames = role_fix_names($rolelist);
array_walk($rolenames, function(&$value) {
$value = \html_writer::tag('span', $value->localname, ['class' => 'badge badge-primary']);
$value = \html_writer::tag('span', $value->localname, ['class' => 'badge bg-primary text-light']);
});

// Amend rule list.
Expand All @@ -154,7 +154,7 @@ public function col_restrictions($data) {
$cohorts = json_decode($data->cohorts);
$cohortlist = $DB->get_records_list('cohort', 'id', $cohorts);
array_walk($cohortlist, function(&$value) {
$value = \html_writer::tag('span', $value->name, ['class' => 'badge badge-primary']);
$value = \html_writer::tag('span', $value->name, ['class' => 'badge bg-primary text-light']);
});

// Amend rule list.
Expand All @@ -172,7 +172,7 @@ public function col_restrictions($data) {
$languagelist = [];
foreach ($languages as $lang) {
if (isset($options[$lang])) {
$languagelist[] = \html_writer::tag('span', $options[$lang], ['class' => 'badge badge-primary']);
$languagelist[] = \html_writer::tag('span', $options[$lang], ['class' => 'badge bg-primary text-light']);
}
}

Expand All @@ -198,7 +198,7 @@ public function col_restrictions($data) {
}

array_walk($datelist, function(&$value) {
$value = \html_writer::tag('span', $value, ['class' => 'badge badge-primary']);
$value = \html_writer::tag('span', $value, ['class' => 'badge bg-primary text-light']);
});

// Amend rule list.
Expand Down
4 changes: 2 additions & 2 deletions classes/table/smartmenus_menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function col_location($data) {
// Implode all given locations and show a badge for each of them.
return (!empty($locations)) ? implode(' ', array_map(function($value) {
$location = \theme_boost_union\smartmenu::get_location($value);
return \html_writer::tag('span', $location, ['class' => 'badge badge-primary']);
return \html_writer::tag('span', $location, ['class' => 'badge bg-primary text-light']);
}, $locations)) : "";
}

Expand All @@ -137,7 +137,7 @@ public function col_type($data) {
$type = \theme_boost_union\smartmenu::get_type($data->type);

// Return the type as badge.
return \html_writer::tag('span', $type, ['class' => 'badge badge-primary']);
return \html_writer::tag('span', $type, ['class' => 'badge bg-primary text-light']);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions templates/localloginform.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
<h1 class="login-heading mb-4">{{#str}}loginlocalloginformhead, theme_boost_union{{/str}}</h1>
<form class="login-form" action="{{loginurl}}" method="post" id="login">
<input type="hidden" name="logintoken" value="{{logintoken}}">
<div class="login-form-username form-group">
<div class="login-form-username mb-3">
<label for="username" class="sr-only">{{#str}}username{{/str}}</label>
<input type="text" name="username" id="username" class="form-control form-control-lg" placeholder="{{#cleanstr}}username{{/cleanstr}}">
</div>
<div class="login-form-password form-group">
<div class="login-form-password mb-3">
<label for="password" class="sr-only">{{#str}} password {{/str}}</label>
<input type="password" name="password" id="password" value="" class="form-control form-control-lg" placeholder="{{#cleanstr}}password{{/cleanstr}}">
</div>
<div class="login-form-submit form-group">
<div class="login-form-submit mb-3">
<button class="btn btn-primary btn-lg" type="submit" id="loginbtn">{{#str}}login{{/str}}</button>
</div>
</form>
Expand Down

0 comments on commit 39be9ad

Please sign in to comment.