MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5

This commit is contained in:
Mikel Martín 2023-12-01 10:54:22 +01:00
parent 810554ee83
commit a198884333
93 changed files with 218 additions and 209 deletions

View file

@ -273,7 +273,7 @@ class hook_list_table extends flexible_table {
if (is_array($tag)) { if (is_array($tag)) {
return $this->get_tag(...$tag); return $this->get_tag(...$tag);
} }
return $this->get_tag($tag, 'badge badge-info'); return $this->get_tag($tag, 'badge bg-info text-white');
}, $tags); }, $tags);
return implode("\n", $taglist); return implode("\n", $taglist);

View file

@ -1111,10 +1111,11 @@ class core_admin_renderer extends plugin_renderer_base {
if ($isstandard = $plugin->is_standard()) { if ($isstandard = $plugin->is_standard()) {
$row->attributes['class'] .= ' standard'; $row->attributes['class'] .= ' standard';
$sourcelabel = html_writer::span(get_string('sourcestd', 'core_plugin'), 'sourcetext badge badge-secondary'); $sourcelabel = html_writer::span(get_string('sourcestd', 'core_plugin'),
'sourcetext badge bg-secondary text-dark');
} else { } else {
$row->attributes['class'] .= ' extension'; $row->attributes['class'] .= ' extension';
$sourcelabel = html_writer::span(get_string('sourceext', 'core_plugin'), 'sourcetext badge badge-info'); $sourcelabel = html_writer::span(get_string('sourceext', 'core_plugin'), 'sourcetext badge bg-info text-white');
} }
$coredependency = $plugin->is_core_dependency_satisfied($version); $coredependency = $plugin->is_core_dependency_satisfied($version);
@ -1128,19 +1129,19 @@ class core_admin_renderer extends plugin_renderer_base {
$statusclass = 'statustext badge '; $statusclass = 'statustext badge ';
switch ($statuscode) { switch ($statuscode) {
case core_plugin_manager::PLUGIN_STATUS_NEW: case core_plugin_manager::PLUGIN_STATUS_NEW:
$statusclass .= $dependenciesok ? 'badge-success' : 'badge-warning'; $statusclass .= $dependenciesok ? 'bg-success text-white' : 'bg-warning text-dark';
break; break;
case core_plugin_manager::PLUGIN_STATUS_UPGRADE: case core_plugin_manager::PLUGIN_STATUS_UPGRADE:
$statusclass .= $dependenciesok ? 'badge-info' : 'badge-warning'; $statusclass .= $dependenciesok ? 'bg-info text-white' : 'bg-warning text-dark';
break; break;
case core_plugin_manager::PLUGIN_STATUS_MISSING: case core_plugin_manager::PLUGIN_STATUS_MISSING:
case core_plugin_manager::PLUGIN_STATUS_DOWNGRADE: case core_plugin_manager::PLUGIN_STATUS_DOWNGRADE:
case core_plugin_manager::PLUGIN_STATUS_DELETE: case core_plugin_manager::PLUGIN_STATUS_DELETE:
$statusclass .= 'badge-danger'; $statusclass .= 'bg-danger text-white';
break; break;
case core_plugin_manager::PLUGIN_STATUS_NODB: case core_plugin_manager::PLUGIN_STATUS_NODB:
case core_plugin_manager::PLUGIN_STATUS_UPTODATE: case core_plugin_manager::PLUGIN_STATUS_UPTODATE:
$statusclass .= $dependenciesok ? 'badge-light' : 'badge-warning'; $statusclass .= $dependenciesok ? 'bg-light text-dark' : 'bg-warning text-dark';
break; break;
} }
$status = html_writer::span(get_string('status_' . $statuscode, 'core_plugin'), $statusclass); $status = html_writer::span(get_string('status_' . $statuscode, 'core_plugin'), $statusclass);
@ -1263,11 +1264,11 @@ class core_admin_renderer extends plugin_renderer_base {
} }
$out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 0)), $out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 0)),
get_string('plugincheckattention', 'core_plugin')).' '.html_writer::span($sumattention, 'badge badge-light'), get_string('plugincheckattention', 'core_plugin')).' '.html_writer::span($sumattention, 'badge bg-light text-dark'),
'btn btn-link mr-1'); 'btn btn-link mr-1');
$out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 1)), $out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 1)),
get_string('plugincheckall', 'core_plugin')).' '.html_writer::span($sumtotal, 'badge badge-light'), get_string('plugincheckall', 'core_plugin')).' '.html_writer::span($sumtotal, 'badge bg-light text-dark'),
'btn btn-link mr-1'); 'btn btn-link mr-1');
$out .= $this->output->container_end(); // End of .actions container. $out .= $this->output->container_end(); // End of .actions container.
@ -1420,9 +1421,9 @@ class core_admin_renderer extends plugin_renderer_base {
$supportedmoodles = array(); $supportedmoodles = array();
foreach ($plugin->version->supportedmoodles as $moodle) { foreach ($plugin->version->supportedmoodles as $moodle) {
if ($CFG->branch == str_replace('.', '', $moodle->release)) { if ($CFG->branch == str_replace('.', '', $moodle->release)) {
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-success'); $supportedmoodles[] = html_writer::span($moodle->release, 'badge bg-success text-white');
} else { } else {
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-light'); $supportedmoodles[] = html_writer::span($moodle->release, 'badge bg-light text-dark');
} }
} }
@ -1528,7 +1529,7 @@ class core_admin_renderer extends plugin_renderer_base {
$label = ''; $label = '';
} else { } else {
$class = 'requires-failed'; $class = 'requires-failed';
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-danger'); $label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge bg-danger text-white');
} }
if ($branch != null && !$plugin->is_core_compatible_satisfied($branch)) { if ($branch != null && !$plugin->is_core_compatible_satisfied($branch)) {
@ -1557,8 +1558,10 @@ class core_admin_renderer extends plugin_renderer_base {
} else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_MISSING) { } else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_MISSING) {
if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) { if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) {
$label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'badge badge-warning'); $label = html_writer::span(get_string('dependencymissing', 'core_plugin'),
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'badge badge-warning'); 'badge bg-warning text-dark');
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'),
'badge bg-warning text-dark');
$class = 'requires-failed requires-missing requires-available'; $class = 'requires-failed requires-missing requires-available';
$actions[] = html_writer::link( $actions[] = html_writer::link(
new moodle_url('https://moodle.org/plugins/view.php', array('plugin' => $reqname)), new moodle_url('https://moodle.org/plugins/view.php', array('plugin' => $reqname)),
@ -1566,24 +1569,25 @@ class core_admin_renderer extends plugin_renderer_base {
); );
} else { } else {
$label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'badge badge-danger'); $label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'badge bg-danger text-white');
$label .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'), $label .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'),
'badge badge-danger'); 'badge bg-danger text-white');
$class = 'requires-failed requires-missing requires-unavailable'; $class = 'requires-failed requires-missing requires-unavailable';
} }
$displayuploadlink = true; $displayuploadlink = true;
} else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OUTDATED) { } else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OUTDATED) {
if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) { if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) {
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-warning'); $label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge bg-warning text-dark');
$label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'badge badge-warning'); $label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'),
'badge bg-warning text-dark');
$class = 'requires-failed requires-outdated requires-available'; $class = 'requires-failed requires-outdated requires-available';
$displayupdateslink = true; $displayupdateslink = true;
} else { } else {
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-danger'); $label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge bg-danger text-white');
$label .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'), $label .= ' '.html_writer::span(get_string('dependencyunavailable', 'core_plugin'),
'badge badge-danger'); 'badge bg-danger text-white');
$class = 'requires-failed requires-outdated requires-unavailable'; $class = 'requires-failed requires-outdated requires-unavailable';
} }
$displayuploadlink = true; $displayuploadlink = true;
@ -1693,7 +1697,7 @@ class core_admin_renderer extends plugin_renderer_base {
new moodle_url($this->page->url, array('contribonly' => 0, 'updatesonly' => 1)), new moodle_url($this->page->url, array('contribonly' => 0, 'updatesonly' => 1)),
get_string('overviewupdatable', 'core_plugin'), get_string('overviewupdatable', 'core_plugin'),
array('title' => get_string('filterupdatesonly', 'core_plugin')) array('title' => get_string('filterupdatesonly', 'core_plugin'))
).' '.html_writer::span($numupdatable, 'badge badge-info number number-updatable'); ).' '.html_writer::span($numupdatable, 'badge bg-info text-white number number-updatable');
} else { } else {
// No updates, or the notifications disabled. // No updates, or the notifications disabled.
$infoupdatable = ''; $infoupdatable = '';
@ -1868,13 +1872,13 @@ class core_admin_renderer extends plugin_renderer_base {
$source = ''; $source = '';
} else { } else {
$row->attributes['class'] .= ' extension'; $row->attributes['class'] .= ' extension';
$source = html_writer::div(get_string('sourceext', 'core_plugin'), 'source badge badge-info'); $source = html_writer::div(get_string('sourceext', 'core_plugin'), 'source badge bg-info text-white');
} }
if ($status === core_plugin_manager::PLUGIN_STATUS_MISSING) { if ($status === core_plugin_manager::PLUGIN_STATUS_MISSING) {
$msg = html_writer::div(get_string('status_missing', 'core_plugin'), 'statusmsg badge badge-danger'); $msg = html_writer::div(get_string('status_missing', 'core_plugin'), 'statusmsg badge bg-danger text-white');
} else if ($status === core_plugin_manager::PLUGIN_STATUS_NEW) { } else if ($status === core_plugin_manager::PLUGIN_STATUS_NEW) {
$msg = html_writer::div(get_string('status_new', 'core_plugin'), 'statusmsg badge badge-success'); $msg = html_writer::div(get_string('status_new', 'core_plugin'), 'statusmsg badge bg-success text-white');
} else { } else {
$msg = ''; $msg = '';
} }
@ -2113,13 +2117,13 @@ class core_admin_renderer extends plugin_renderer_base {
// Format error or warning line // Format error or warning line
if ($errorline) { if ($errorline) {
$messagetype = 'error'; $messagetype = 'error';
$statusclass = 'badge-danger'; $statusclass = 'bg-danger text-white';
} else if ($warningline) { } else if ($warningline) {
$messagetype = 'warn'; $messagetype = 'warn';
$statusclass = 'badge-warning'; $statusclass = 'bg-warning text-dark';
} else { } else {
$messagetype = 'ok'; $messagetype = 'ok';
$statusclass = 'badge-success'; $statusclass = 'bg-success text-white';
} }
$status = html_writer::span($status, 'badge ' . $statusclass); $status = html_writer::span($status, 'badge ' . $statusclass);
// Here we'll store all the feedback found // Here we'll store all the feedback found

View file

@ -53,7 +53,7 @@
{{ if .Page.Params.tags }} {{ if .Page.Params.tags }}
{{ range .Page.Params.tags }} {{ range .Page.Params.tags }}
<div class="badge badge-info">{{.}}</div> <div class="badge bg-info text-white">{{.}}</div>
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -164,12 +164,12 @@ class data_request_exporter extends persistent_exporter {
switch ($this->persistent->get('status')) { switch ($this->persistent->get('status')) {
case api::DATAREQUEST_STATUS_PENDING: case api::DATAREQUEST_STATUS_PENDING:
case api::DATAREQUEST_STATUS_PREPROCESSING: case api::DATAREQUEST_STATUS_PREPROCESSING:
$values['statuslabelclass'] = 'badge-info'; $values['statuslabelclass'] = 'bg-info text-white';
// Request can be manually completed for general enquiry requests. // Request can be manually completed for general enquiry requests.
$values['canmarkcomplete'] = $requesttype == api::DATAREQUEST_TYPE_OTHERS; $values['canmarkcomplete'] = $requesttype == api::DATAREQUEST_TYPE_OTHERS;
break; break;
case api::DATAREQUEST_STATUS_AWAITING_APPROVAL: case api::DATAREQUEST_STATUS_AWAITING_APPROVAL:
$values['statuslabelclass'] = 'badge-info'; $values['statuslabelclass'] = 'bg-info text-white';
// DPO can review the request once it's ready. // DPO can review the request once it's ready.
$values['canreview'] = true; $values['canreview'] = true;
// Whether the DPO can approve or deny the request. // Whether the DPO can approve or deny the request.
@ -180,24 +180,24 @@ class data_request_exporter extends persistent_exporter {
} }
break; break;
case api::DATAREQUEST_STATUS_APPROVED: case api::DATAREQUEST_STATUS_APPROVED:
$values['statuslabelclass'] = 'badge-info'; $values['statuslabelclass'] = 'bg-info text-white';
break; break;
case api::DATAREQUEST_STATUS_PROCESSING: case api::DATAREQUEST_STATUS_PROCESSING:
$values['statuslabelclass'] = 'badge-info'; $values['statuslabelclass'] = 'bg-info text-white';
break; break;
case api::DATAREQUEST_STATUS_COMPLETE: case api::DATAREQUEST_STATUS_COMPLETE:
case api::DATAREQUEST_STATUS_DOWNLOAD_READY: case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
case api::DATAREQUEST_STATUS_DELETED: case api::DATAREQUEST_STATUS_DELETED:
$values['statuslabelclass'] = 'badge-success'; $values['statuslabelclass'] = 'bg-success text-white';
break; break;
case api::DATAREQUEST_STATUS_CANCELLED: case api::DATAREQUEST_STATUS_CANCELLED:
$values['statuslabelclass'] = 'badge-warning'; $values['statuslabelclass'] = 'bg-warning text-dark';
break; break;
case api::DATAREQUEST_STATUS_REJECTED: case api::DATAREQUEST_STATUS_REJECTED:
$values['statuslabelclass'] = 'badge-danger'; $values['statuslabelclass'] = 'bg-danger text-white';
break; break;
case api::DATAREQUEST_STATUS_EXPIRED: case api::DATAREQUEST_STATUS_EXPIRED:
$values['statuslabelclass'] = 'badge-secondary'; $values['statuslabelclass'] = 'bg-secondary text-dark';
break; break;
} }

View file

@ -106,12 +106,12 @@ class my_data_requests_page implements renderable, templatable {
$cancancel = true; $cancancel = true;
switch ($status) { switch ($status) {
case api::DATAREQUEST_STATUS_COMPLETE: case api::DATAREQUEST_STATUS_COMPLETE:
$item->statuslabelclass = 'badge-success'; $item->statuslabelclass = 'bg-success text-white';
$item->statuslabel = get_string('statuscomplete', 'tool_dataprivacy'); $item->statuslabel = get_string('statuscomplete', 'tool_dataprivacy');
$cancancel = false; $cancancel = false;
break; break;
case api::DATAREQUEST_STATUS_DOWNLOAD_READY: case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
$item->statuslabelclass = 'badge-success'; $item->statuslabelclass = 'bg-success text-white';
$item->statuslabel = get_string('statusready', 'tool_dataprivacy'); $item->statuslabel = get_string('statusready', 'tool_dataprivacy');
$cancancel = false; $cancancel = false;
$candownload = true; $candownload = true;
@ -122,12 +122,12 @@ class my_data_requests_page implements renderable, templatable {
} }
break; break;
case api::DATAREQUEST_STATUS_DELETED: case api::DATAREQUEST_STATUS_DELETED:
$item->statuslabelclass = 'badge-success'; $item->statuslabelclass = 'bg-success text-white';
$item->statuslabel = get_string('statusdeleted', 'tool_dataprivacy'); $item->statuslabel = get_string('statusdeleted', 'tool_dataprivacy');
$cancancel = false; $cancancel = false;
break; break;
case api::DATAREQUEST_STATUS_EXPIRED: case api::DATAREQUEST_STATUS_EXPIRED:
$item->statuslabelclass = 'badge-secondary'; $item->statuslabelclass = 'bg-secondary text-dark';
$item->statuslabel = get_string('statusexpired', 'tool_dataprivacy'); $item->statuslabel = get_string('statusexpired', 'tool_dataprivacy');
$item->statuslabeltitle = get_string('downloadexpireduser', 'tool_dataprivacy'); $item->statuslabeltitle = get_string('downloadexpireduser', 'tool_dataprivacy');
$cancancel = false; $cancancel = false;

View file

@ -59,13 +59,13 @@
<span>{{#pix}}i/risk_xss, moodle, {{#str}}requiresattention, tool_dataprivacy{{/str}}{{/pix}}</span> <span>{{#pix}}i/risk_xss, moodle, {{#str}}requiresattention, tool_dataprivacy{{/str}}{{/pix}}</span>
{{/compliant}} {{/compliant}}
{{#external}} {{#external}}
<span class="badge badge-pill badge-notice">{{#str}}external, tool_dataprivacy{{/str}}</span> <span class="badge rounded-pill bg-info text-white">{{#str}}external, tool_dataprivacy{{/str}}</span>
{{/external}} {{/external}}
{{#deprecated}} {{#deprecated}}
<span class="badge badge-pill badge-warning">{{#str}}deprecated, tool_dataprivacy{{/str}}</span> <span class="badge rounded-pill bg-warning text-dark">{{#str}}deprecated, tool_dataprivacy{{/str}}</span>
{{/deprecated}} {{/deprecated}}
{{#userlistnoncompliance}} {{#userlistnoncompliance}}
<span class="badge badge-pill badge-warning">{{#str}}userlistnoncompliant, tool_dataprivacy{{/str}}</span> <span class="badge rounded-pill bg-warning text-dark">{{#str}}userlistnoncompliant, tool_dataprivacy{{/str}}</span>
{{/userlistnoncompliance}} {{/userlistnoncompliance}}
</div> </div>

View file

@ -43,11 +43,11 @@
<dl> <dl>
<dt>{{#pix}}i/risk_xss, moodle, {{#str}}requiresattention, tool_dataprivacy{{/str}}{{/pix}}</dt> <dt>{{#pix}}i/risk_xss, moodle, {{#str}}requiresattention, tool_dataprivacy{{/str}}{{/pix}}</dt>
<dd>{{#str}}requiresattentionexplanation, tool_dataprivacy{{/str}}</dd> <dd>{{#str}}requiresattentionexplanation, tool_dataprivacy{{/str}}</dd>
<dt><span class="badge badge-pill badge-notice">{{#str}}external, tool_dataprivacy{{/str}}</span></dt> <dt><span class="badge rounded-pill bg-info text-white">{{#str}}external, tool_dataprivacy{{/str}}</span></dt>
<dd>{{#str}}externalexplanation, tool_dataprivacy{{/str}}</dd> <dd>{{#str}}externalexplanation, tool_dataprivacy{{/str}}</dd>
<dt><span class="badge badge-pill badge-warning">{{#str}}deprecated, tool_dataprivacy{{/str}}</span></dt> <dt><span class="badge rounded-pill bg-warning text-dark">{{#str}}deprecated, tool_dataprivacy{{/str}}</span></dt>
<dd>{{#str}}deprecatedexplanation, tool_dataprivacy{{/str}}</dd> <dd>{{#str}}deprecatedexplanation, tool_dataprivacy{{/str}}</dd>
<dt><span class="badge badge-pill badge-warning">{{#str}}userlistnoncompliant, tool_dataprivacy{{/str}}</span></dt> <dt><span class="badge rounded-pill bg-warning text-dark">{{#str}}userlistnoncompliant, tool_dataprivacy{{/str}}</span></dt>
<dd>{{#str}}userlistexplanation, tool_dataprivacy{{/str}}</dd> <dd>{{#str}}userlistexplanation, tool_dataprivacy{{/str}}</dd>
</dl> </dl>
<hr /> <hr />

View file

@ -35,7 +35,7 @@
"id": 1, "id": 1,
"typename" : "Data export", "typename" : "Data export",
"comments": "I would like to download all of my daughter's personal data", "comments": "I would like to download all of my daughter's personal data",
"statuslabelclass": "badge-secondary", "statuslabelclass": "bg-secondary text-dark",
"statuslabel": "Pending", "statuslabel": "Pending",
"timecreated" : 1517902087, "timecreated" : 1517902087,
"requestedbyuser" : { "requestedbyuser" : {
@ -47,7 +47,7 @@
"id": 2, "id": 2,
"typename" : "Data export", "typename" : "Data export",
"comments": "Give me all of the information you have about me, or else...", "comments": "Give me all of the information you have about me, or else...",
"statuslabelclass": "badge-warning", "statuslabelclass": "bg-warning text-dark",
"statuslabel": "Awaiting completion", "statuslabel": "Awaiting completion",
"timecreated" : 1517902087, "timecreated" : 1517902087,
"requestedbyuser" : { "requestedbyuser" : {
@ -59,7 +59,7 @@
"id": 3, "id": 3,
"typename" : "Data deletion", "typename" : "Data deletion",
"comments": "Please delete all of my son's personal data.", "comments": "Please delete all of my son's personal data.",
"statuslabelclass": "badge-success", "statuslabelclass": "bg-success text-white",
"statuslabel": "Deleted", "statuslabel": "Deleted",
"timecreated" : 1517902087, "timecreated" : 1517902087,
"requestedbyuser" : { "requestedbyuser" : {
@ -83,7 +83,7 @@
"id": 5, "id": 5,
"typename" : "Data export", "typename" : "Data export",
"comments": "Please let me download my data", "comments": "Please let me download my data",
"statuslabelclass": "badge-info", "statuslabelclass": "bg-info text-white",
"statuslabel": "Processing", "statuslabel": "Processing",
"timecreated" : 1517902087, "timecreated" : 1517902087,
"requestedbyuser" : { "requestedbyuser" : {

View file

@ -49,7 +49,7 @@
"profileurl": "#" "profileurl": "#"
}, },
"statuslabel": "Pending", "statuslabel": "Pending",
"statuslabelclass": "badge-secondary", "statuslabelclass": "bg-secondary text-dark",
"messagehtml": "<p>Hello,</p><p>I would like to download all of my personal data.</p><p>Thanks!</p>" "messagehtml": "<p>Hello,</p><p>I would like to download all of my personal data.</p><p>Thanks!</p>"
} }
}} }}

View file

@ -82,7 +82,7 @@
{{/comppath}} {{/comppath}}
{{#usercompetencycourse}} {{#usercompetencycourse}}
{{#grade}} {{#grade}}
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}}">{{gradename}}</span> <span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white">{{gradename}}</span>
{{/grade}} {{/grade}}
{{/usercompetencycourse}} {{/usercompetencycourse}}
{{#canmanagecoursecompetencies}} {{#canmanagecoursecompetencies}}

View file

@ -57,7 +57,7 @@
{{/actionuser}} {{/actionuser}}
<strong><time datetime="{{userdate}}">{{userdate}}</time></strong> <strong><time datetime="{{userdate}}">{{userdate}}</time></strong>
{{#grade}} {{#grade}}
<p><span class="badge badge-info">{{gradename}}</span></p> <p><span class="badge bg-info text-white">{{gradename}}</span></p>
{{/grade}} {{/grade}}
<p>{{description}}</p> <p>{{description}}</p>
{{#note}} {{#note}}

View file

@ -57,7 +57,7 @@
</td> </td>
<td> <td>
{{#isbasedontemplate}} {{#isbasedontemplate}}
<span class="badge badge-info">{{#str}}yes{{/str}}</span> <span class="badge bg-info text-white">{{#str}}yes{{/str}}</span>
{{/isbasedontemplate}} {{/isbasedontemplate}}
{{^isbasedontemplate}} {{^isbasedontemplate}}
<span class="badge">{{#str}}no{{/str}}</span> <span class="badge">{{#str}}no{{/str}}</span>

View file

@ -58,7 +58,7 @@
</ul> </ul>
{{/hascourses}} {{/hascourses}}
{{^hascourses}} {{^hascourses}}
<span class="badge badge-info">{{#str}}nolinkedcourses, tool_lp{{/str}}</span> <span class="badge bg-info text-white">{{#str}}nolinkedcourses, tool_lp{{/str}}</span>
{{/hascourses}} {{/hascourses}}
</div> </div>
</div> </div>

View file

@ -57,7 +57,7 @@
</dd> </dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt> <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd> <dd>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left"> <span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}} {{proficiencyname}}
</span> </span>
</dd> </dd>

View file

@ -81,7 +81,7 @@
{{#usercompetencycourse}} {{#usercompetencycourse}}
<dt>{{#str}}proficient, tool_lp{{/str}}</dt> <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd> <dd>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left"> <span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}} {{proficiencyname}}
</span> </span>
</dd> </dd>

View file

@ -68,7 +68,7 @@
</dd> </dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt> <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd> <dd>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left"> <span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}} {{proficiencyname}}
</span> </span>
</dd> </dd>
@ -101,7 +101,7 @@
<dd>{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}</dd> <dd>{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt> <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd> <dd>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left"> <span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}} {{proficiencyname}}
</span> </span>
</dd> </dd>

View file

@ -41,23 +41,24 @@ class renderer extends \plugin_renderer_base {
switch ($state) { switch ($state) {
case factor::STATE_PASS: case factor::STATE_PASS:
return html_writer::tag('span', get_string('state:pass', 'tool_mfa'), ['class' => 'badge badge-success']); return html_writer::tag('span', get_string('state:pass', 'tool_mfa'), ['class' => 'badge bg-success text-white']);
case factor::STATE_FAIL: case factor::STATE_FAIL:
return html_writer::tag('span', get_string('state:fail', 'tool_mfa'), ['class' => 'badge badge-danger']); return html_writer::tag('span', get_string('state:fail', 'tool_mfa'), ['class' => 'badge bg-danger text-white']);
case factor::STATE_NEUTRAL: case factor::STATE_NEUTRAL:
return html_writer::tag('span', get_string('state:neutral', 'tool_mfa'), ['class' => 'badge badge-warning']); return html_writer::tag('span', get_string('state:neutral', 'tool_mfa'),
['class' => 'badge bg-warning text-dark']);
case factor::STATE_UNKNOWN: case factor::STATE_UNKNOWN:
return html_writer::tag('span', get_string('state:unknown', 'tool_mfa'), return html_writer::tag('span', get_string('state:unknown', 'tool_mfa'),
['class' => 'badge badge-secondary']); ['class' => 'badge bg-secondary text-dark']);
case factor::STATE_LOCKED: case factor::STATE_LOCKED:
return html_writer::tag('span', get_string('state:locked', 'tool_mfa'), ['class' => 'badge badge-error']); return html_writer::tag('span', get_string('state:locked', 'tool_mfa'), ['class' => 'badge bg-danger text-white']);
default: default:
return html_writer::tag('span', get_string('pending', 'tool_mfa'), ['class' => 'badge badge-secondary']); return html_writer::tag('span', get_string('pending', 'tool_mfa'), ['class' => 'badge bg-secondary text-dark']);
} }
} }

View file

@ -152,9 +152,9 @@ class page_managedocs_list implements renderable, templatable {
$version->statustext = get_string('status' . $status, 'tool_policy'); $version->statustext = get_string('status' . $status, 'tool_policy');
if ($status == policy_version::STATUS_ACTIVE) { if ($status == policy_version::STATUS_ACTIVE) {
$version->statustext = html_writer::span($version->statustext, 'badge badge-success'); $version->statustext = html_writer::span($version->statustext, 'badge bg-success text-white');
} else if ($status == policy_version::STATUS_DRAFT) { } else if ($status == policy_version::STATUS_DRAFT) {
$version->statustext = html_writer::span($version->statustext, 'badge badge-warning'); $version->statustext = html_writer::span($version->statustext, 'badge bg-warning text-dark');
} else { } else {
$version->statustext = html_writer::span($version->statustext, 'label'); $version->statustext = html_writer::span($version->statustext, 'label');
} }

View file

@ -110,8 +110,8 @@
</td> </td>
<td> <td>
<a href="{{viewurl}}">{{{revision}}}</a> <a href="{{viewurl}}">{{{revision}}}</a>
{{#iscurrent}}<span class="badge badge-success">{{#str}} status1, tool_policy {{/str}}</span>{{/iscurrent}} {{#iscurrent}}<span class="badge bg-success text-white">{{#str}} status1, tool_policy {{/str}}</span>{{/iscurrent}}
{{#isoptional}}<span class="badge badge-info">{{#str}} policydocoptionalyes, tool_policy {{/str}}</span>{{/isoptional}} {{#isoptional}}<span class="badge bg-info text-white">{{#str}} policydocoptionalyes, tool_policy {{/str}}</span>{{/isoptional}}
</td> </td>
<td> <td>
{{>tool_policy/user_agreement}} {{>tool_policy/user_agreement}}

View file

@ -110,9 +110,9 @@ class running_tasks_table extends \table_sql {
*/ */
public function col_type($row) : string { public function col_type($row) : string {
if ($row->type == 'scheduled') { if ($row->type == 'scheduled') {
$output = \html_writer::span(get_string('scheduled', 'tool_task'), 'badge badge-primary'); $output = \html_writer::span(get_string('scheduled', 'tool_task'), 'badge bg-primary text-white');
} else if ($row->type == 'adhoc') { } else if ($row->type == 'adhoc') {
$output = \html_writer::span(get_string('adhoc', 'tool_task'), 'badge badge-dark'); $output = \html_writer::span(get_string('adhoc', 'tool_task'), 'badge bg-dark text-white');
} else { } else {
// This shouldn't ever happen. // This shouldn't ever happen.
$output = ''; $output = '';

View file

@ -468,7 +468,7 @@ class tool_task_renderer extends plugin_renderer_base {
$componentname = $plugininfo->displayname; $componentname = $plugininfo->displayname;
if ($plugininfo->is_enabled() === false) { if ($plugininfo->is_enabled() === false) {
$componentname .= ' ' . html_writer::span( $componentname .= ' ' . html_writer::span(
get_string('disabled', 'tool_task'), 'badge badge-secondary'); get_string('disabled', 'tool_task'), 'badge bg-secondary text-dark');
} }
$componentname .= "\n" . html_writer::span($plugininfo->component, 'task-class text-ltr'); $componentname .= "\n" . html_writer::span($plugininfo->component, 'task-class text-ltr');

View file

@ -436,7 +436,7 @@ M.core_availability.List = function(json, root, parentRoot) {
noneNode.appendChild(deleteIcon.span); noneNode.appendChild(deleteIcon.span);
// Also if it's not the root, none is actually invalid, so add a label. // Also if it's not the root, none is actually invalid, so add a label.
noneNode.appendChild(Y.Node.create('<span class="mt-1 badge badge-warning">' + noneNode.appendChild(Y.Node.create('<span class="mt-1 badge bg-warning text-dark">' +
M.util.get_string('invalid', 'availability') + '</span>')); M.util.get_string('invalid', 'availability') + '</span>'));
} }
@ -1002,7 +1002,7 @@ M.core_availability.Item = function(json, root) {
// Add the invalid marker (empty). // Add the invalid marker (empty).
this.node.appendChild(document.createTextNode(' ')); this.node.appendChild(document.createTextNode(' '));
this.node.appendChild(Y.Node.create('<span class="badge badge-warning"/>')); this.node.appendChild(Y.Node.create('<span class="badge bg-warning text-dark"/>'));
}; };
Y.augment(M.core_availability.Item, Y.EventTarget, true, null, {emitFacade: true}); Y.augment(M.core_availability.Item, Y.EventTarget, true, null, {emitFacade: true});
@ -1039,7 +1039,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
errors.push('core_availability:item_unknowntype'); errors.push('core_availability:item_unknowntype');
} }
// If any errors were added, add the marker to this item. // If any errors were added, add the marker to this item.
var errorLabel = this.node.one('> .badge-warning'); var errorLabel = this.node.one('> .bg-warning');
if (errors.length !== before && !errorLabel.get('firstChild')) { if (errors.length !== before && !errorLabel.get('firstChild')) {
var errorString = ''; var errorString = '';
// Fetch the last error code from the array of errors and split using the ':' delimiter. // Fetch the last error code from the array of errors and split using the ':' delimiter.

File diff suppressed because one or more lines are too long

View file

@ -436,7 +436,7 @@ M.core_availability.List = function(json, root, parentRoot) {
noneNode.appendChild(deleteIcon.span); noneNode.appendChild(deleteIcon.span);
// Also if it's not the root, none is actually invalid, so add a label. // Also if it's not the root, none is actually invalid, so add a label.
noneNode.appendChild(Y.Node.create('<span class="mt-1 badge badge-warning">' + noneNode.appendChild(Y.Node.create('<span class="mt-1 badge bg-warning text-dark">' +
M.util.get_string('invalid', 'availability') + '</span>')); M.util.get_string('invalid', 'availability') + '</span>'));
} }
@ -1002,7 +1002,7 @@ M.core_availability.Item = function(json, root) {
// Add the invalid marker (empty). // Add the invalid marker (empty).
this.node.appendChild(document.createTextNode(' ')); this.node.appendChild(document.createTextNode(' '));
this.node.appendChild(Y.Node.create('<span class="badge badge-warning"/>')); this.node.appendChild(Y.Node.create('<span class="badge bg-warning text-dark"/>'));
}; };
Y.augment(M.core_availability.Item, Y.EventTarget, true, null, {emitFacade: true}); Y.augment(M.core_availability.Item, Y.EventTarget, true, null, {emitFacade: true});
@ -1039,7 +1039,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
errors.push('core_availability:item_unknowntype'); errors.push('core_availability:item_unknowntype');
} }
// If any errors were added, add the marker to this item. // If any errors were added, add the marker to this item.
var errorLabel = this.node.one('> .badge-warning'); var errorLabel = this.node.one('> .bg-warning');
if (errors.length !== before && !errorLabel.get('firstChild')) { if (errors.length !== before && !errorLabel.get('firstChild')) {
var errorString = ''; var errorString = '';
// Fetch the last error code from the array of errors and split using the ':' delimiter. // Fetch the last error code from the array of errors and split using the ':' delimiter.

View file

@ -434,7 +434,7 @@ M.core_availability.List = function(json, root, parentRoot) {
noneNode.appendChild(deleteIcon.span); noneNode.appendChild(deleteIcon.span);
// Also if it's not the root, none is actually invalid, so add a label. // Also if it's not the root, none is actually invalid, so add a label.
noneNode.appendChild(Y.Node.create('<span class="mt-1 badge badge-warning">' + noneNode.appendChild(Y.Node.create('<span class="mt-1 badge bg-warning text-dark">' +
M.util.get_string('invalid', 'availability') + '</span>')); M.util.get_string('invalid', 'availability') + '</span>'));
} }
@ -1000,7 +1000,7 @@ M.core_availability.Item = function(json, root) {
// Add the invalid marker (empty). // Add the invalid marker (empty).
this.node.appendChild(document.createTextNode(' ')); this.node.appendChild(document.createTextNode(' '));
this.node.appendChild(Y.Node.create('<span class="badge badge-warning"/>')); this.node.appendChild(Y.Node.create('<span class="badge bg-warning text-dark"/>'));
}; };
Y.augment(M.core_availability.Item, Y.EventTarget, true, null, {emitFacade: true}); Y.augment(M.core_availability.Item, Y.EventTarget, true, null, {emitFacade: true});
@ -1037,7 +1037,7 @@ M.core_availability.Item.prototype.fillErrors = function(errors) {
errors.push('core_availability:item_unknowntype'); errors.push('core_availability:item_unknowntype');
} }
// If any errors were added, add the marker to this item. // If any errors were added, add the marker to this item.
var errorLabel = this.node.one('> .badge-warning'); var errorLabel = this.node.one('> .bg-warning');
if (errors.length !== before && !errorLabel.get('firstChild')) { if (errors.length !== before && !errorLabel.get('firstChild')) {
var errorString = ''; var errorString = '';
// Fetch the last error code from the array of errors and split using the ':' delimiter. // Fetch the last error code from the array of errors and split using the ':' delimiter.

View file

@ -80,7 +80,7 @@
{{/showcoursecategory}} {{/showcoursecategory}}
{{^visible}} {{^visible}}
<div class="d-flex flex-wrap"> <div class="d-flex flex-wrap">
<span class="badge badge-info">{{#str}} hiddenfromstudents {{/str}}</span> <span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
</div> </div>
{{/visible}} {{/visible}}
{{#hasprogress}} {{#hasprogress}}

View file

@ -82,7 +82,7 @@
{{/coursecategory}} {{/coursecategory}}
{{^visible}} {{^visible}}
<div class="d-flex flex-wrap"> <div class="d-flex flex-wrap">
<span class="badge badge-info">{{#str}} hiddenfromstudents {{/str}}</span> <span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
</div> </div>
{{/visible}} {{/visible}}
<div class="summary"> <div class="summary">

View file

@ -61,7 +61,7 @@ class block_site_main_menu extends block_list {
$controlmenuclass = $format->get_output_classname('content\\cm\\controlmenu'); $controlmenuclass = $format->get_output_classname('content\\cm\\controlmenu');
$badgeattributes = [ $badgeattributes = [
'class' => 'badge badge-pill badge-warning mt-2', 'class' => 'badge rounded-pill bg-warning text-dark mt-2',
'data-region' => 'visibility' 'data-region' => 'visibility'
]; ];

View file

@ -62,7 +62,7 @@ class block_social_activities extends block_list {
$controlmenuclass = $format->get_output_classname('content\\cm\\controlmenu'); $controlmenuclass = $format->get_output_classname('content\\cm\\controlmenu');
$badgeattributes = [ $badgeattributes = [
'class' => 'badge badge-pill badge-warning mt-2', 'class' => 'badge rounded-pill bg-warning text-dark mt-2',
'data-region' => 'visibility' 'data-region' => 'visibility'
]; ];

View file

@ -67,7 +67,7 @@
<div class="event-name-container flex-grow-1 line-height-3 nowrap text-truncate"> <div class="event-name-container flex-grow-1 line-height-3 nowrap text-truncate">
<div class="d-flex"> <div class="d-flex">
<h6 class="event-name mb-0 pb-1 text-truncate"> <h6 class="event-name mb-0 pb-1 text-truncate">
{{#overdue}}<span class="badge badge-pill badge-danger ml-1 float-right">{{#str}} overdue, block_timeline {{/str}}</span>{{/overdue}} {{#overdue}}<span class="badge rounded-pill bg-danger text-white ml-1 float-right">{{#str}} overdue, block_timeline {{/str}}</span>{{/overdue}}
<a href="{{url}}" <a href="{{url}}"
title="{{name}}" title="{{name}}"
aria-label='{{#cleanstr}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/cleanstr}}'> aria-label='{{#cleanstr}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/cleanstr}}'>
@ -93,7 +93,7 @@
title="{{action.name}}"> title="{{action.name}}">
{{{action.name}}} {{{action.name}}}
{{#action.showitemcount}} {{#action.showitemcount}}
<span class="badge badge-secondary">{{action.itemcount}}</span> <span class="badge bg-secondary text-dark">{{action.itemcount}}</span>
{{/action.showitemcount}} {{/action.showitemcount}}
</a> </a>
</h6> </h6>

View file

@ -37,10 +37,10 @@ abstract class activitybadge implements named_templatable, \renderable {
/** @var array Badge defined styles. */ /** @var array Badge defined styles. */
public const STYLES = [ public const STYLES = [
'none' => 'badge-none', 'none' => 'badge-none',
'dark' => 'badge-dark', 'dark' => 'bg-dark text-white',
'danger' => 'badge-danger', 'danger' => 'bg-danger text-white',
'warning' => 'badge-warning', 'warning' => 'bg-warning text-dark',
'info' => 'badge-info', 'info' => 'bg-info text-white',
]; ];
/** @var cm_info The course module information. */ /** @var cm_info The course module information. */

View file

@ -25,9 +25,9 @@
"displayvalue" : "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Activity example</span></a>" "displayvalue" : "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Activity example</span></a>"
}, },
"hasname": "true", "hasname": "true",
"afterlink": "<span class=\"badge badge-primary\">30 unread messages</span>", "afterlink": "<span class=\"badge bg-primary\">30 unread messages</span>",
"hasextras": true, "hasextras": true,
"extras": ["<span class=\"badge badge-secondary\">[extras]</span>"], "extras": ["<span class=\"badge bg-secondary\">[extras]</span>"],
"activityinfo": { "activityinfo": {
"hasmodavailability": true, "hasmodavailability": true,
"activityname": "Activity example", "activityname": "Activity example",

View file

@ -43,7 +43,7 @@
] ]
}, },
"hasextras": true, "hasextras": true,
"extras": ["<span class=\"badge badge-secondary\">[extras]</span>"], "extras": ["<span class=\"badge bg-secondary\">[extras]</span>"],
"activityinfo": { "activityinfo": {
"hasmodavailability": true, "hasmodavailability": true,
"activityname": "Activity example", "activityname": "Activity example",

View file

@ -44,7 +44,7 @@
class="ml-1" class="ml-1"
{{#badgeextraattributes}} {{name}}="{{value}}" {{/badgeextraattributes}} {{#badgeextraattributes}} {{name}}="{{value}}" {{/badgeextraattributes}}
> >
<span class="activitybadge badge badge-pill {{badgestyle}}"> <span class="activitybadge badge rounded-pill {{badgestyle}}">
{{#badgeurl}} {{#badgeurl}}
<a href="{{.}}">{{badgecontent}}</a> <a href="{{.}}">{{badgecontent}}</a>
{{/badgeurl}} {{/badgeurl}}

View file

@ -38,7 +38,7 @@
{{#info}} {{#info}}
<div class="activity-availability availabilityinfo {{classes}}" data-region="availabilityinfo"> <div class="activity-availability availabilityinfo {{classes}}" data-region="availabilityinfo">
{{^isrestricted}} {{^isrestricted}}
<span class="badge badge-pill badge-warning">{{{text}}}</span> <span class="badge rounded-pill bg-warning text-dark">{{{text}}}</span>
{{/isrestricted}} {{/isrestricted}}
{{#isrestricted}} {{#isrestricted}}
{{> core_courseformat/local/content/availability }} {{> core_courseformat/local/content/availability }}

View file

@ -67,7 +67,7 @@
<div class="activity-badges my-1" data-region="visibility"> <div class="activity-badges my-1" data-region="visibility">
{{#dropwdown}} {{#dropwdown}}
{{< core/local/dropdown/status}} {{< core/local/dropdown/status}}
{{$ buttonclasses }} badge badge-pill badge-secondary dropdown-toggle border-0 {{/ buttonclasses }} {{$ buttonclasses }} badge rounded-pill bg-secondary text-dark dropdown-toggle border-0 {{/ buttonclasses }}
{{/ core/local/dropdown/status}} {{/ core/local/dropdown/status}}
{{/dropwdown}} {{/dropwdown}}
</div> </div>
@ -75,12 +75,12 @@
{{^isInteractive}} {{^isInteractive}}
{{#modhiddenfromstudents}} {{#modhiddenfromstudents}}
<div class="activity-badges my-1 d-flex align-self-start align-items-center" data-region="visibility"> <div class="activity-badges my-1 d-flex align-self-start align-items-center" data-region="visibility">
<span class="badge badge-pill badge-secondary">{{#pix}}i/show, core{{/pix}}{{#str}}hiddenfromstudents{{/str}}</span> <span class="badge rounded-pill bg-secondary text-dark">{{#pix}}i/show, core{{/pix}}{{#str}}hiddenfromstudents{{/str}}</span>
</div> </div>
{{/modhiddenfromstudents}} {{/modhiddenfromstudents}}
{{#modstealth}} {{#modstealth}}
<div class="activity-badges my-1 d-flex align-self-start align-items-center" data-region="visibility"> <div class="activity-badges my-1 d-flex align-self-start align-items-center" data-region="visibility">
<span class="badge badge-pill badge-secondary">{{#pix}}t/stealth, core{{/pix}}{{#str}}hiddenoncoursepage{{/str}}</span> <span class="badge rounded-pill bg-secondary text-dark">{{#pix}}t/stealth, core{{/pix}}{{#str}}hiddenoncoursepage{{/str}}</span>
</div> </div>
{{/modstealth}} {{/modstealth}}
{{/isInteractive}} {{/isInteractive}}

View file

@ -66,7 +66,7 @@
"iscurrent": true, "iscurrent": true,
"currentlink": "<span class=\"accesshide\">This topic</span>", "currentlink": "<span class=\"accesshide\">This topic</span>",
"availability": { "availability": {
"info": "<span class=\"badge badge-info\">Hidden from students</span>", "info": "<span class=\"badge bg-info\">Hidden from students</span>",
"hasavailability": true "hasavailability": true
}, },
"summary": { "summary": {

View file

@ -38,7 +38,7 @@
{{#info}} {{#info}}
<div class="availabilityinfo {{classes}}" data-region="availabilityinfo"> <div class="availabilityinfo {{classes}}" data-region="availabilityinfo">
{{^isrestricted}} {{^isrestricted}}
<span class="badge badge-pill badge-warning">{{{text}}}</span> <span class="badge rounded-pill bg-warning text-dark">{{{text}}}</span>
{{/isrestricted}} {{/isrestricted}}
{{#isrestricted}} {{#isrestricted}}
{{> core_courseformat/local/content/availability }} {{> core_courseformat/local/content/availability }}

View file

@ -30,24 +30,24 @@
} }
}} }}
{{#editing}} {{#editing}}
<span class="badge badge-pill badge-primary order-1 {{^iscurrent}}d-none{{/iscurrent}}" data-type="iscurrent"> <span class="badge rounded-pill bg-primary text-white order-1 {{^iscurrent}}d-none{{/iscurrent}}" data-type="iscurrent">
{{ highlightedlabel }} {{ highlightedlabel }}
</span> </span>
<span class="badge badge-pill badge-warning order-2 {{^hiddenfromstudents}}d-none{{/hiddenfromstudents}}" data-type="hiddenfromstudents"> <span class="badge rounded-pill bg-warning text-dark order-2 {{^hiddenfromstudents}}d-none{{/hiddenfromstudents}}" data-type="hiddenfromstudents">
{{#str}}hiddenfromstudents{{/str}} {{#str}}hiddenfromstudents{{/str}}
</span> </span>
<span class="badge badge-pill badge-secondary order-3 {{^notavailable}}d-none{{/notavailable}}"> <span class="badge rounded-pill bg-secondary text-dark order-3 {{^notavailable}}d-none{{/notavailable}}">
{{#str}}notavailable{{/str}} {{#str}}notavailable{{/str}}
</span> </span>
{{/editing}} {{/editing}}
{{^editing}} {{^editing}}
{{#iscurrent}} {{#iscurrent}}
<span class="badge badge-pill badge-primary order-1">{{ highlightedlabel }}</span> <span class="badge rounded-pill bg-primary text-white order-1">{{ highlightedlabel }}</span>
{{/iscurrent}} {{/iscurrent}}
{{#hiddenfromstudents}} {{#hiddenfromstudents}}
<span class="badge badge-pill badge-warning order-2">{{#str}}hiddenfromstudents{{/str}}</span> <span class="badge rounded-pill bg-warning text-dark order-2">{{#str}}hiddenfromstudents{{/str}}</span>
{{/hiddenfromstudents}} {{/hiddenfromstudents}}
{{#notavailable}} {{#notavailable}}
<span class="badge badge-pill badge-secondary order-3">{{#str}}notavailable{{/str}}</span> <span class="badge rounded-pill bg-secondary text-dark order-3">{{#str}}notavailable{{/str}}</span>
{{/notavailable}} {{/notavailable}}
{{/editing}} {{/editing}}

View file

@ -26,10 +26,10 @@
"hasname": "true", "hasname": "true",
"moveicon": "<i>[Move]</i>", "moveicon": "<i>[Move]</i>",
"indent": 2, "indent": 2,
"afterlink": "<span class=\"badge badge-primary\">30 unread messages</span>", "afterlink": "<span class=\"badge bg-primary\">30 unread messages</span>",
"hasextras": true, "hasextras": true,
"extras": ["<span class=\"badge badge-secondary\">[extras]</span>"], "extras": ["<span class=\"badge bg-secondary\">[extras]</span>"],
"completion": "<span class=\"badge badge-success\">Completed!</span>" "completion": "<span class=\"badge bg-success\">Completed!</span>"
}, },
"id": 3, "id": 3,
"anchor": "module-3", "anchor": "module-3",

View file

@ -65,7 +65,7 @@
"iscurrent": true, "iscurrent": true,
"currentlink": "<span class=\"accesshide\">This topic</span>", "currentlink": "<span class=\"accesshide\">This topic</span>",
"availability": { "availability": {
"info": "<span class=\"badge badge-info\">Hidden from students</span>", "info": "<span class=\"badge bg-info\">Hidden from students</span>",
"hasavailability": true "hasavailability": true
}, },
"summary": { "summary": {

View file

@ -98,7 +98,7 @@
> >
{{{title}}} {{{title}}}
</a> </a>
<span class="current-badge badge badge-primary ml-2 px-2 rounded-pill"> <span class="current-badge badge bg-primary text-white ml-2 px-2 rounded-pill">
{{highlighted}} {{highlighted}}
</span> </span>
<span class="courseindex-locked ml-1" data-for="cm_name"> <span class="courseindex-locked ml-1" data-for="cm_name">

View file

@ -64,7 +64,7 @@ class activitybadge_test extends \advanced_testcase {
// The activitybadge for a forum with unread messages shouldn't be empty. // The activitybadge for a forum with unread messages shouldn't be empty.
$class = activitybadge::create_instance($data->forumunread); $class = activitybadge::create_instance($data->forumunread);
$result = $class->export_for_template($renderer); $result = $class->export_for_template($renderer);
$this->check_activitybadge($result, '1 unread post', 'badge-dark'); $this->check_activitybadge($result, '1 unread post', 'bg-dark text-white');
// The activitybadge for a forum without unread messages should be empty. // The activitybadge for a forum without unread messages should be empty.
$class = activitybadge::create_instance($data->forumread); $class = activitybadge::create_instance($data->forumread);

View file

@ -29,7 +29,7 @@
}} }}
{{#istrackeduser}} {{#istrackeduser}}
{{#statuscomplete}} {{#statuscomplete}}
<div class="badge badge-pill alert-success icon-no-margin" role="listitem" {{! <div class="badge rounded-pill alert-success icon-no-margin" role="listitem" {{!
}}{{#accessibledescription}}{{! }}{{#accessibledescription}}{{!
}}title="{{.}}" {{! }}title="{{.}}" {{!
}}aria-label="{{.}}" {{! }}aria-label="{{.}}" {{!
@ -39,7 +39,7 @@
</div> </div>
{{/statuscomplete}} {{/statuscomplete}}
{{#statuscompletefail}} {{#statuscompletefail}}
<div class="badge badge-pill alert-danger icon-no-margin" role="listitem" {{! <div class="badge rounded-pill alert-danger icon-no-margin" role="listitem" {{!
}}{{#accessibledescription}}{{! }}{{#accessibledescription}}{{!
}}title="{{.}}" {{! }}title="{{.}}" {{!
}}aria-label="{{.}}" {{! }}aria-label="{{.}}" {{!
@ -49,7 +49,7 @@
</div> </div>
{{/statuscompletefail}} {{/statuscompletefail}}
{{#statusincomplete}} {{#statusincomplete}}
<div class="badge badge-pill badge-light" role="listitem" {{! <div class="badge rounded-pill bg-light text-dark" role="listitem" {{!
}}{{#accessibledescription}}{{! }}{{#accessibledescription}}{{!
}}title="{{.}}" {{! }}title="{{.}}" {{!
}}aria-label="{{.}}" {{! }}aria-label="{{.}}" {{!
@ -59,7 +59,7 @@
{{/statusincomplete}} {{/statusincomplete}}
{{/istrackeduser}} {{/istrackeduser}}
{{^istrackeduser}} {{^istrackeduser}}
<div class="badge badge-pill badge-light" role="listitem"> <div class="badge rounded-pill bg-light text-dark" role="listitem">
<span class="font-weight-normal">{{description}}</span> <span class="font-weight-normal">{{description}}</span>
</div> </div>
{{/istrackeduser}} {{/istrackeduser}}

View file

@ -67,7 +67,7 @@
</div> </div>
{{^visible}} {{^visible}}
<div class="d-flex flex-wrap"> <div class="d-flex flex-wrap">
<span class="badge badge-info">{{#str}} hiddenfromstudents {{/str}}</span> <span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
</div> </div>
{{/visible}} {{/visible}}
</div> </div>

View file

@ -1178,7 +1178,7 @@ class externallib_test extends externallib_advanced_testcase {
// Afterlink for forums has been removed; it has been moved to the new activity badge content. // Afterlink for forums has been removed; it has been moved to the new activity badge content.
$this->assertEmpty($module['afterlink']); $this->assertEmpty($module['afterlink']);
$this->assertEquals('1 unread post', $module['activitybadge']['badgecontent']); $this->assertEquals('1 unread post', $module['activitybadge']['badgecontent']);
$this->assertEquals('badge-dark', $module['activitybadge']['badgestyle']); $this->assertEquals('bg-dark text-white', $module['activitybadge']['badgestyle']);
$this->assertEquals( $this->assertEquals(
plugin_supports( plugin_supports(
'mod', 'mod',

View file

@ -81,10 +81,10 @@
</td> </td>
<td> <td>
{{#isactive}} {{#isactive}}
<span class="badge badge-success">{{{statusstring}}}</span> <span class="badge bg-success text-white">{{{statusstring}}}</span>
{{/isactive}} {{/isactive}}
{{^isactive}} {{^isactive}}
<span class="badge badge-info">{{{statusstring}}}</span> <span class="badge bg-info text-white">{{{statusstring}}}</span>
{{/isactive}} {{/isactive}}
</td> </td>
<td> <td>

View file

@ -26,7 +26,7 @@
$string['aria:dropdowncolumns'] = 'Collapsed columns found'; $string['aria:dropdowncolumns'] = 'Collapsed columns found';
$string['clearall'] = 'Clear all'; $string['clearall'] = 'Clear all';
$string['clearsearch'] = 'Clear searched users'; $string['clearsearch'] = 'Clear searched users';
$string['collapsedcolumns'] = 'Collapsed columns <span class="badge badge-pill badge-primary ml-1" data-collapse="count">{$a}</span>'; $string['collapsedcolumns'] = 'Collapsed columns <span class="badge rounded-pill bg-primary text-white ml-1" data-collapse="count">{$a}</span>';
$string['editingmode_title'] = 'Editing the grader report'; $string['editingmode_title'] = 'Editing the grader report';
$string['eventgradereportviewed'] = 'Grader report viewed'; $string['eventgradereportviewed'] = 'Grader report viewed';
$string['grader:manage'] = 'Manage the grader report'; $string['grader:manage'] = 'Manage the grader report';

View file

@ -30,32 +30,32 @@
}} }}
<div class="card-deck" role="list"> <div class="card-deck" role="list">
{{#calculatedgrade}} {{#calculatedgrade}}
<span class="badge badge-pill badge-light" role="listitem"> <span class="badge rounded-pill bg-light text-dark" role="listitem">
<strong>{{calculatedgrade}}</strong> <strong>{{calculatedgrade}}</strong>
</span> </span>
{{/calculatedgrade}} {{/calculatedgrade}}
{{#aggregation}} {{#aggregation}}
<span class="badge badge-pill badge-light" role="listitem"> <span class="badge rounded-pill bg-light text-dark" role="listitem">
<strong>{{aggregation}}</strong> <strong>{{aggregation}}</strong>
</span> </span>
{{/aggregation}} {{/aggregation}}
{{#aggregateonlygraded}} {{#aggregateonlygraded}}
<span class="badge badge-pill badge-light" role="listitem"> <span class="badge rounded-pill bg-light text-dark" role="listitem">
<strong>{{#str}}aggregateonlygraded, grades{{/str}}</strong> <strong>{{#str}}aggregateonlygraded, grades{{/str}}</strong>
</span> </span>
{{/aggregateonlygraded}} {{/aggregateonlygraded}}
{{#aggregateoutcomes}} {{#aggregateoutcomes}}
<span class="badge badge-pill badge-light" role="listitem"> <span class="badge rounded-pill bg-light text-dark" role="listitem">
<strong>{{#str}}aggregateoutcomes, grades{{/str}}</strong> <strong>{{#str}}aggregateoutcomes, grades{{/str}}</strong>
</span> </span>
{{/aggregateoutcomes}} {{/aggregateoutcomes}}
{{#droplow}} {{#droplow}}
<span class="badge badge-pill badge-light" role="listitem"> <span class="badge rounded-pill bg-light text-dark" role="listitem">
<strong>{{#str}}droplowestvalues, grades, {{droplow}}{{/str}}</strong> <strong>{{#str}}droplowestvalues, grades, {{droplow}}{{/str}}</strong>
</span> </span>
{{/droplow}} {{/droplow}}
{{#keephigh}} {{#keephigh}}
<span class="badge badge-pill badge-light" role="listitem"> <span class="badge rounded-pill bg-light text-dark" role="listitem">
<strong>{{#str}}keephigh, grades{{/str}}</strong> <strong>{{#str}}keephigh, grades{{/str}}</strong>
</span> </span>
{{/keephigh}} {{/keephigh}}

View file

@ -302,10 +302,10 @@ class helper {
string $statusaction = ''): array { string $statusaction = ''): array {
$statusclasses = array( $statusclasses = array(
TEXTFILTER_DISABLED => 'badge badge-danger', TEXTFILTER_DISABLED => 'badge bg-danger text-white',
TEXTFILTER_OFF => 'badge badge-warning', TEXTFILTER_OFF => 'badge bg-warning text-dark',
0 => 'badge badge-danger', 0 => 'badge bg-danger text-white',
TEXTFILTER_ON => 'badge badge-success', TEXTFILTER_ON => 'badge bg-success text-white',
); );
$statuschoices = array( $statuschoices = array(

View file

@ -25,7 +25,7 @@
"tool_description": "h5ptasks_description", "tool_description": "h5ptasks_description",
"link": "https://example.com/admin/tool/task/scheduledtasks.php", "link": "https://example.com/admin/tool/task/scheduledtasks.php",
"status": "On", "status": "On",
"status_class": "bade badge-success", "status_class": "bade bg-success text-white",
"status_action": "<a href=\"admin/tool/task/schedule_task.php?task=core_task_h5p_get_content_types_task\">Run now</a>" "status_action": "<a href=\"admin/tool/task/schedule_task.php?task=core_task_h5p_get_content_types_task\">Run now</a>"
}, },
{ {
@ -33,7 +33,7 @@
"tool_description": "h5ptasks_description", "tool_description": "h5ptasks_description",
"link": "https://example.com/admin/filters.php", "link": "https://example.com/admin/filters.php",
"status": "Off", "status": "Off",
"status_class": "bade badge-danger" "status_class": "bade bg-danger text-white"
} }
] ]
} }

View file

@ -10034,7 +10034,7 @@ class admin_setting_webservicesoverview extends admin_setting {
$url = new moodle_url("/admin/search.php?query=enablewebservices"); $url = new moodle_url("/admin/search.php?query=enablewebservices");
$row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'), $row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
if ($CFG->enablewebservices) { if ($CFG->enablewebservices) {
$status = get_string('yes'); $status = get_string('yes');
} }
@ -10047,7 +10047,7 @@ class admin_setting_webservicesoverview extends admin_setting {
$url = new moodle_url("/admin/settings.php?section=webserviceprotocols"); $url = new moodle_url("/admin/settings.php?section=webserviceprotocols");
$row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'), $row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('none'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('none'), array('class' => 'badge bg-danger text-white'));
//retrieve activated protocol //retrieve activated protocol
$active_protocols = empty($CFG->webserviceprotocols) ? $active_protocols = empty($CFG->webserviceprotocols) ?
array() : explode(',', $CFG->webserviceprotocols); array() : explode(',', $CFG->webserviceprotocols);
@ -10158,7 +10158,7 @@ class admin_setting_webservicesoverview extends admin_setting {
$url = new moodle_url("/admin/search.php?query=enablewebservices"); $url = new moodle_url("/admin/search.php?query=enablewebservices");
$row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'), $row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
if ($CFG->enablewebservices) { if ($CFG->enablewebservices) {
$status = get_string('yes'); $status = get_string('yes');
} }
@ -10171,7 +10171,7 @@ class admin_setting_webservicesoverview extends admin_setting {
$url = new moodle_url("/admin/settings.php?section=webserviceprotocols"); $url = new moodle_url("/admin/settings.php?section=webserviceprotocols");
$row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'), $row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('none'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('none'), array('class' => 'badge bg-danger text-white'));
//retrieve activated protocol //retrieve activated protocol
$active_protocols = empty($CFG->webserviceprotocols) ? $active_protocols = empty($CFG->webserviceprotocols) ?
array() : explode(',', $CFG->webserviceprotocols); array() : explode(',', $CFG->webserviceprotocols);
@ -11201,10 +11201,10 @@ class admin_setting_searchsetupinfo extends admin_setting {
$row[0] = '1. ' . html_writer::tag('a', get_string('selectsearchengine', 'admin'), $row[0] = '1. ' . html_writer::tag('a', get_string('selectsearchengine', 'admin'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
if (!empty($CFG->searchengine)) { if (!empty($CFG->searchengine)) {
$status = html_writer::tag('span', get_string('pluginname', 'search_' . $CFG->searchengine), $status = html_writer::tag('span', get_string('pluginname', 'search_' . $CFG->searchengine),
array('class' => 'badge badge-success')); array('class' => 'badge bg-success text-white'));
} }
$row[1] = $status; $row[1] = $status;
@ -11216,9 +11216,9 @@ class admin_setting_searchsetupinfo extends admin_setting {
$row[0] = '2. ' . html_writer::tag('a', get_string('enablesearchareas', 'admin'), $row[0] = '2. ' . html_writer::tag('a', get_string('enablesearchareas', 'admin'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
if ($anyenabled) { if ($anyenabled) {
$status = html_writer::tag('span', get_string('yes'), array('class' => 'badge badge-success')); $status = html_writer::tag('span', get_string('yes'), array('class' => 'badge bg-success text-white'));
} }
$row[1] = $status; $row[1] = $status;
@ -11228,7 +11228,7 @@ class admin_setting_searchsetupinfo extends admin_setting {
$row = array(); $row = array();
if (empty($CFG->searchengine)) { if (empty($CFG->searchengine)) {
$row[0] = '3. ' . get_string('setupsearchengine', 'admin'); $row[0] = '3. ' . get_string('setupsearchengine', 'admin');
$row[1] = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $row[1] = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
} else { } else {
if ($ADMIN->locate('search' . $CFG->searchengine)) { if ($ADMIN->locate('search' . $CFG->searchengine)) {
$url = new moodle_url('/admin/settings.php?section=search' . $CFG->searchengine); $url = new moodle_url('/admin/settings.php?section=search' . $CFG->searchengine);
@ -11245,9 +11245,9 @@ class admin_setting_searchsetupinfo extends admin_setting {
$serverstatus = $e->getMessage(); $serverstatus = $e->getMessage();
} }
if ($serverstatus === true) { if ($serverstatus === true) {
$status = html_writer::tag('span', get_string('yes'), array('class' => 'badge badge-success')); $status = html_writer::tag('span', get_string('yes'), array('class' => 'badge bg-success text-white'));
} else { } else {
$status = html_writer::tag('span', $serverstatus, array('class' => 'badge badge-danger')); $status = html_writer::tag('span', $serverstatus, array('class' => 'badge bg-danger text-white'));
} }
$row[1] = $status; $row[1] = $status;
} }
@ -11258,9 +11258,9 @@ class admin_setting_searchsetupinfo extends admin_setting {
$url = new moodle_url('/admin/searchareas.php'); $url = new moodle_url('/admin/searchareas.php');
$row[0] = '4. ' . html_writer::tag('a', get_string('indexdata', 'admin'), array('href' => $url)); $row[0] = '4. ' . html_writer::tag('a', get_string('indexdata', 'admin'), array('href' => $url));
if ($anyindexed) { if ($anyindexed) {
$status = html_writer::tag('span', get_string('yes'), array('class' => 'badge badge-success')); $status = html_writer::tag('span', get_string('yes'), array('class' => 'badge bg-success text-white'));
} else { } else {
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
} }
$row[1] = $status; $row[1] = $status;
$table->data[] = $row; $table->data[] = $row;
@ -11270,9 +11270,9 @@ class admin_setting_searchsetupinfo extends admin_setting {
$url = new moodle_url("/admin/search.php?query=enableglobalsearch"); $url = new moodle_url("/admin/search.php?query=enableglobalsearch");
$row[0] = '5. ' . html_writer::tag('a', get_string('enableglobalsearch', 'admin'), $row[0] = '5. ' . html_writer::tag('a', get_string('enableglobalsearch', 'admin'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
if (\core_search\manager::is_global_search_enabled()) { if (\core_search\manager::is_global_search_enabled()) {
$status = html_writer::tag('span', get_string('yes'), array('class' => 'badge badge-success')); $status = html_writer::tag('span', get_string('yes'), array('class' => 'badge bg-success text-white'));
} }
$row[1] = $status; $row[1] = $status;
$table->data[] = $row; $table->data[] = $row;
@ -11282,9 +11282,9 @@ class admin_setting_searchsetupinfo extends admin_setting {
$url = new moodle_url("/admin/search.php?query=searchincludeallcourses"); $url = new moodle_url("/admin/search.php?query=searchincludeallcourses");
$row[0] = '6. ' . html_writer::tag('a', get_string('replacefrontsearch', 'admin'), $row[0] = '6. ' . html_writer::tag('a', get_string('replacefrontsearch', 'admin'),
array('href' => $url)); array('href' => $url));
$status = html_writer::tag('span', get_string('no'), array('class' => 'badge badge-danger')); $status = html_writer::tag('span', get_string('no'), array('class' => 'badge bg-danger text-white'));
if (\core_search\manager::can_replace_course_search()) { if (\core_search\manager::can_replace_course_search()) {
$status = html_writer::tag('span', get_string('yes'), array('class' => 'badge badge-success')); $status = html_writer::tag('span', get_string('yes'), array('class' => 'badge bg-success text-white'));
} }
$row[1] = $status; $row[1] = $status;
$table->data[] = $row; $table->data[] = $row;

View file

@ -180,11 +180,11 @@ class share_progress_table extends table_sql {
protected function col_status(stdClass $row): string { protected function col_status(stdClass $row): string {
// Display a badge indicating the status of the share. // Display a badge indicating the status of the share.
if ($row->status == share_recorder::STATUS_IN_PROGRESS) { if ($row->status == share_recorder::STATUS_IN_PROGRESS) {
$status = html_writer::span(get_string('inprogress'), 'badge badge-warning'); $status = html_writer::span(get_string('inprogress'), 'badge bg-warning text-dark');
} else if ($row->status == share_recorder::STATUS_SENT) { } else if ($row->status == share_recorder::STATUS_SENT) {
$status = html_writer::span(get_string('sent'), 'badge badge-success'); $status = html_writer::span(get_string('sent'), 'badge bg-success text-white');
} else if ($row->status == share_recorder::STATUS_ERROR) { } else if ($row->status == share_recorder::STATUS_ERROR) {
$status = html_writer::span(get_string('error'), 'badge badge-danger'); $status = html_writer::span(get_string('error'), 'badge bg-danger text-white');
} }
return $status; return $status;

View file

@ -1815,7 +1815,7 @@ function print_object($item, array $expandclasses = ['/./'], bool $textonly = fa
$out .= '[' . get_class($item) . ']'; $out .= '[' . get_class($item) . ']';
} else { } else {
// Objects display the class name as a badge. Content goes within a <dl>. // Objects display the class name as a badge. Content goes within a <dl>.
$badge = html_writer::span(get_class($item), 'badge badge-primary'); $badge = html_writer::span(get_class($item), 'badge bg-primary text-white');
$out .= html_writer::tag('h5', $badge); $out .= html_writer::tag('h5', $badge);
$out .= html_writer::start_tag('dl', ['class' => 'row']); $out .= html_writer::start_tag('dl', ['class' => 'row']);
$dl = true; $dl = true;
@ -1832,7 +1832,7 @@ function print_object($item, array $expandclasses = ['/./'], bool $textonly = fa
$out .= $arrayinfo; $out .= $arrayinfo;
} else { } else {
// Arrays show the same as objects but the badge is grey. // Arrays show the same as objects but the badge is grey.
$badge = html_writer::span($arrayinfo, 'badge badge-secondary'); $badge = html_writer::span($arrayinfo, 'badge bg-secondary text-dark');
// Decide if there will be a <dl> tag - only if there is some content. // Decide if there will be a <dl> tag - only if there is some content.
$dl = count($item) > 0; $dl = count($item) > 0;
$attributes = []; $attributes = [];

View file

@ -16,7 +16,7 @@
{{/element.frozen}} {{/element.frozen}}
{{#element.frozen}} {{#element.frozen}}
{{#element.options}} {{#element.options}}
{{#selected}}<span class="badge badge-info">{{{text}}}</span>{{/selected}} {{#selected}}<span class="badge bg-info text-white">{{{text}}}</span>{{/selected}}
{{/element.options}} {{/element.options}}
{{/element.frozen}} {{/element.frozen}}
{{#element.managestandardtagsurl}} {{#element.managestandardtagsurl}}

View file

@ -16,7 +16,7 @@
{{/element.frozen}} {{/element.frozen}}
{{#element.frozen}} {{#element.frozen}}
{{#element.options}} {{#element.options}}
{{#selected}}<span class="badge badge-info">{{{text}}}</span>{{/selected}} {{#selected}}<span class="badge bg-info text-white">{{{text}}}</span>{{/selected}}
{{/element.options}} {{/element.options}}
{{/element.frozen}} {{/element.frozen}}
{{#element.managestandardtagsurl}} {{#element.managestandardtagsurl}}

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-danger">{{status}}</span> <span class="badge bg-danger text-white">{{status}}</span>

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-danger">{{status}}</span> <span class="badge bg-danger text-white">{{status}}</span>

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-info">{{status}}</span> <span class="badge bg-info text-white">{{status}}</span>

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-secondary">{{status}}</span> <span class="badge bg-secondary text-dark">{{status}}</span>

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-success">{{status}}</span> <span class="badge bg-success text-white">{{status}}</span>

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-success">{{status}}</span> <span class="badge bg-success text-white">{{status}}</span>

View file

@ -33,4 +33,4 @@
Example context (json): Example context (json):
{ "status": "OK"} { "status": "OK"}
}} }}
<span class="badge badge-warning">{{status}}</span> <span class="badge bg-warning text-dark">{{status}}</span>

View file

@ -34,7 +34,7 @@
"classes": "p-1", "classes": "p-1",
"selectall": "Select all", "selectall": "Select all",
"deselectall": "Deselect all", "deselectall": "Deselect all",
"labelclasses": "badge badge-info" "labelclasses": "badge bg-info text-white"
} }
}} }}
<div class="form-check"> <div class="form-check">

View file

@ -32,7 +32,7 @@
"label": "Select me!", "label": "Select me!",
"checked": true, "checked": true,
"classes": "p-1", "classes": "p-1",
"labelclasses": "badge badge-info" "labelclasses": "badge bg-info text-white"
} }
}} }}
<input id="{{id}}" name="{{name}}" type="checkbox" {{#classes}}class="{{.}}"{{/classes}} value="{{value}}" <input id="{{id}}" name="{{name}}" type="checkbox" {{#classes}}class="{{.}}"{{/classes}} value="{{value}}"

View file

@ -42,7 +42,7 @@
}} }}
{{#items}} {{#items}}
<span role="option" data-value="{{value}}" aria-selected="true" <span role="option" data-value="{{value}}" aria-selected="true"
class="badge badge-secondary clickable text-wrap text-break line-height-4 m-1"> class="badge bg-secondary text-dark clickable text-wrap text-break line-height-4 m-1">
{{{label}}}<i class="icon fa fa-times pl-2 mr-0"></i> {{{label}}}<i class="icon fa fa-times pl-2 mr-0"></i>
</span> </span>
{{/items}} {{/items}}

View file

@ -38,7 +38,7 @@
], "noSelectionString": "No selection" } ], "noSelectionString": "No selection" }
}} }}
{{#items}} {{#items}}
<span role="option" data-value="{{value}}" aria-selected="true" class="badge badge-secondary m-1" style="font-size: 100%"> <span role="option" data-value="{{value}}" aria-selected="true" class="badge bg-secondary text-dark m-1" style="font-size: 100%">
<span aria-hidden="true">× </span>{{{label}}} <span aria-hidden="true">× </span>{{{label}}}
</span> </span>
{{/items}} {{/items}}

View file

@ -69,7 +69,7 @@
</p> </p>
</div> </div>
<div class="unread-count-container"> <div class="unread-count-container">
<span data-region="unread-count" class="badge badge-danger">{{unreadcount}}</span> <span data-region="unread-count" class="badge bg-danger text-white">{{unreadcount}}</span>
</div> </div>
</div> </div>
</a> </a>

View file

@ -98,7 +98,7 @@
</div> </div>
<div class="d-flex align-self-center align-items-center"> <div class="d-flex align-self-center align-items-center">
<span <span
class="badge badge-pill badge-primary {{^unreadcount}}hidden{{/unreadcount}}" class="badge rounded-pill bg-primary text-white {{^unreadcount}}hidden{{/unreadcount}}"
data-region="unread-count" data-region="unread-count"
> >
<span aria-hidden="true">{{unreadcount}}</span> <span aria-hidden="true">{{unreadcount}}</span>

View file

@ -91,7 +91,7 @@
</div> </div>
<span <span
class="badge badge-pill badge-primary {{^unreadcount}}hidden{{/unreadcount}}" class="badge rounded-pill bg-primary text-white {{^unreadcount}}hidden{{/unreadcount}}"
data-region="unread-count" data-region="unread-count"
> >
{{unreadcount}} {{unreadcount}}

View file

@ -64,7 +64,7 @@
aria-selected="false" aria-selected="false"
> >
{{#str}} requests {{/str}} {{#str}} requests {{/str}}
<span class="badge badge-primary bg-primary ml-2 {{^contactrequestcount}}hidden{{/contactrequestcount}}" <span class="badge bg-primary text-white ml-2 {{^contactrequestcount}}hidden{{/contactrequestcount}}"
data-region="contact-request-count" data-region="contact-request-count"
> >
<span aria-hidden="true">{{contactrequestcount}}</span> <span aria-hidden="true">{{contactrequestcount}}</span>

View file

@ -68,7 +68,7 @@
{{#pix}} i/user, core {{/pix}} {{#pix}} i/user, core {{/pix}}
{{#str}} contacts, core_message {{/str}} {{#str}} contacts, core_message {{/str}}
<span <span
class="badge badge-primary bg-primary ml-2 {{^contactrequestcount}}hidden{{/contactrequestcount}}" class="badge bg-primary text-white ml-2 {{^contactrequestcount}}hidden{{/contactrequestcount}}"
data-region="contact-request-count" data-region="contact-request-count"
> >
<span aria-hidden="true">{{contactrequestcount}}</span> <span aria-hidden="true">{{contactrequestcount}}</span>

View file

@ -62,7 +62,7 @@
{{> core/loading }} {{> core/loading }}
</span> </span>
<span <span
class="{{^count.unread}}hidden{{/count.unread}} badge badge-pill badge-primary ml-auto bg-primary" class="{{^count.unread}}hidden{{/count.unread}} badge rounded-pill bg-primary text-white ml-auto"
data-region="section-unread-count" data-region="section-unread-count"
> >
<span aria-hidden="true">{{count.unread}}</span> <span aria-hidden="true">{{count.unread}}</span>

View file

@ -215,12 +215,12 @@
</a> </a>
</div> </div>
<div> <div>
<span class="badge badge-danger rounded" data-region="locked-label" {{^discussion.locked}}hidden{{/discussion.locked}}> <span class="badge bg-danger text-white rounded" data-region="locked-label" {{^discussion.locked}}hidden{{/discussion.locked}}>
{{#str}}locked, forum{{/str}} {{#str}}locked, forum{{/str}}
</span> </span>
{{#discussion.timed.istimed}} {{#discussion.timed.istimed}}
<span> <span>
<button class="btn badge badge-primary rounded border-0" data-region="timed-label" <button class="btn badge bg-primary text-white rounded border-0" data-region="timed-label"
data-toggle="popover" data-container="body" data-placement="right" data-html="true" data-toggle="popover" data-container="body" data-placement="right" data-html="true"
data-content="{{#discussion.timed}}{{#discussion.times}}{{> mod_forum/discussion_times}}{{/discussion.times}}{{/discussion.timed}}" data-content="{{#discussion.timed}}{{#discussion.times}}{{> mod_forum/discussion_times}}{{/discussion.times}}{{/discussion.timed}}"
data-trigger="click" aria-label="{{#str}}timeddiscussion, forum{{/str}}" title="{{#str}}timeddiscussion, forum{{/str}}"> data-trigger="click" aria-label="{{#str}}timeddiscussion, forum{{/str}}" title="{{#str}}timeddiscussion, forum{{/str}}">
@ -304,7 +304,7 @@
{{#unread}} {{#unread}}
{{! TODO Rewrite as AJAX}} {{! TODO Rewrite as AJAX}}
<span class="lead"> <span class="lead">
<a href="{{{discussion.urls.viewfirstunread}}}" class="badge badge-primary rounded-pill font-weight-normal" <a href="{{{discussion.urls.viewfirstunread}}}" class="badge bg-primary text-white rounded-pill font-weight-normal"
title="{{#str}}unreadpostsnumber, mod_forum, {{unread}}{{/str}}" aria-label="{{#str}}unreadpostsnumber, mod_forum, {{unread}}{{/str}}"> title="{{#str}}unreadpostsnumber, mod_forum, {{unread}}{{/str}}" aria-label="{{#str}}unreadpostsnumber, mod_forum, {{unread}}{{/str}}">
{{unread}} {{unread}}
</a> </a>

View file

@ -309,7 +309,7 @@
{{/readonly}} {{/readonly}}
<div class="ml-auto d-flex flex-column"> <div class="ml-auto d-flex flex-column">
{{#haswordcount}} {{#haswordcount}}
<span class="ml-auto badge badge-light"> <span class="ml-auto badge bg-light text-dark">
{{#str}} numwords, core, {{wordcount}} {{/str}} {{#str}} numwords, core, {{wordcount}} {{/str}}
</span> </span>
{{/haswordcount}} {{/haswordcount}}
@ -346,7 +346,7 @@
{{/readonly}} {{/readonly}}
{{/isdeleted}} {{/isdeleted}}
{{#discussionlocked}} {{#discussionlocked}}
<div><span class="badge badge-danger mt-2">{{#str}} locked, mod_forum {{/str}}</span></div> <div><span class="badge bg-danger text-white mt-2">{{#str}} locked, mod_forum {{/str}}</span></div>
{{/discussionlocked}} {{/discussionlocked}}
{{/footer}} {{/footer}}
</div> </div>

View file

@ -752,7 +752,7 @@ function mod_glossary_get_tagged_entries($tag, $exclusivemode = false, $fromctx
$approved = ""; $approved = "";
if (!$item->approved) { if (!$item->approved) {
$approved = '<br>'. html_writer::span(get_string('entrynotapproved', 'mod_glossary'), 'badge badge-warning'); $approved = '<br>'. html_writer::span(get_string('entrynotapproved', 'mod_glossary'), 'badge bg-warning text-dark');
} }
$tagfeed->add($icon, $pagename, $cmname.'<br>'.$coursename.$approved); $tagfeed->add($icon, $pagename, $cmname.'<br>'.$coursename.$approved);
} }

View file

@ -421,13 +421,13 @@ switch ($mode) {
// Different colors for all the states of an essay (graded, if sent, not graded) // Different colors for all the states of an essay (graded, if sent, not graded)
if (!$essayinfo->graded) { if (!$essayinfo->graded) {
$class = "badge badge-warning"; $class = "badge bg-warning text-dark";
$status = get_string('notgraded', 'lesson'); $status = get_string('notgraded', 'lesson');
} elseif (!$essayinfo->sent) { } elseif (!$essayinfo->sent) {
$class = "badge badge-success"; $class = "badge bg-success text-white";
$status = get_string('graded', 'lesson'); $status = get_string('graded', 'lesson');
} else { } else {
$class = "badge badge-success"; $class = "badge bg-success text-white";
$status = get_string('sent', 'lesson'); $status = get_string('sent', 'lesson');
} }
$attributes = array('tabindex' => 0); $attributes = array('tabindex' => 0);

View file

@ -344,7 +344,7 @@ class lesson_page_type_multichoice extends lesson_page {
foreach ($answers as $answer) { foreach ($answers as $answer) {
$answertext = format_text($answer->answer,$answer->answerformat,$formattextdefoptions); $answertext = format_text($answer->answer,$answer->answerformat,$formattextdefoptions);
$correctresponsetext = html_writer::div(get_string('correctresponse', 'lesson'), 'badge badge-success'); $correctresponsetext = html_writer::div(get_string('correctresponse', 'lesson'), 'badge bg-success text-white');
if ($this->properties->qoption) { if ($this->properties->qoption) {
if ($useranswer == null) { if ($useranswer == null) {
$userresponse = array(); $userresponse = array();

View file

@ -260,7 +260,7 @@ class lesson_page_type_truefalse extends lesson_page {
foreach ($answers as $answer) { foreach ($answers as $answer) {
$answer = parent::rewrite_answers_urls($answer); $answer = parent::rewrite_answers_urls($answer);
$answertext = format_text($answer->answer, $answer->answerformat, $formattextdefoptions); $answertext = format_text($answer->answer, $answer->answerformat, $formattextdefoptions);
$correctresponsetext = html_writer::div(get_string('correctresponse', 'lesson'), 'badge badge-success'); $correctresponsetext = html_writer::div(get_string('correctresponse', 'lesson'), 'badge bg-success text-white');
if ($this->properties->qoption) { if ($this->properties->qoption) {
if ($useranswer == null) { if ($useranswer == null) {
$userresponse = array(); $userresponse = array();

View file

@ -100,10 +100,10 @@
<div class="tool-card-header"> <div class="tool-card-header">
<div class="tool-card-subheader"> <div class="tool-card-subheader">
<div class="badge <div class="badge
{{#state.pending}}badge-info{{/state.pending}} {{#state.pending}}bg-info text-white{{/state.pending}}
{{#state.configured}}badge-success{{/state.configured}} {{#state.configured}}bg-success text-white{{/state.configured}}
{{#state.rejected}}badge-danger{{/state.rejected}} {{#state.rejected}}bg-danger text-white{{/state.rejected}}
{{#state.unknown}}badge-warning{{/state.unknown}}"> {{#state.unknown}}bg-warning text-dark{{/state.unknown}}">
{{state.text}} {{state.text}}
</div> </div>
<div class="tool-card-actions float-sm-right"> <div class="tool-card-actions float-sm-right">

View file

@ -72,10 +72,10 @@
<div class="tool-card-header"> <div class="tool-card-header">
<div class="tool-card-subheader"> <div class="tool-card-subheader">
<div class="badge <div class="badge
{{#state.pending}}badge-info{{/state.pending}} {{#state.pending}}bg-info text-white{{/state.pending}}
{{#state.configured}}badge-success{{/state.configured}} {{#state.configured}}bg-success text-white{{/state.configured}}
{{#state.rejected}}badge-danger{{/state.rejected}} {{#state.rejected}}bg-danger text-white{{/state.rejected}}
{{#state.unknown}}badge-warning{{/state.unknown}}"> {{#state.unknown}}bg-warning text-dark{{/state.unknown}}">
{{state.text}} {{state.text}}
</div> </div>
<div class="tool-card-actions float-sm-right"> <div class="tool-card-actions float-sm-right">

View file

@ -1660,7 +1660,7 @@ function quiz_question_tostring($question, $showicon = false, $showquestiontext
if ($showidnumber && $question->idnumber !== null && $question->idnumber !== '') { if ($showidnumber && $question->idnumber !== null && $question->idnumber !== '') {
$result .= ' ' . html_writer::span( $result .= ' ' . html_writer::span(
html_writer::span(get_string('idnumber', 'question'), 'accesshide') . html_writer::span(get_string('idnumber', 'question'), 'accesshide') .
' ' . s($question->idnumber), 'badge badge-primary'); ' ' . s($question->idnumber), 'badge bg-primary text-white');
} }
// Question tags. // Question tags.

View file

@ -52,10 +52,10 @@ foreach ($accounts as $account) {
} }
$name = $account->get_formatted_name(); $name = $account->get_formatted_name();
if (!$account->is_available()) { if (!$account->is_available()) {
$name .= ' ' . html_writer::span(get_string('accountnotavailable', 'payment'), 'badge badge-warning'); $name .= ' ' . html_writer::span(get_string('accountnotavailable', 'payment'), 'badge bg-warning text-dark');
} }
if ($account->get('archived')) { if ($account->get('archived')) {
$name .= ' ' . html_writer::span(get_string('accountarchived', 'payment'), 'badge badge-secondary'); $name .= ' ' . html_writer::span(get_string('accountarchived', 'payment'), 'badge bg-secondary text-dark');
} }
$menu = new action_menu(); $menu = new action_menu();

View file

@ -38,7 +38,7 @@
<a title="{{#str}}editquestions, question{{/str}}" href="{{{questionbankurl}}}"> <a title="{{#str}}editquestions, question{{/str}}" href="{{{questionbankurl}}}">
{{{categoryname}}} {{{categoryname}}}
{{#idnumber}} {{#idnumber}}
<span class="badge badge-primary"> <span class="badge bg-primary text-white">
<span class="accesshide"> <span class="accesshide">
{{#str}}idnumber, question{{/str}} {{#str}}idnumber, question{{/str}}
</span> </span>

View file

@ -71,7 +71,7 @@
</div> </div>
{{/newerversion}} {{/newerversion}}
<div class="d-flex"> <div class="d-flex">
<div class="badge-primary h-50 px-2 mt-n2"> <div class="bg-primary text-white h-50 px-2 mt-n2">
<span class="accesshide">ID number</span> <span class="accesshide">ID number</span>
{{questionidumber}} {{questionidumber}}
</div> </div>

View file

@ -51,7 +51,7 @@ class question_name_idnumber_tags_column extends viewquestionname_column_helper
if ($question->idnumber !== null && $question->idnumber !== '') { if ($question->idnumber !== null && $question->idnumber !== '') {
echo ' ' . \html_writer::span( echo ' ' . \html_writer::span(
\html_writer::span(get_string('idnumber', 'question') . '&nbsp;', 'accesshide') \html_writer::span(get_string('idnumber', 'question') . '&nbsp;', 'accesshide')
. \html_writer::span(s($question->idnumber), 'badge badge-primary'), 'ml-1'); . \html_writer::span(s($question->idnumber), 'badge bg-primary text-white'), 'ml-1');
} }
// Question tags. // Question tags.

View file

@ -151,7 +151,7 @@ class reports_list extends system_report {
->add_callback(function(string $value, stdClass $row) { ->add_callback(function(string $value, stdClass $row) {
if (!$this->report_source_valid($value)) { if (!$this->report_source_valid($value)) {
// Add danger badge if report source is not valid (either it's missing, or has errors). // Add danger badge if report source is not valid (either it's missing, or has errors).
return html_writer::span(get_string('errorsourceinvalid', 'core_reportbuilder'), 'badge badge-danger'); return html_writer::span(get_string('errorsourceinvalid', 'core_reportbuilder'), 'badge bg-danger text-white');
} }
return call_user_func([$value, 'get_name']); return call_user_func([$value, 'get_name']);

View file

@ -53,7 +53,7 @@
<ul class="inline-list"> <ul class="inline-list">
{{#tags}} {{#tags}}
<li {{#overlimit}}class="overlimit"{{/overlimit}}> <li {{#overlimit}}class="overlimit"{{/overlimit}}>
<a href="{{viewurl}}" class="badge badge-info {{#isstandard}}standardtag{{/isstandard}}" > <a href="{{viewurl}}" class="badge bg-info text-white {{#isstandard}}standardtag{{/isstandard}}" >
{{#flag}} {{#flag}}
<span class="flagged-tag">{{name}}</span></a> <span class="flagged-tag">{{name}}</span></a>
{{/flag}} {{/flag}}

View file

@ -1,6 +1,10 @@
This file describes API changes in /theme/boost This file describes API changes in /theme/boost
information provided here is intended especially for theme designers. information provided here is intended especially for theme designers.
=== 4.4 ===
* Bootstrap badge color helper clases (badge-[primary|secondary|...]) are no longer used, use bg-[primary|secondary|...] instead.
* Bootstrap badge-pill is no longer used, use rounded-pill instead.
=== 4.3 === === 4.3 ===
* The $activity-iconcontainer-height and $activity-iconcontainer-width variables have been changed from 50px to 52px. * The $activity-iconcontainer-height and $activity-iconcontainer-width variables have been changed from 50px to 52px.
* New SCSS mixin optional_animate to animate an element unless if the user has reduced motion in their preferences. * New SCSS mixin optional_animate to animate an element unless if the user has reduced motion in their preferences.

View file

@ -35,7 +35,7 @@
"coursename": "TC 1", "coursename": "TC 1",
"enrolinstancename": "Manual enrolment", "enrolinstancename": "Manual enrolment",
"status": "Active", "status": "Active",
"statusclass": "badge badge-success", "statusclass": "badge bg-success text-white",
"timestart": "1 January 2017", "timestart": "1 January 2017",
"timeend": "31 January 2018", "timeend": "31 January 2018",
"timeenrolled": "31 December 2016" "timeenrolled": "31 December 2016"

View file

@ -61,7 +61,7 @@
}} }}
<div data-fullname="{{fullname}}" data-coursename="{{coursename}}" data-enrolinstancename="{{enrolinstancename}}" <div data-fullname="{{fullname}}" data-coursename="{{coursename}}" data-enrolinstancename="{{enrolinstancename}}"
data-status="{{status}}" data-timestart="{{timestart}}" data-timeend="{{timeend}}" data-timeenrolled="{{timeenrolled}}"> data-status="{{status}}" data-timestart="{{timestart}}" data-timeend="{{timeend}}" data-timeenrolled="{{timeenrolled}}">
<span class="badge {{#active}}badge-success{{/active}}{{#suspended}}badge-warning{{/suspended}}{{#notcurrent}}badge-secondary{{/notcurrent}}">{{status}}</span> <span class="badge {{#active}}bg-success text-white{{/active}}{{#suspended}}bg-warning text-dark{{/suspended}}{{#notcurrent}}bg-secondary text-dark{{/notcurrent}}">{{status}}</span>
<a data-action="showdetails" href="#" role="button" tabindex="0">{{! <a data-action="showdetails" href="#" role="button" tabindex="0">{{!
}}{{#pix}}docs, core, {{enrolinstancename}}{{/pix}}{{! }}{{#pix}}docs, core, {{enrolinstancename}}{{/pix}}{{!
}}</a> }}</a>

View file

@ -182,7 +182,7 @@ class token_table extends \table_sql {
if ($data->serviceshortname <> MOODLE_OFFICIAL_MOBILE_SERVICE && !is_siteadmin($data->userid) if ($data->serviceshortname <> MOODLE_OFFICIAL_MOBILE_SERVICE && !is_siteadmin($data->userid)
&& array_key_exists($data->userid, $usermissingcaps)) { && array_key_exists($data->userid, $usermissingcaps)) {
$count = \html_writer::span(count($usermissingcaps[$data->userid]), 'badge badge-danger'); $count = \html_writer::span(count($usermissingcaps[$data->userid]), 'badge bg-danger text-white');
$links = array_map(function($capname) { $links = array_map(function($capname) {
return get_capability_docs_link((object)['name' => $capname]) . \html_writer::div($capname, 'text-muted'); return get_capability_docs_link((object)['name' => $capname]) . \html_writer::div($capname, 'text-muted');
}, $usermissingcaps[$data->userid]); }, $usermissingcaps[$data->userid]);

View file

@ -126,7 +126,7 @@ class core_webservice_renderer extends plugin_renderer_base {
$link = html_writer::link($settingsurl, fullname($user)); $link = html_writer::link($settingsurl, fullname($user));
if (!empty($user->missingcapabilities)) { if (!empty($user->missingcapabilities)) {
$count = html_writer::span(count($user->missingcapabilities), 'badge badge-danger'); $count = html_writer::span(count($user->missingcapabilities), 'badge bg-danger text-white');
$links = array_map(function($capname) { $links = array_map(function($capname) {
return get_capability_docs_link((object)['name' => $capname]) . html_writer::div($capname, 'text-muted'); return get_capability_docs_link((object)['name' => $capname]) . html_writer::div($capname, 'text-muted');
}, $user->missingcapabilities); }, $user->missingcapabilities);
@ -674,7 +674,7 @@ EOF;
$tags = ''; $tags = '';
if (!empty($description->deprecated)) { if (!empty($description->deprecated)) {
$tags .= ' ' . html_writer::span(get_string('deprecated', 'core_webservice'), 'badge badge-warning'); $tags .= ' ' . html_writer::span(get_string('deprecated', 'core_webservice'), 'badge bg-warning text-dark');
} }
if (empty($printableformat)) { if (empty($printableformat)) {