From a1988843334976bed43531c69b7b021c3a589b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Fri, 1 Dec 2023 10:54:22 +0100 Subject: [PATCH] MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5 --- admin/classes/table/hook_list_table.php | 2 +- admin/renderer.php | 56 ++++++++++--------- .../hugo/site/layouts/_default/docs.html | 2 +- .../external/data_request_exporter.php | 16 +++--- .../classes/output/my_data_requests_page.php | 8 +-- .../templates/component_status.mustache | 6 +- .../data_registry_compliance.mustache | 6 +- .../templates/my_data_requests.mustache | 8 +-- .../templates/request_details.mustache | 2 +- .../course_competencies_page.mustache | 2 +- .../lp/templates/evidence_summary.mustache | 2 +- admin/tool/lp/templates/plans_page.mustache | 2 +- .../template_competencies_page.mustache | 2 +- .../user_competency_summary.mustache | 2 +- ...user_competency_summary_in_course.mustache | 2 +- .../user_competency_summary_in_plan.mustache | 4 +- admin/tool/mfa/classes/output/renderer.php | 13 +++-- .../classes/output/page_managedocs_list.php | 4 +- .../policy/templates/acceptances.mustache | 4 +- .../tool/task/classes/running_tasks_table.php | 4 +- admin/tool/task/renderer.php | 2 +- .../moodle-core_availability-form-debug.js | 6 +- .../moodle-core_availability-form-min.js | 4 +- .../moodle-core_availability-form.js | 6 +- availability/yui/src/form/js/form.js | 6 +- .../myoverview/templates/view-list.mustache | 2 +- .../templates/view-summary.mustache | 2 +- .../site_main_menu/block_site_main_menu.php | 2 +- .../block_social_activities.php | 2 +- .../templates/event-list-item.mustache | 4 +- .../format/classes/output/activitybadge.php | 8 +-- .../templates/local/content/cm.mustache | 4 +- .../local/content/cm/activity.mustache | 2 +- .../local/content/cm/activitybadge.mustache | 2 +- .../local/content/cm/availability.mustache | 2 +- .../local/content/cm/visibility.mustache | 6 +- .../templates/local/content/section.mustache | 2 +- .../content/section/availability.mustache | 2 +- .../local/content/section/badges.mustache | 12 ++-- .../local/content/section/cmitem.mustache | 6 +- .../local/content/section/content.mustache | 2 +- .../local/courseindex/section.mustache | 2 +- .../tests/output/activitybadge_test.php | 2 +- .../templates/completion_automatic.mustache | 8 +-- course/templates/coursecard.mustache | 2 +- course/tests/externallib_test.php | 2 +- .../registered_platforms.mustache | 4 +- .../grader/lang/en/gradereport_grader.php | 2 +- grade/templates/category_settings.mustache | 12 ++-- h5p/classes/helper.php | 8 +-- h5p/templates/h5ptoolsoverview.mustache | 4 +- lib/adminlib.php | 34 +++++------ .../moodlenet/share_progress_table.php | 6 +- lib/datalib.php | 4 +- .../templates/element-tags-inline.mustache | 2 +- lib/form/templates/element-tags.mustache | 2 +- lib/templates/check/result/critical.mustache | 2 +- lib/templates/check/result/error.mustache | 2 +- lib/templates/check/result/info.mustache | 2 +- lib/templates/check/result/na.mustache | 2 +- lib/templates/check/result/ok.mustache | 2 +- lib/templates/check/result/unknown.mustache | 2 +- lib/templates/check/result/warning.mustache | 2 +- .../checkbox-toggleall-master.mustache | 2 +- .../checkbox-toggleall-slave.mustache | 2 +- .../autocomplete_selection_items.mustache | 2 +- ...form_autocomplete_selection_items.mustache | 2 +- .../templates/message_content_item.mustache | 2 +- ...message_drawer_conversations_list.mustache | 2 +- .../message_drawer_messages_list.mustache | 2 +- ...message_drawer_view_contacts_body.mustache | 2 +- ...ssage_drawer_view_overview_header.mustache | 2 +- ...sage_drawer_view_overview_section.mustache | 2 +- mod/forum/templates/discussion_list.mustache | 6 +- ...m_discussion_nested_v2_first_post.mustache | 4 +- mod/glossary/locallib.php | 2 +- mod/lesson/essay.php | 6 +- mod/lesson/pagetypes/multichoice.php | 2 +- mod/lesson/pagetypes/truefalse.php | 2 +- mod/lti/templates/tool_card.mustache | 8 +-- mod/lti/templates/tool_proxy_card.mustache | 8 +-- mod/quiz/locallib.php | 2 +- payment/accounts.php | 4 +- .../templates/listitem.mustache | 2 +- .../templates/preview_question.mustache | 2 +- .../question_name_idnumber_tags_column.php | 2 +- .../local/systemreports/reports_list.php | 2 +- tag/templates/taglist.mustache | 2 +- theme/boost/upgrade.txt | 4 ++ user/templates/status_details.mustache | 2 +- user/templates/status_field.mustache | 2 +- webservice/classes/token_table.php | 2 +- webservice/renderer.php | 4 +- 93 files changed, 218 insertions(+), 209 deletions(-) diff --git a/admin/classes/table/hook_list_table.php b/admin/classes/table/hook_list_table.php index cbe9cb7ebef..1f95002703e 100644 --- a/admin/classes/table/hook_list_table.php +++ b/admin/classes/table/hook_list_table.php @@ -273,7 +273,7 @@ class hook_list_table extends flexible_table { if (is_array($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); return implode("\n", $taglist); diff --git a/admin/renderer.php b/admin/renderer.php index 7f943869ca3..7e7ef8d30bc 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -1111,10 +1111,11 @@ class core_admin_renderer extends plugin_renderer_base { if ($isstandard = $plugin->is_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 { $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); @@ -1128,19 +1129,19 @@ class core_admin_renderer extends plugin_renderer_base { $statusclass = 'statustext badge '; switch ($statuscode) { case core_plugin_manager::PLUGIN_STATUS_NEW: - $statusclass .= $dependenciesok ? 'badge-success' : 'badge-warning'; + $statusclass .= $dependenciesok ? 'bg-success text-white' : 'bg-warning text-dark'; break; case core_plugin_manager::PLUGIN_STATUS_UPGRADE: - $statusclass .= $dependenciesok ? 'badge-info' : 'badge-warning'; + $statusclass .= $dependenciesok ? 'bg-info text-white' : 'bg-warning text-dark'; break; case core_plugin_manager::PLUGIN_STATUS_MISSING: case core_plugin_manager::PLUGIN_STATUS_DOWNGRADE: case core_plugin_manager::PLUGIN_STATUS_DELETE: - $statusclass .= 'badge-danger'; + $statusclass .= 'bg-danger text-white'; break; case core_plugin_manager::PLUGIN_STATUS_NODB: case core_plugin_manager::PLUGIN_STATUS_UPTODATE: - $statusclass .= $dependenciesok ? 'badge-light' : 'badge-warning'; + $statusclass .= $dependenciesok ? 'bg-light text-dark' : 'bg-warning text-dark'; break; } $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)), - 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'); $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'); $out .= $this->output->container_end(); // End of .actions container. @@ -1420,9 +1421,9 @@ class core_admin_renderer extends plugin_renderer_base { $supportedmoodles = array(); foreach ($plugin->version->supportedmoodles as $moodle) { 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 { - $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 = ''; } else { $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)) { @@ -1557,8 +1558,10 @@ class core_admin_renderer extends plugin_renderer_base { } else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_MISSING) { if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) { - $label = html_writer::span(get_string('dependencymissing', 'core_plugin'), 'badge badge-warning'); - $label .= ' '.html_writer::span(get_string('dependencyavailable', 'core_plugin'), 'badge badge-warning'); + $label = html_writer::span(get_string('dependencymissing', 'core_plugin'), + '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'; $actions[] = html_writer::link( 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 { - $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'), - 'badge badge-danger'); + 'badge bg-danger text-white'); $class = 'requires-failed requires-missing requires-unavailable'; } $displayuploadlink = true; } else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OUTDATED) { if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) { - $label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-warning'); - $label .= ' '.html_writer::span(get_string('dependencyavailable', '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 bg-warning text-dark'); $class = 'requires-failed requires-outdated requires-available'; $displayupdateslink = true; } 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'), - 'badge badge-danger'); + 'badge bg-danger text-white'); $class = 'requires-failed requires-outdated requires-unavailable'; } $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)), get_string('overviewupdatable', '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 { // No updates, or the notifications disabled. $infoupdatable = ''; @@ -1868,13 +1872,13 @@ class core_admin_renderer extends plugin_renderer_base { $source = ''; } else { $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) { - $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) { - $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 { $msg = ''; } @@ -2113,13 +2117,13 @@ class core_admin_renderer extends plugin_renderer_base { // Format error or warning line if ($errorline) { $messagetype = 'error'; - $statusclass = 'badge-danger'; + $statusclass = 'bg-danger text-white'; } else if ($warningline) { $messagetype = 'warn'; - $statusclass = 'badge-warning'; + $statusclass = 'bg-warning text-dark'; } else { $messagetype = 'ok'; - $statusclass = 'badge-success'; + $statusclass = 'bg-success text-white'; } $status = html_writer::span($status, 'badge ' . $statusclass); // Here we'll store all the feedback found diff --git a/admin/tool/componentlibrary/hugo/site/layouts/_default/docs.html b/admin/tool/componentlibrary/hugo/site/layouts/_default/docs.html index dff327a8735..cb6a8e43813 100644 --- a/admin/tool/componentlibrary/hugo/site/layouts/_default/docs.html +++ b/admin/tool/componentlibrary/hugo/site/layouts/_default/docs.html @@ -53,7 +53,7 @@ {{ if .Page.Params.tags }} {{ range .Page.Params.tags }} -
{{.}}
+
{{.}}
{{ end }} {{ end }} diff --git a/admin/tool/dataprivacy/classes/external/data_request_exporter.php b/admin/tool/dataprivacy/classes/external/data_request_exporter.php index 41ee4bac745..c0d79fc05a9 100644 --- a/admin/tool/dataprivacy/classes/external/data_request_exporter.php +++ b/admin/tool/dataprivacy/classes/external/data_request_exporter.php @@ -164,12 +164,12 @@ class data_request_exporter extends persistent_exporter { switch ($this->persistent->get('status')) { case api::DATAREQUEST_STATUS_PENDING: case api::DATAREQUEST_STATUS_PREPROCESSING: - $values['statuslabelclass'] = 'badge-info'; + $values['statuslabelclass'] = 'bg-info text-white'; // Request can be manually completed for general enquiry requests. $values['canmarkcomplete'] = $requesttype == api::DATAREQUEST_TYPE_OTHERS; break; 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. $values['canreview'] = true; // Whether the DPO can approve or deny the request. @@ -180,24 +180,24 @@ class data_request_exporter extends persistent_exporter { } break; case api::DATAREQUEST_STATUS_APPROVED: - $values['statuslabelclass'] = 'badge-info'; + $values['statuslabelclass'] = 'bg-info text-white'; break; case api::DATAREQUEST_STATUS_PROCESSING: - $values['statuslabelclass'] = 'badge-info'; + $values['statuslabelclass'] = 'bg-info text-white'; break; case api::DATAREQUEST_STATUS_COMPLETE: case api::DATAREQUEST_STATUS_DOWNLOAD_READY: case api::DATAREQUEST_STATUS_DELETED: - $values['statuslabelclass'] = 'badge-success'; + $values['statuslabelclass'] = 'bg-success text-white'; break; case api::DATAREQUEST_STATUS_CANCELLED: - $values['statuslabelclass'] = 'badge-warning'; + $values['statuslabelclass'] = 'bg-warning text-dark'; break; case api::DATAREQUEST_STATUS_REJECTED: - $values['statuslabelclass'] = 'badge-danger'; + $values['statuslabelclass'] = 'bg-danger text-white'; break; case api::DATAREQUEST_STATUS_EXPIRED: - $values['statuslabelclass'] = 'badge-secondary'; + $values['statuslabelclass'] = 'bg-secondary text-dark'; break; } diff --git a/admin/tool/dataprivacy/classes/output/my_data_requests_page.php b/admin/tool/dataprivacy/classes/output/my_data_requests_page.php index 14d637578d7..21349de3d9b 100644 --- a/admin/tool/dataprivacy/classes/output/my_data_requests_page.php +++ b/admin/tool/dataprivacy/classes/output/my_data_requests_page.php @@ -106,12 +106,12 @@ class my_data_requests_page implements renderable, templatable { $cancancel = true; switch ($status) { case api::DATAREQUEST_STATUS_COMPLETE: - $item->statuslabelclass = 'badge-success'; + $item->statuslabelclass = 'bg-success text-white'; $item->statuslabel = get_string('statuscomplete', 'tool_dataprivacy'); $cancancel = false; break; case api::DATAREQUEST_STATUS_DOWNLOAD_READY: - $item->statuslabelclass = 'badge-success'; + $item->statuslabelclass = 'bg-success text-white'; $item->statuslabel = get_string('statusready', 'tool_dataprivacy'); $cancancel = false; $candownload = true; @@ -122,12 +122,12 @@ class my_data_requests_page implements renderable, templatable { } break; case api::DATAREQUEST_STATUS_DELETED: - $item->statuslabelclass = 'badge-success'; + $item->statuslabelclass = 'bg-success text-white'; $item->statuslabel = get_string('statusdeleted', 'tool_dataprivacy'); $cancancel = false; break; case api::DATAREQUEST_STATUS_EXPIRED: - $item->statuslabelclass = 'badge-secondary'; + $item->statuslabelclass = 'bg-secondary text-dark'; $item->statuslabel = get_string('statusexpired', 'tool_dataprivacy'); $item->statuslabeltitle = get_string('downloadexpireduser', 'tool_dataprivacy'); $cancancel = false; diff --git a/admin/tool/dataprivacy/templates/component_status.mustache b/admin/tool/dataprivacy/templates/component_status.mustache index 7130dbffa90..b322f279e96 100644 --- a/admin/tool/dataprivacy/templates/component_status.mustache +++ b/admin/tool/dataprivacy/templates/component_status.mustache @@ -59,13 +59,13 @@ {{#pix}}i/risk_xss, moodle, {{#str}}requiresattention, tool_dataprivacy{{/str}}{{/pix}} {{/compliant}} {{#external}} - {{#str}}external, tool_dataprivacy{{/str}} + {{#str}}external, tool_dataprivacy{{/str}} {{/external}} {{#deprecated}} - {{#str}}deprecated, tool_dataprivacy{{/str}} + {{#str}}deprecated, tool_dataprivacy{{/str}} {{/deprecated}} {{#userlistnoncompliance}} - {{#str}}userlistnoncompliant, tool_dataprivacy{{/str}} + {{#str}}userlistnoncompliant, tool_dataprivacy{{/str}} {{/userlistnoncompliance}} diff --git a/admin/tool/dataprivacy/templates/data_registry_compliance.mustache b/admin/tool/dataprivacy/templates/data_registry_compliance.mustache index ec41fc23c41..ab66f577483 100644 --- a/admin/tool/dataprivacy/templates/data_registry_compliance.mustache +++ b/admin/tool/dataprivacy/templates/data_registry_compliance.mustache @@ -43,11 +43,11 @@
{{#pix}}i/risk_xss, moodle, {{#str}}requiresattention, tool_dataprivacy{{/str}}{{/pix}}
{{#str}}requiresattentionexplanation, tool_dataprivacy{{/str}}
-
{{#str}}external, tool_dataprivacy{{/str}}
+
{{#str}}external, tool_dataprivacy{{/str}}
{{#str}}externalexplanation, tool_dataprivacy{{/str}}
-
{{#str}}deprecated, tool_dataprivacy{{/str}}
+
{{#str}}deprecated, tool_dataprivacy{{/str}}
{{#str}}deprecatedexplanation, tool_dataprivacy{{/str}}
-
{{#str}}userlistnoncompliant, tool_dataprivacy{{/str}}
+
{{#str}}userlistnoncompliant, tool_dataprivacy{{/str}}
{{#str}}userlistexplanation, tool_dataprivacy{{/str}}

diff --git a/admin/tool/dataprivacy/templates/my_data_requests.mustache b/admin/tool/dataprivacy/templates/my_data_requests.mustache index 78d0c5be7d9..fc8eaf5be8d 100644 --- a/admin/tool/dataprivacy/templates/my_data_requests.mustache +++ b/admin/tool/dataprivacy/templates/my_data_requests.mustache @@ -35,7 +35,7 @@ "id": 1, "typename" : "Data export", "comments": "I would like to download all of my daughter's personal data", - "statuslabelclass": "badge-secondary", + "statuslabelclass": "bg-secondary text-dark", "statuslabel": "Pending", "timecreated" : 1517902087, "requestedbyuser" : { @@ -47,7 +47,7 @@ "id": 2, "typename" : "Data export", "comments": "Give me all of the information you have about me, or else...", - "statuslabelclass": "badge-warning", + "statuslabelclass": "bg-warning text-dark", "statuslabel": "Awaiting completion", "timecreated" : 1517902087, "requestedbyuser" : { @@ -59,7 +59,7 @@ "id": 3, "typename" : "Data deletion", "comments": "Please delete all of my son's personal data.", - "statuslabelclass": "badge-success", + "statuslabelclass": "bg-success text-white", "statuslabel": "Deleted", "timecreated" : 1517902087, "requestedbyuser" : { @@ -83,7 +83,7 @@ "id": 5, "typename" : "Data export", "comments": "Please let me download my data", - "statuslabelclass": "badge-info", + "statuslabelclass": "bg-info text-white", "statuslabel": "Processing", "timecreated" : 1517902087, "requestedbyuser" : { diff --git a/admin/tool/dataprivacy/templates/request_details.mustache b/admin/tool/dataprivacy/templates/request_details.mustache index 86896bcf6ec..2da764832cf 100644 --- a/admin/tool/dataprivacy/templates/request_details.mustache +++ b/admin/tool/dataprivacy/templates/request_details.mustache @@ -49,7 +49,7 @@ "profileurl": "#" }, "statuslabel": "Pending", - "statuslabelclass": "badge-secondary", + "statuslabelclass": "bg-secondary text-dark", "messagehtml": "

Hello,

I would like to download all of my personal data.

Thanks!

" } }} diff --git a/admin/tool/lp/templates/course_competencies_page.mustache b/admin/tool/lp/templates/course_competencies_page.mustache index 6d3622b8218..ea3e6123089 100644 --- a/admin/tool/lp/templates/course_competencies_page.mustache +++ b/admin/tool/lp/templates/course_competencies_page.mustache @@ -82,7 +82,7 @@ {{/comppath}} {{#usercompetencycourse}} {{#grade}} - {{gradename}} + {{gradename}} {{/grade}} {{/usercompetencycourse}} {{#canmanagecoursecompetencies}} diff --git a/admin/tool/lp/templates/evidence_summary.mustache b/admin/tool/lp/templates/evidence_summary.mustache index 5033ce977d8..a0922d59491 100644 --- a/admin/tool/lp/templates/evidence_summary.mustache +++ b/admin/tool/lp/templates/evidence_summary.mustache @@ -57,7 +57,7 @@ {{/actionuser}} {{#grade}} -

{{gradename}}

+

{{gradename}}

{{/grade}}

{{description}}

{{#note}} diff --git a/admin/tool/lp/templates/plans_page.mustache b/admin/tool/lp/templates/plans_page.mustache index 17111475e7d..6e93d853037 100644 --- a/admin/tool/lp/templates/plans_page.mustache +++ b/admin/tool/lp/templates/plans_page.mustache @@ -57,7 +57,7 @@ {{#isbasedontemplate}} - {{#str}}yes{{/str}} + {{#str}}yes{{/str}} {{/isbasedontemplate}} {{^isbasedontemplate}} {{#str}}no{{/str}} diff --git a/admin/tool/lp/templates/template_competencies_page.mustache b/admin/tool/lp/templates/template_competencies_page.mustache index e5f7ca29f3a..1445813b280 100644 --- a/admin/tool/lp/templates/template_competencies_page.mustache +++ b/admin/tool/lp/templates/template_competencies_page.mustache @@ -58,7 +58,7 @@ {{/hascourses}} {{^hascourses}} - {{#str}}nolinkedcourses, tool_lp{{/str}} + {{#str}}nolinkedcourses, tool_lp{{/str}} {{/hascourses}} diff --git a/admin/tool/lp/templates/user_competency_summary.mustache b/admin/tool/lp/templates/user_competency_summary.mustache index 33799670c0b..b1272077b27 100644 --- a/admin/tool/lp/templates/user_competency_summary.mustache +++ b/admin/tool/lp/templates/user_competency_summary.mustache @@ -57,7 +57,7 @@
{{#str}}proficient, tool_lp{{/str}}
- + {{proficiencyname}}
diff --git a/admin/tool/lp/templates/user_competency_summary_in_course.mustache b/admin/tool/lp/templates/user_competency_summary_in_course.mustache index 32bfd0dbed4..6142c5301b8 100644 --- a/admin/tool/lp/templates/user_competency_summary_in_course.mustache +++ b/admin/tool/lp/templates/user_competency_summary_in_course.mustache @@ -81,7 +81,7 @@ {{#usercompetencycourse}}
{{#str}}proficient, tool_lp{{/str}}
- + {{proficiencyname}}
diff --git a/admin/tool/lp/templates/user_competency_summary_in_plan.mustache b/admin/tool/lp/templates/user_competency_summary_in_plan.mustache index bb13c95f659..c09ae6c6e97 100644 --- a/admin/tool/lp/templates/user_competency_summary_in_plan.mustache +++ b/admin/tool/lp/templates/user_competency_summary_in_plan.mustache @@ -68,7 +68,7 @@
{{#str}}proficient, tool_lp{{/str}}
- + {{proficiencyname}}
@@ -101,7 +101,7 @@
{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}
{{#str}}proficient, tool_lp{{/str}}
- + {{proficiencyname}}
diff --git a/admin/tool/mfa/classes/output/renderer.php b/admin/tool/mfa/classes/output/renderer.php index 604105d96dc..ac8bd10b4ef 100644 --- a/admin/tool/mfa/classes/output/renderer.php +++ b/admin/tool/mfa/classes/output/renderer.php @@ -41,23 +41,24 @@ class renderer extends \plugin_renderer_base { switch ($state) { 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: - 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: - 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: 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: - 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: - 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']); } } diff --git a/admin/tool/policy/classes/output/page_managedocs_list.php b/admin/tool/policy/classes/output/page_managedocs_list.php index 9123cb8aef1..8cc6aa963e8 100644 --- a/admin/tool/policy/classes/output/page_managedocs_list.php +++ b/admin/tool/policy/classes/output/page_managedocs_list.php @@ -152,9 +152,9 @@ class page_managedocs_list implements renderable, templatable { $version->statustext = get_string('status' . $status, 'tool_policy'); 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) { - $version->statustext = html_writer::span($version->statustext, 'badge badge-warning'); + $version->statustext = html_writer::span($version->statustext, 'badge bg-warning text-dark'); } else { $version->statustext = html_writer::span($version->statustext, 'label'); } diff --git a/admin/tool/policy/templates/acceptances.mustache b/admin/tool/policy/templates/acceptances.mustache index 339f513bf63..fd5e4cd50f0 100644 --- a/admin/tool/policy/templates/acceptances.mustache +++ b/admin/tool/policy/templates/acceptances.mustache @@ -110,8 +110,8 @@ {{{revision}}} - {{#iscurrent}}{{#str}} status1, tool_policy {{/str}}{{/iscurrent}} - {{#isoptional}}{{#str}} policydocoptionalyes, tool_policy {{/str}}{{/isoptional}} + {{#iscurrent}}{{#str}} status1, tool_policy {{/str}}{{/iscurrent}} + {{#isoptional}}{{#str}} policydocoptionalyes, tool_policy {{/str}}{{/isoptional}} {{>tool_policy/user_agreement}} diff --git a/admin/tool/task/classes/running_tasks_table.php b/admin/tool/task/classes/running_tasks_table.php index e34abbd3b3e..d7e7c7fc587 100644 --- a/admin/tool/task/classes/running_tasks_table.php +++ b/admin/tool/task/classes/running_tasks_table.php @@ -110,9 +110,9 @@ class running_tasks_table extends \table_sql { */ public function col_type($row) : string { 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') { - $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 { // This shouldn't ever happen. $output = ''; diff --git a/admin/tool/task/renderer.php b/admin/tool/task/renderer.php index f61909d256a..5c8366395e2 100644 --- a/admin/tool/task/renderer.php +++ b/admin/tool/task/renderer.php @@ -468,7 +468,7 @@ class tool_task_renderer extends plugin_renderer_base { $componentname = $plugininfo->displayname; if ($plugininfo->is_enabled() === false) { $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'); diff --git a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js index f912b243ed4..3366368971f 100644 --- a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js +++ b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-debug.js @@ -436,7 +436,7 @@ M.core_availability.List = function(json, root, parentRoot) { noneNode.appendChild(deleteIcon.span); // Also if it's not the root, none is actually invalid, so add a label. - noneNode.appendChild(Y.Node.create('' + + noneNode.appendChild(Y.Node.create('' + M.util.get_string('invalid', 'availability') + '')); } @@ -1002,7 +1002,7 @@ M.core_availability.Item = function(json, root) { // Add the invalid marker (empty). this.node.appendChild(document.createTextNode(' ')); - this.node.appendChild(Y.Node.create('')); + this.node.appendChild(Y.Node.create('')); }; 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'); } // 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')) { var errorString = ''; // Fetch the last error code from the array of errors and split using the ':' delimiter. diff --git a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js index 2711f3af9ab..c52670a7b72 100644 --- a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js +++ b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js @@ -1,4 +1,4 @@ -YUI.add("moodle-core_availability-form",function(d,i){M.core_availability=M.core_availability||{},M.core_availability.form={plugins:{},field:null,mainDiv:null,rootList:null,idCounter:0,restrictByGroup:null,init:function(i){var t,e,a,l,n;for(t in i)e=i[t],(a=M[e[0]].form).init.apply(a,e);if(this.field=d.one("#id_availabilityconditionsjson"),this.field.setAttribute("aria-hidden","true"),this.mainDiv=d.Node.create(''),this.field.insert(this.mainDiv,"after"),n=null,""!==(l=this.field.get("value")))try{n=d.JSON.parse(l)}catch(o){this.field.set("value","")}this.rootList=new M.core_availability.List(n,!0),this.mainDiv.appendChild(this.rootList.node),this.update(),this.rootList.renumber(),this.mainDiv.setAttribute("aria-live","polite"),this.field.ancestor("form").on("submit",function(){this.mainDiv.all("input,textarea,select").set("disabled",!0)},this),this.restrictByGroup=d.one("#restrictbygroup"),this.restrictByGroup&&(this.restrictByGroup.on("click",this.addRestrictByGroup,this),l=d.one("#id_groupmode"),n=d.one("#id_groupingid"),l&&l.on("change",this.updateRestrictByGroup,this),n&&n.on("change",this.updateRestrictByGroup,this),this.updateRestrictByGroup()),this.parent=d.one("#fitem_id_availabilityconditionsjson"),this.parent.removeClass("d-none"),document.getElementById("availabilityconditions-loading").remove()},update:function(){var i=this.rootList.getValue(),t=[];this.rootList.fillErrors(t),0!==t.length&&(i.errors=t),this.field.set("value",d.JSON.stringify(i)),this.updateRestrictByGroup()},updateRestrictByGroup:function(){var i,t,e,a;this.restrictByGroup&&("&"!==this.rootList.getValue().op||(this.rootList.hasItemOfType("group")||this.rootList.hasItemOfType("grouping"))?this.restrictByGroup.set("disabled",!0):(i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),i&&0!==Number(i.get("value"))&&e||t&&0!==Number(t.get("value"))&&a?this.restrictByGroup.set("disabled",!1):this.restrictByGroup.set("disabled",!0)))},addRestrictByGroup:function(i){var t,e,a,l;i.preventDefault(),i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),t&&0!==Number(t.get("value"))&&a?l=new M.core_availability.Item({type:"grouping",id:Number(t.get("value"))},!0):i&&e&&(l=new M.core_availability.Item({type:"group"},!0)),null!==l&&(this.rootList.addChild(l),this.update(),this.rootList.renumber(),this.rootList.updateHtml())}},M.core_availability.plugin={allowAdd:!1,init:function(i,t,e){i=i.replace(/^availability_/,"");this.allowAdd=t,(M.core_availability.form.plugins[i]=this).initInner.apply(this,e)},initInner:function(){},getNode:function(){throw"getNode not implemented"},fillValue:function(){throw"fillValue not implemented"},fillErrors:function(){},focusAfterAdd:function(i){i.one("input:not([disabled]),select:not([disabled])").focus()}},M.core_availability.List=function(i,t,e){var a,l,n;if(this.children=[],t!==undefined&&(this.root=t),this.node=d.Node.create('

'+M.util.get_string("listheader_sign_before","availability")+' '+M.util.get_string("listheader_single","availability")+''+M.util.get_string("listheader_multi_before","availability")+' "+M.util.get_string("listheader_multi_after","availability")+'
'+M.util.get_string("none","moodle")+'
'),t||this.node.addClass("availability-childlist d-sm-flex align-items-center"),this.inner=this.node.one("> .availability-inner"),a=!0,t?(i&&i.show!==undefined&&(a=i.show),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.span,"before"),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.disabledSpan,"before"),this.on("availability:privateRuleSet",function(i){i.target.getDOMNode().dataset["private"]=!0,this.updatePrivateStatus()}),this.on("availability:privateRuleUnset",function(i){delete i.target.getDOMNode().dataset["private"],this.updatePrivateStatus()})):e&&(i&&i.showc!==undefined&&(a=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.inner.insert(this.eyeIcon.span,"before"),this.inner.insert(this.eyeIcon.disabledSpan,"before")),t||(e=new M.core_availability.DeleteIcon(this),(a=this.node.one(".availability-none")).appendChild(document.createTextNode(" ")),a.appendChild(e.span),a.appendChild(d.Node.create(''+M.util.get_string("invalid","availability")+""))),(t=d.Node.create('")).on("click",function(){ +YUI.add("moodle-core_availability-form",function(d,i){M.core_availability=M.core_availability||{},M.core_availability.form={plugins:{},field:null,mainDiv:null,rootList:null,idCounter:0,restrictByGroup:null,init:function(i){var t,e,a,l,n;for(t in i)e=i[t],(a=M[e[0]].form).init.apply(a,e);if(this.field=d.one("#id_availabilityconditionsjson"),this.field.setAttribute("aria-hidden","true"),this.mainDiv=d.Node.create(''),this.field.insert(this.mainDiv,"after"),n=null,""!==(l=this.field.get("value")))try{n=d.JSON.parse(l)}catch(o){this.field.set("value","")}this.rootList=new M.core_availability.List(n,!0),this.mainDiv.appendChild(this.rootList.node),this.update(),this.rootList.renumber(),this.mainDiv.setAttribute("aria-live","polite"),this.field.ancestor("form").on("submit",function(){this.mainDiv.all("input,textarea,select").set("disabled",!0)},this),this.restrictByGroup=d.one("#restrictbygroup"),this.restrictByGroup&&(this.restrictByGroup.on("click",this.addRestrictByGroup,this),l=d.one("#id_groupmode"),n=d.one("#id_groupingid"),l&&l.on("change",this.updateRestrictByGroup,this),n&&n.on("change",this.updateRestrictByGroup,this),this.updateRestrictByGroup()),this.parent=d.one("#fitem_id_availabilityconditionsjson"),this.parent.removeClass("d-none"),document.getElementById("availabilityconditions-loading").remove()},update:function(){var i=this.rootList.getValue(),t=[];this.rootList.fillErrors(t),0!==t.length&&(i.errors=t),this.field.set("value",d.JSON.stringify(i)),this.updateRestrictByGroup()},updateRestrictByGroup:function(){var i,t,e,a;this.restrictByGroup&&("&"!==this.rootList.getValue().op||(this.rootList.hasItemOfType("group")||this.rootList.hasItemOfType("grouping"))?this.restrictByGroup.set("disabled",!0):(i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),i&&0!==Number(i.get("value"))&&e||t&&0!==Number(t.get("value"))&&a?this.restrictByGroup.set("disabled",!1):this.restrictByGroup.set("disabled",!0)))},addRestrictByGroup:function(i){var t,e,a,l;i.preventDefault(),i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),t&&0!==Number(t.get("value"))&&a?l=new M.core_availability.Item({type:"grouping",id:Number(t.get("value"))},!0):i&&e&&(l=new M.core_availability.Item({type:"group"},!0)),null!==l&&(this.rootList.addChild(l),this.update(),this.rootList.renumber(),this.rootList.updateHtml())}},M.core_availability.plugin={allowAdd:!1,init:function(i,t,e){i=i.replace(/^availability_/,"");this.allowAdd=t,(M.core_availability.form.plugins[i]=this).initInner.apply(this,e)},initInner:function(){},getNode:function(){throw"getNode not implemented"},fillValue:function(){throw"fillValue not implemented"},fillErrors:function(){},focusAfterAdd:function(i){i.one("input:not([disabled]),select:not([disabled])").focus()}},M.core_availability.List=function(i,t,e){var a,l,n;if(this.children=[],t!==undefined&&(this.root=t),this.node=d.Node.create('

'+M.util.get_string("listheader_sign_before","availability")+' '+M.util.get_string("listheader_single","availability")+''+M.util.get_string("listheader_multi_before","availability")+' "+M.util.get_string("listheader_multi_after","availability")+'
'+M.util.get_string("none","moodle")+'
'),t||this.node.addClass("availability-childlist d-sm-flex align-items-center"),this.inner=this.node.one("> .availability-inner"),a=!0,t?(i&&i.show!==undefined&&(a=i.show),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.span,"before"),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.disabledSpan,"before"),this.on("availability:privateRuleSet",function(i){i.target.getDOMNode().dataset["private"]=!0,this.updatePrivateStatus()}),this.on("availability:privateRuleUnset",function(i){delete i.target.getDOMNode().dataset["private"],this.updatePrivateStatus()})):e&&(i&&i.showc!==undefined&&(a=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.inner.insert(this.eyeIcon.span,"before"),this.inner.insert(this.eyeIcon.disabledSpan,"before")),t||(e=new M.core_availability.DeleteIcon(this),(a=this.node.one(".availability-none")).appendChild(document.createTextNode(" ")),a.appendChild(e.span),a.appendChild(d.Node.create(''+M.util.get_string("invalid","availability")+""))),(t=d.Node.create('")).on("click",function(){ this.clickAdd()},this),this.node.one("div.availability-button").appendChild(t),i){switch(i.op){case"&":case"|":this.node.one(".availability-neg").set("value","");break;case"!&":case"!|":this.node.one(".availability-neg").set("value","!")}switch(i.op){case"&":case"!&":this.node.one(".availability-op").set("value","&");break;case"|":case"!|":this.node.one(".availability-op").set("value","|")}for(l=0;l')),this.children.push(i),i.addTarget(this),this.inner.one(".availability-children").appendChild(i.node)},M.core_availability.List.prototype.focusAfterAdd=function(){this.inner.one("button").focus()},M.core_availability.List.prototype.isIndividualShowIcons=function(){var i,t;if(!this.root)throw"Can only call this on root list";return i="!"===this.node.one(".availability-neg").get("value"),t="|"===this.node.one(".availability-op").get("value"),!i&&!t||i&&t},M.core_availability.List.prototype.renumber=function(i){var t,e={count:this.children.length},a=i===undefined?e.number="":(e.number=i+":",i+"."),e=M.util.get_string("setheading","availability",e);for(this.node.one("> h3").set("innerHTML",e),this.node.one("> h3").getDOMNode().dataset.restrictionOrder=i||"root",t=0;t .availability-children").removeAttribute("aria-hidden"),this.inner.one("> .availability-none").setAttribute("aria-hidden","true"),this.inner.one("> .availability-header").removeAttribute("aria-hidden"),1 .availability-children").setAttribute("aria-hidden","true"),this.inner.one("> .availability-none").removeAttribute("aria-hidden"),this.inner.one("> .availability-header").setAttribute("aria-hidden","true")),this.root){for(i=this.isIndividualShowIcons(),t=0;t .availability-children > .availability-connector span.label").each(function(i){i.set("innerHTML",a)})},M.core_availability.List.prototype.deleteDescendant=function(i){for(var t,e,a=0;a .availability-children").removeChild(e),M.core_availability.form.update(),this.updateHtml(),this.inner.one("> .availability-button").one("button").focus(),!0;if(t instanceof M.core_availability.List&&t.deleteDescendant(i))return!0}return!1},M.core_availability.List.prototype.clickAdd=function(){var i,t,e,a,l,n=d.Node.create('
    "),o=n.one("button"),s={dialog:null},r=n.one("ul");for(l in M.core_availability.form.plugins)M.core_availability.form.plugins[l].allowAdd&&(i=d.Node.create('
  • '),(e=d.Node.create('
    ")).on("click",this.getAddHandler(l,s),this),i.appendChild(e),a=d.Node.create('
    "),i.appendChild(a),r.appendChild(i));i=d.Node.create('
  • '),(e=d.Node.create('
    ")).on("click",this.getAddHandler(null,s),this),i.appendChild(e),a=d.Node.create('
    "),i.appendChild(a),r.appendChild(i),n={headerContent:M.util.get_string("addrestriction","availability"),bodyContent:n,additionalBaseClass:"availability-dialogue",draggable:!0,modal:!0,closeButton:!1,width:"450px"}, -s.dialog=new M.core.dialogue(n),s.dialog.show(),o.on("click",function(){s.dialog.destroy(),this.inner.one("> .availability-button").one("button").focus()},this)},M.core_availability.List.prototype.getAddHandler=function(t,e){return function(){var i=t?new M.core_availability.Item({type:t,creating:!0},this.root):new M.core_availability.List({c:[],showc:!0},!1,this.root);this.addChild(i),M.core_availability.form.update(),M.core_availability.form.rootList.renumber(),this.updateHtml(),e.dialog.destroy(),i.focusAfterAdd()}},M.core_availability.List.prototype.getValue=function(){var i,t,e={};for(e.op=this.node.one(".availability-neg").get("value")+this.node.one(".availability-op").get("value"),e.c=[],i=0;i'+M.util.get_string("missingplugin","availability")+"")):(this.plugin=M.core_availability.form.plugins[i.type],this.pluginNode=this.plugin.getNode(i),this.pluginNode.addClass("availability_"+i.type)),d.augment(this.pluginNode,d.EventTarget,!0,null,{emitFacade:!0}),this.pluginNode.addTarget(this),this.node=d.Node.create('

    '),t&&(t=!0,i.showc!==undefined&&(t=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!0,t),this.node.appendChild(this.eyeIcon.span),this.node.appendChild(this.eyeIcon.disabledSpan)),this.pluginNode.addClass("availability-plugincontrols"),this.node.appendChild(this.pluginNode),i=new M.core_availability.DeleteIcon(this),this.node.appendChild(i.span),this.node.appendChild(document.createTextNode(" ")),this.node.appendChild(d.Node.create(''))},d.augment(M.core_availability.Item,d.EventTarget,!0,null,{emitFacade:!0}),M.core_availability.Item.prototype.getValue=function(){var i={type:this.pluginType};return this.plugin&&this.plugin.fillValue(i,this.pluginNode),i},M.core_availability.Item.prototype.fillErrors=function(i){var t,e,a,l=i.length;this.plugin?this.plugin.fillErrors(i,this.pluginNode):i.push("core_availability:item_unknowntype"),t=this.node.one("> .badge-warning"),i.length===l||t.get("firstChild")?i.length===l&&t.get("firstChild")&&t.get("firstChild").remove():(l="",e=(i=i[i.length-1].split(":"))[0],a="[["+(i=i[1])+","+e+"]]",(l=M.util.get_string(i,e))===a&&(l=M.util.get_string("invalid","availability")),t.appendChild(document.createTextNode(l)))},M.core_availability.Item.prototype.renumber=function(i){var t={number:i};this.plugin?t.type=M.util.get_string("title","availability_"+this.pluginType):t.type="["+this.pluginType+"]",t.number=i+":",t=M.util.get_string("itemheading","availability",t),this.node.one("> h3").set("innerHTML",t),this.node.one("> h3").getDOMNode().dataset.restrictionOrder=i||"root"},M.core_availability.Item.prototype.focusAfterAdd=function(){this.plugin.focusAfterAdd(this.pluginNode)},M.core_availability.Item.prototype.pluginType=null,M.core_availability.Item.prototype.plugin=null,M.core_availability.Item.prototype.eyeIcon=null,M.core_availability.Item.prototype.node=null,M.core_availability.Item.prototype.pluginNode=null,M.core_availability.EyeIcon=function(i,t){var e,a,l,n;this.individual=i,this.span=d.Node.create(''),e=d.Node.create(""),this.span.appendChild(e),a=i?"_individual":"_all",l=function(){var i=M.util.get_string("hidden"+a,"availability");e.set("src",M.util.image_url("i/show","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("show_verb","availability"))},n=function(){var i=M.util.get_string("shown"+a,"availability");e.set("src",M.util.image_url("i/hide","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("hide_verb","availability"))},(t?n:l).call(this),this.span.on("click",i=function(i){i.preventDefault(),(this.isHidden()?n:l).call(this),M.core_availability.form.update()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this),this.disabledSpan=d.Node.create(''),t=d.Node.create(""),i=M.util.get_string("hidden"+a,"availability"),t.set("src",M.util.image_url("i/show","core")),t.set("alt",i),this.disabledSpan.set("title",i+" • "+M.util.get_string("disabled_verb","availability")), +s.dialog=new M.core.dialogue(n),s.dialog.show(),o.on("click",function(){s.dialog.destroy(),this.inner.one("> .availability-button").one("button").focus()},this)},M.core_availability.List.prototype.getAddHandler=function(t,e){return function(){var i=t?new M.core_availability.Item({type:t,creating:!0},this.root):new M.core_availability.List({c:[],showc:!0},!1,this.root);this.addChild(i),M.core_availability.form.update(),M.core_availability.form.rootList.renumber(),this.updateHtml(),e.dialog.destroy(),i.focusAfterAdd()}},M.core_availability.List.prototype.getValue=function(){var i,t,e={};for(e.op=this.node.one(".availability-neg").get("value")+this.node.one(".availability-op").get("value"),e.c=[],i=0;i'+M.util.get_string("missingplugin","availability")+"")):(this.plugin=M.core_availability.form.plugins[i.type],this.pluginNode=this.plugin.getNode(i),this.pluginNode.addClass("availability_"+i.type)),d.augment(this.pluginNode,d.EventTarget,!0,null,{emitFacade:!0}),this.pluginNode.addTarget(this),this.node=d.Node.create('

    '),t&&(t=!0,i.showc!==undefined&&(t=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!0,t),this.node.appendChild(this.eyeIcon.span),this.node.appendChild(this.eyeIcon.disabledSpan)),this.pluginNode.addClass("availability-plugincontrols"),this.node.appendChild(this.pluginNode),i=new M.core_availability.DeleteIcon(this),this.node.appendChild(i.span),this.node.appendChild(document.createTextNode(" ")),this.node.appendChild(d.Node.create(''))},d.augment(M.core_availability.Item,d.EventTarget,!0,null,{emitFacade:!0}),M.core_availability.Item.prototype.getValue=function(){var i={type:this.pluginType};return this.plugin&&this.plugin.fillValue(i,this.pluginNode),i},M.core_availability.Item.prototype.fillErrors=function(i){var t,e,a,l=i.length;this.plugin?this.plugin.fillErrors(i,this.pluginNode):i.push("core_availability:item_unknowntype"),t=this.node.one("> .bg-warning"),i.length===l||t.get("firstChild")?i.length===l&&t.get("firstChild")&&t.get("firstChild").remove():(l="",e=(i=i[i.length-1].split(":"))[0],a="[["+(i=i[1])+","+e+"]]",(l=M.util.get_string(i,e))===a&&(l=M.util.get_string("invalid","availability")),t.appendChild(document.createTextNode(l)))},M.core_availability.Item.prototype.renumber=function(i){var t={number:i};this.plugin?t.type=M.util.get_string("title","availability_"+this.pluginType):t.type="["+this.pluginType+"]",t.number=i+":",t=M.util.get_string("itemheading","availability",t),this.node.one("> h3").set("innerHTML",t),this.node.one("> h3").getDOMNode().dataset.restrictionOrder=i||"root"},M.core_availability.Item.prototype.focusAfterAdd=function(){this.plugin.focusAfterAdd(this.pluginNode)},M.core_availability.Item.prototype.pluginType=null,M.core_availability.Item.prototype.plugin=null,M.core_availability.Item.prototype.eyeIcon=null,M.core_availability.Item.prototype.node=null,M.core_availability.Item.prototype.pluginNode=null,M.core_availability.EyeIcon=function(i,t){var e,a,l,n;this.individual=i,this.span=d.Node.create('
    '),e=d.Node.create(""),this.span.appendChild(e),a=i?"_individual":"_all",l=function(){var i=M.util.get_string("hidden"+a,"availability");e.set("src",M.util.image_url("i/show","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("show_verb","availability"))},n=function(){var i=M.util.get_string("shown"+a,"availability");e.set("src",M.util.image_url("i/hide","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("hide_verb","availability"))},(t?n:l).call(this),this.span.on("click",i=function(i){i.preventDefault(),(this.isHidden()?n:l).call(this),M.core_availability.form.update()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this),this.disabledSpan=d.Node.create(''),t=d.Node.create(""),i=M.util.get_string("hidden"+a,"availability"),t.set("src",M.util.image_url("i/show","core")),t.set("alt",i),this.disabledSpan.set("title",i+" • "+M.util.get_string("disabled_verb","availability")), this.disabledSpan.appendChild(t),this.disabledSpan.hide()},M.core_availability.EyeIcon.prototype.individual=!1,M.core_availability.EyeIcon.prototype.span=null,M.core_availability.EyeIcon.prototype.disabledSpan=null,M.core_availability.EyeIcon.prototype.isHidden=function(){var i=this.individual?"_individual":"_all",i=M.util.get_string("hidden"+i,"availability");return this.span.one("img").get("alt")===i},M.core_availability.EyeIcon.prototype.isDisabled=function(){return this.span.hasAttribute("hidden")},M.core_availability.EyeIcon.prototype.setDisabled=function(){this.isDisabled()||(this.span.hide(),this.disabledSpan.show())},M.core_availability.EyeIcon.prototype.setEnabled=function(){this.isDisabled()&&(this.span.show(),this.disabledSpan.hide())},M.core_availability.DeleteIcon=function(t){var i;this.span=d.Node.create(''),i=d.Node.create(''+M.util.get_string('),this.span.appendChild(i),this.span.on("click",i=function(i){i.preventDefault(),M.core_availability.form.rootList.deleteDescendant(t),M.core_availability.form.rootList.renumber()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this)},M.core_availability.DeleteIcon.prototype.span=null},"@VERSION@",{requires:["base","node","event","event-delegate","panel","moodle-core-notification-dialogue","json"]}); \ No newline at end of file diff --git a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js index f912b243ed4..3366368971f 100644 --- a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js +++ b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js @@ -436,7 +436,7 @@ M.core_availability.List = function(json, root, parentRoot) { noneNode.appendChild(deleteIcon.span); // Also if it's not the root, none is actually invalid, so add a label. - noneNode.appendChild(Y.Node.create('' + + noneNode.appendChild(Y.Node.create('' + M.util.get_string('invalid', 'availability') + '')); } @@ -1002,7 +1002,7 @@ M.core_availability.Item = function(json, root) { // Add the invalid marker (empty). this.node.appendChild(document.createTextNode(' ')); - this.node.appendChild(Y.Node.create('')); + this.node.appendChild(Y.Node.create('')); }; 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'); } // 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')) { var errorString = ''; // Fetch the last error code from the array of errors and split using the ':' delimiter. diff --git a/availability/yui/src/form/js/form.js b/availability/yui/src/form/js/form.js index 8306fa699ef..d815eafbb01 100644 --- a/availability/yui/src/form/js/form.js +++ b/availability/yui/src/form/js/form.js @@ -434,7 +434,7 @@ M.core_availability.List = function(json, root, parentRoot) { noneNode.appendChild(deleteIcon.span); // Also if it's not the root, none is actually invalid, so add a label. - noneNode.appendChild(Y.Node.create('' + + noneNode.appendChild(Y.Node.create('' + M.util.get_string('invalid', 'availability') + '')); } @@ -1000,7 +1000,7 @@ M.core_availability.Item = function(json, root) { // Add the invalid marker (empty). this.node.appendChild(document.createTextNode(' ')); - this.node.appendChild(Y.Node.create('')); + this.node.appendChild(Y.Node.create('')); }; 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'); } // 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')) { var errorString = ''; // Fetch the last error code from the array of errors and split using the ':' delimiter. diff --git a/blocks/myoverview/templates/view-list.mustache b/blocks/myoverview/templates/view-list.mustache index bfb1a539c58..68511467b55 100644 --- a/blocks/myoverview/templates/view-list.mustache +++ b/blocks/myoverview/templates/view-list.mustache @@ -80,7 +80,7 @@ {{/showcoursecategory}} {{^visible}}
    - {{#str}} hiddenfromstudents {{/str}} + {{#str}} hiddenfromstudents {{/str}}
    {{/visible}} {{#hasprogress}} diff --git a/blocks/myoverview/templates/view-summary.mustache b/blocks/myoverview/templates/view-summary.mustache index 50c6d2fc8ea..367d6c60cea 100644 --- a/blocks/myoverview/templates/view-summary.mustache +++ b/blocks/myoverview/templates/view-summary.mustache @@ -82,7 +82,7 @@ {{/coursecategory}} {{^visible}}
    - {{#str}} hiddenfromstudents {{/str}} + {{#str}} hiddenfromstudents {{/str}}
    {{/visible}}
    diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index a66e29c802b..7dab31f39ee 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -61,7 +61,7 @@ class block_site_main_menu extends block_list { $controlmenuclass = $format->get_output_classname('content\\cm\\controlmenu'); $badgeattributes = [ - 'class' => 'badge badge-pill badge-warning mt-2', + 'class' => 'badge rounded-pill bg-warning text-dark mt-2', 'data-region' => 'visibility' ]; diff --git a/blocks/social_activities/block_social_activities.php b/blocks/social_activities/block_social_activities.php index d964b528bfa..b2dbe40c345 100644 --- a/blocks/social_activities/block_social_activities.php +++ b/blocks/social_activities/block_social_activities.php @@ -62,7 +62,7 @@ class block_social_activities extends block_list { $controlmenuclass = $format->get_output_classname('content\\cm\\controlmenu'); $badgeattributes = [ - 'class' => 'badge badge-pill badge-warning mt-2', + 'class' => 'badge rounded-pill bg-warning text-dark mt-2', 'data-region' => 'visibility' ]; diff --git a/blocks/timeline/templates/event-list-item.mustache b/blocks/timeline/templates/event-list-item.mustache index 13f28089897..6979e39fea5 100644 --- a/blocks/timeline/templates/event-list-item.mustache +++ b/blocks/timeline/templates/event-list-item.mustache @@ -67,7 +67,7 @@
    - {{#overdue}}{{#str}} overdue, block_timeline {{/str}}{{/overdue}} + {{#overdue}}{{#str}} overdue, block_timeline {{/str}}{{/overdue}} @@ -93,7 +93,7 @@ title="{{action.name}}"> {{{action.name}}} {{#action.showitemcount}} - {{action.itemcount}} + {{action.itemcount}} {{/action.showitemcount}}
    diff --git a/course/format/classes/output/activitybadge.php b/course/format/classes/output/activitybadge.php index 33d41dca5a3..e8eebfd0ed4 100644 --- a/course/format/classes/output/activitybadge.php +++ b/course/format/classes/output/activitybadge.php @@ -37,10 +37,10 @@ abstract class activitybadge implements named_templatable, \renderable { /** @var array Badge defined styles. */ public const STYLES = [ 'none' => 'badge-none', - 'dark' => 'badge-dark', - 'danger' => 'badge-danger', - 'warning' => 'badge-warning', - 'info' => 'badge-info', + 'dark' => 'bg-dark text-white', + 'danger' => 'bg-danger text-white', + 'warning' => 'bg-warning text-dark', + 'info' => 'bg-info text-white', ]; /** @var cm_info The course module information. */ diff --git a/course/format/templates/local/content/cm.mustache b/course/format/templates/local/content/cm.mustache index a336a2786ab..df7f87d7214 100644 --- a/course/format/templates/local/content/cm.mustache +++ b/course/format/templates/local/content/cm.mustache @@ -25,9 +25,9 @@ "displayvalue" : "Activity example" }, "hasname": "true", - "afterlink": "30 unread messages", + "afterlink": "30 unread messages", "hasextras": true, - "extras": ["[extras]"], + "extras": ["[extras]"], "activityinfo": { "hasmodavailability": true, "activityname": "Activity example", diff --git a/course/format/templates/local/content/cm/activity.mustache b/course/format/templates/local/content/cm/activity.mustache index b82fc5d5117..8bd20c4b92d 100644 --- a/course/format/templates/local/content/cm/activity.mustache +++ b/course/format/templates/local/content/cm/activity.mustache @@ -43,7 +43,7 @@ ] }, "hasextras": true, - "extras": ["[extras]"], + "extras": ["[extras]"], "activityinfo": { "hasmodavailability": true, "activityname": "Activity example", diff --git a/course/format/templates/local/content/cm/activitybadge.mustache b/course/format/templates/local/content/cm/activitybadge.mustache index 76e39c7c680..0d80822e971 100644 --- a/course/format/templates/local/content/cm/activitybadge.mustache +++ b/course/format/templates/local/content/cm/activitybadge.mustache @@ -44,7 +44,7 @@ class="ml-1" {{#badgeextraattributes}} {{name}}="{{value}}" {{/badgeextraattributes}} > - + {{#badgeurl}} {{badgecontent}} {{/badgeurl}} diff --git a/course/format/templates/local/content/cm/availability.mustache b/course/format/templates/local/content/cm/availability.mustache index 98ea2b2d5b5..dc6ccc60877 100644 --- a/course/format/templates/local/content/cm/availability.mustache +++ b/course/format/templates/local/content/cm/availability.mustache @@ -38,7 +38,7 @@ {{#info}}
    {{^isrestricted}} - {{{text}}} + {{{text}}} {{/isrestricted}} {{#isrestricted}} {{> core_courseformat/local/content/availability }} diff --git a/course/format/templates/local/content/cm/visibility.mustache b/course/format/templates/local/content/cm/visibility.mustache index 3ec4e089f3a..809c716b1c0 100644 --- a/course/format/templates/local/content/cm/visibility.mustache +++ b/course/format/templates/local/content/cm/visibility.mustache @@ -67,7 +67,7 @@
    {{#dropwdown}} {{< 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}} {{/dropwdown}}
    @@ -75,12 +75,12 @@ {{^isInteractive}} {{#modhiddenfromstudents}}
    - {{#pix}}i/show, core{{/pix}}{{#str}}hiddenfromstudents{{/str}} + {{#pix}}i/show, core{{/pix}}{{#str}}hiddenfromstudents{{/str}}
    {{/modhiddenfromstudents}} {{#modstealth}}
    - {{#pix}}t/stealth, core{{/pix}}{{#str}}hiddenoncoursepage{{/str}} + {{#pix}}t/stealth, core{{/pix}}{{#str}}hiddenoncoursepage{{/str}}
    {{/modstealth}} {{/isInteractive}} diff --git a/course/format/templates/local/content/section.mustache b/course/format/templates/local/content/section.mustache index fe1a39a968d..706d40e8408 100644 --- a/course/format/templates/local/content/section.mustache +++ b/course/format/templates/local/content/section.mustache @@ -66,7 +66,7 @@ "iscurrent": true, "currentlink": "This topic", "availability": { - "info": "Hidden from students", + "info": "Hidden from students", "hasavailability": true }, "summary": { diff --git a/course/format/templates/local/content/section/availability.mustache b/course/format/templates/local/content/section/availability.mustache index 8779073f179..e0a479d1667 100644 --- a/course/format/templates/local/content/section/availability.mustache +++ b/course/format/templates/local/content/section/availability.mustache @@ -38,7 +38,7 @@ {{#info}}
    {{^isrestricted}} - {{{text}}} + {{{text}}} {{/isrestricted}} {{#isrestricted}} {{> core_courseformat/local/content/availability }} diff --git a/course/format/templates/local/content/section/badges.mustache b/course/format/templates/local/content/section/badges.mustache index fdf60889af3..8243a281dc4 100644 --- a/course/format/templates/local/content/section/badges.mustache +++ b/course/format/templates/local/content/section/badges.mustache @@ -30,24 +30,24 @@ } }} {{#editing}} - + {{ highlightedlabel }} - + {{#str}}hiddenfromstudents{{/str}} - + {{#str}}notavailable{{/str}} {{/editing}} {{^editing}} {{#iscurrent}} - {{ highlightedlabel }} + {{ highlightedlabel }} {{/iscurrent}} {{#hiddenfromstudents}} - {{#str}}hiddenfromstudents{{/str}} + {{#str}}hiddenfromstudents{{/str}} {{/hiddenfromstudents}} {{#notavailable}} - {{#str}}notavailable{{/str}} + {{#str}}notavailable{{/str}} {{/notavailable}} {{/editing}} diff --git a/course/format/templates/local/content/section/cmitem.mustache b/course/format/templates/local/content/section/cmitem.mustache index 611620a8704..be1cba56a30 100644 --- a/course/format/templates/local/content/section/cmitem.mustache +++ b/course/format/templates/local/content/section/cmitem.mustache @@ -26,10 +26,10 @@ "hasname": "true", "moveicon": "[Move]", "indent": 2, - "afterlink": "30 unread messages", + "afterlink": "30 unread messages", "hasextras": true, - "extras": ["[extras]"], - "completion": "Completed!" + "extras": ["[extras]"], + "completion": "Completed!" }, "id": 3, "anchor": "module-3", diff --git a/course/format/templates/local/content/section/content.mustache b/course/format/templates/local/content/section/content.mustache index 832b1b508fd..b179c564abc 100644 --- a/course/format/templates/local/content/section/content.mustache +++ b/course/format/templates/local/content/section/content.mustache @@ -65,7 +65,7 @@ "iscurrent": true, "currentlink": "This topic", "availability": { - "info": "Hidden from students", + "info": "Hidden from students", "hasavailability": true }, "summary": { diff --git a/course/format/templates/local/courseindex/section.mustache b/course/format/templates/local/courseindex/section.mustache index d32f27109eb..ca9186f84a8 100644 --- a/course/format/templates/local/courseindex/section.mustache +++ b/course/format/templates/local/courseindex/section.mustache @@ -98,7 +98,7 @@ > {{{title}}} - + {{highlighted}} diff --git a/course/format/tests/output/activitybadge_test.php b/course/format/tests/output/activitybadge_test.php index 3fbd428cc3b..98f2dfe3fdd 100644 --- a/course/format/tests/output/activitybadge_test.php +++ b/course/format/tests/output/activitybadge_test.php @@ -64,7 +64,7 @@ class activitybadge_test extends \advanced_testcase { // The activitybadge for a forum with unread messages shouldn't be empty. $class = activitybadge::create_instance($data->forumunread); $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. $class = activitybadge::create_instance($data->forumread); diff --git a/course/templates/completion_automatic.mustache b/course/templates/completion_automatic.mustache index d2cb4fd2588..240804461be 100644 --- a/course/templates/completion_automatic.mustache +++ b/course/templates/completion_automatic.mustache @@ -29,7 +29,7 @@ }} {{#istrackeduser}} {{#statuscomplete}} -
    {{/statuscomplete}} {{#statuscompletefail}} -
    {{/statuscompletefail}} {{#statusincomplete}} -
    +
    {{description}}
    {{/istrackeduser}} diff --git a/course/templates/coursecard.mustache b/course/templates/coursecard.mustache index b72ee87e45f..a33b0b32f5f 100644 --- a/course/templates/coursecard.mustache +++ b/course/templates/coursecard.mustache @@ -67,7 +67,7 @@
    {{^visible}}
    - {{#str}} hiddenfromstudents {{/str}} + {{#str}} hiddenfromstudents {{/str}}
    {{/visible}}
    diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index e8f0f5245dd..c534472e0d3 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -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. $this->assertEmpty($module['afterlink']); $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( plugin_supports( 'mod', diff --git a/enrol/lti/templates/local/ltiadvantage/registered_platforms.mustache b/enrol/lti/templates/local/ltiadvantage/registered_platforms.mustache index 63a7ee5c97e..98fe3ee0e88 100644 --- a/enrol/lti/templates/local/ltiadvantage/registered_platforms.mustache +++ b/enrol/lti/templates/local/ltiadvantage/registered_platforms.mustache @@ -81,10 +81,10 @@ {{#isactive}} - {{{statusstring}}} + {{{statusstring}}} {{/isactive}} {{^isactive}} - {{{statusstring}}} + {{{statusstring}}} {{/isactive}} diff --git a/grade/report/grader/lang/en/gradereport_grader.php b/grade/report/grader/lang/en/gradereport_grader.php index d808de63450..2b8d854d71d 100644 --- a/grade/report/grader/lang/en/gradereport_grader.php +++ b/grade/report/grader/lang/en/gradereport_grader.php @@ -26,7 +26,7 @@ $string['aria:dropdowncolumns'] = 'Collapsed columns found'; $string['clearall'] = 'Clear all'; $string['clearsearch'] = 'Clear searched users'; -$string['collapsedcolumns'] = 'Collapsed columns {$a}'; +$string['collapsedcolumns'] = 'Collapsed columns {$a}'; $string['editingmode_title'] = 'Editing the grader report'; $string['eventgradereportviewed'] = 'Grader report viewed'; $string['grader:manage'] = 'Manage the grader report'; diff --git a/grade/templates/category_settings.mustache b/grade/templates/category_settings.mustache index 2ebb6576b69..f54fec38984 100644 --- a/grade/templates/category_settings.mustache +++ b/grade/templates/category_settings.mustache @@ -30,32 +30,32 @@ }}
    {{#calculatedgrade}} - + {{calculatedgrade}} {{/calculatedgrade}} {{#aggregation}} - + {{aggregation}} {{/aggregation}} {{#aggregateonlygraded}} - + {{#str}}aggregateonlygraded, grades{{/str}} {{/aggregateonlygraded}} {{#aggregateoutcomes}} - + {{#str}}aggregateoutcomes, grades{{/str}} {{/aggregateoutcomes}} {{#droplow}} - + {{#str}}droplowestvalues, grades, {{droplow}}{{/str}} {{/droplow}} {{#keephigh}} - + {{#str}}keephigh, grades{{/str}} {{/keephigh}} diff --git a/h5p/classes/helper.php b/h5p/classes/helper.php index df5789863f1..32b532e1ea5 100644 --- a/h5p/classes/helper.php +++ b/h5p/classes/helper.php @@ -302,10 +302,10 @@ class helper { string $statusaction = ''): array { $statusclasses = array( - TEXTFILTER_DISABLED => 'badge badge-danger', - TEXTFILTER_OFF => 'badge badge-warning', - 0 => 'badge badge-danger', - TEXTFILTER_ON => 'badge badge-success', + TEXTFILTER_DISABLED => 'badge bg-danger text-white', + TEXTFILTER_OFF => 'badge bg-warning text-dark', + 0 => 'badge bg-danger text-white', + TEXTFILTER_ON => 'badge bg-success text-white', ); $statuschoices = array( diff --git a/h5p/templates/h5ptoolsoverview.mustache b/h5p/templates/h5ptoolsoverview.mustache index 8dd2db53301..e433cdcf564 100644 --- a/h5p/templates/h5ptoolsoverview.mustache +++ b/h5p/templates/h5ptoolsoverview.mustache @@ -25,7 +25,7 @@ "tool_description": "h5ptasks_description", "link": "https://example.com/admin/tool/task/scheduledtasks.php", "status": "On", - "status_class": "bade badge-success", + "status_class": "bade bg-success text-white", "status_action": "Run now" }, { @@ -33,7 +33,7 @@ "tool_description": "h5ptasks_description", "link": "https://example.com/admin/filters.php", "status": "Off", - "status_class": "bade badge-danger" + "status_class": "bade bg-danger text-white" } ] } diff --git a/lib/adminlib.php b/lib/adminlib.php index cab188c99d5..a370b5d86ac 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -10034,7 +10034,7 @@ class admin_setting_webservicesoverview extends admin_setting { $url = new moodle_url("/admin/search.php?query=enablewebservices"); $row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'), 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) { $status = get_string('yes'); } @@ -10047,7 +10047,7 @@ class admin_setting_webservicesoverview extends admin_setting { $url = new moodle_url("/admin/settings.php?section=webserviceprotocols"); $row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'), 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 $active_protocols = empty($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"); $row[0] = "1. " . html_writer::tag('a', get_string('enablews', 'webservice'), 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) { $status = get_string('yes'); } @@ -10171,7 +10171,7 @@ class admin_setting_webservicesoverview extends admin_setting { $url = new moodle_url("/admin/settings.php?section=webserviceprotocols"); $row[0] = "2. " . html_writer::tag('a', get_string('enableprotocols', 'webservice'), 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 $active_protocols = empty($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'), 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)) { $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; @@ -11216,9 +11216,9 @@ class admin_setting_searchsetupinfo extends admin_setting { $row[0] = '2. ' . html_writer::tag('a', get_string('enablesearchareas', 'admin'), 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) { - $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; @@ -11228,7 +11228,7 @@ class admin_setting_searchsetupinfo extends admin_setting { $row = array(); if (empty($CFG->searchengine)) { $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 { if ($ADMIN->locate('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(); } 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 { - $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; } @@ -11258,9 +11258,9 @@ class admin_setting_searchsetupinfo extends admin_setting { $url = new moodle_url('/admin/searchareas.php'); $row[0] = '4. ' . html_writer::tag('a', get_string('indexdata', 'admin'), array('href' => $url)); 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 { - $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; $table->data[] = $row; @@ -11270,9 +11270,9 @@ class admin_setting_searchsetupinfo extends admin_setting { $url = new moodle_url("/admin/search.php?query=enableglobalsearch"); $row[0] = '5. ' . html_writer::tag('a', get_string('enableglobalsearch', 'admin'), 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()) { - $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; $table->data[] = $row; @@ -11282,9 +11282,9 @@ class admin_setting_searchsetupinfo extends admin_setting { $url = new moodle_url("/admin/search.php?query=searchincludeallcourses"); $row[0] = '6. ' . html_writer::tag('a', get_string('replacefrontsearch', 'admin'), 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()) { - $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; $table->data[] = $row; diff --git a/lib/classes/moodlenet/share_progress_table.php b/lib/classes/moodlenet/share_progress_table.php index c69afb864d8..b1ca5fbbc3e 100644 --- a/lib/classes/moodlenet/share_progress_table.php +++ b/lib/classes/moodlenet/share_progress_table.php @@ -180,11 +180,11 @@ class share_progress_table extends table_sql { protected function col_status(stdClass $row): string { // Display a badge indicating the status of the share. 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) { - $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) { - $status = html_writer::span(get_string('error'), 'badge badge-danger'); + $status = html_writer::span(get_string('error'), 'badge bg-danger text-white'); } return $status; diff --git a/lib/datalib.php b/lib/datalib.php index 2dbaae9cf9a..eac742b6ae2 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1815,7 +1815,7 @@ function print_object($item, array $expandclasses = ['/./'], bool $textonly = fa $out .= '[' . get_class($item) . ']'; } else { // Objects display the class name as a badge. Content goes within a
    . - $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::start_tag('dl', ['class' => 'row']); $dl = true; @@ -1832,7 +1832,7 @@ function print_object($item, array $expandclasses = ['/./'], bool $textonly = fa $out .= $arrayinfo; } else { // 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
    tag - only if there is some content. $dl = count($item) > 0; $attributes = []; diff --git a/lib/form/templates/element-tags-inline.mustache b/lib/form/templates/element-tags-inline.mustache index f0ab194f161..0c618127a16 100644 --- a/lib/form/templates/element-tags-inline.mustache +++ b/lib/form/templates/element-tags-inline.mustache @@ -16,7 +16,7 @@ {{/element.frozen}} {{#element.frozen}} {{#element.options}} - {{#selected}}{{{text}}}{{/selected}} + {{#selected}}{{{text}}}{{/selected}} {{/element.options}} {{/element.frozen}} {{#element.managestandardtagsurl}} diff --git a/lib/form/templates/element-tags.mustache b/lib/form/templates/element-tags.mustache index a92bba7c21f..0e3fa970229 100644 --- a/lib/form/templates/element-tags.mustache +++ b/lib/form/templates/element-tags.mustache @@ -16,7 +16,7 @@ {{/element.frozen}} {{#element.frozen}} {{#element.options}} - {{#selected}}{{{text}}}{{/selected}} + {{#selected}}{{{text}}}{{/selected}} {{/element.options}} {{/element.frozen}} {{#element.managestandardtagsurl}} diff --git a/lib/templates/check/result/critical.mustache b/lib/templates/check/result/critical.mustache index c4c2e5a965f..da1fec9fa9e 100644 --- a/lib/templates/check/result/critical.mustache +++ b/lib/templates/check/result/critical.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/check/result/error.mustache b/lib/templates/check/result/error.mustache index 29dcbc09068..d98b206a73c 100644 --- a/lib/templates/check/result/error.mustache +++ b/lib/templates/check/result/error.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/check/result/info.mustache b/lib/templates/check/result/info.mustache index c0b4eadfd95..d08871524fe 100644 --- a/lib/templates/check/result/info.mustache +++ b/lib/templates/check/result/info.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/check/result/na.mustache b/lib/templates/check/result/na.mustache index 348e5787454..66edeb713f5 100644 --- a/lib/templates/check/result/na.mustache +++ b/lib/templates/check/result/na.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/check/result/ok.mustache b/lib/templates/check/result/ok.mustache index dfafcb2eb63..8b94add839a 100644 --- a/lib/templates/check/result/ok.mustache +++ b/lib/templates/check/result/ok.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/check/result/unknown.mustache b/lib/templates/check/result/unknown.mustache index 959e6a940c5..0554340cde3 100644 --- a/lib/templates/check/result/unknown.mustache +++ b/lib/templates/check/result/unknown.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/check/result/warning.mustache b/lib/templates/check/result/warning.mustache index 99926dc65e3..90023c6e2a5 100644 --- a/lib/templates/check/result/warning.mustache +++ b/lib/templates/check/result/warning.mustache @@ -33,4 +33,4 @@ Example context (json): { "status": "OK"} }} -{{status}} +{{status}} diff --git a/lib/templates/checkbox-toggleall-master.mustache b/lib/templates/checkbox-toggleall-master.mustache index 255b9e1377a..50b4cad1203 100644 --- a/lib/templates/checkbox-toggleall-master.mustache +++ b/lib/templates/checkbox-toggleall-master.mustache @@ -34,7 +34,7 @@ "classes": "p-1", "selectall": "Select all", "deselectall": "Deselect all", - "labelclasses": "badge badge-info" + "labelclasses": "badge bg-info text-white" } }}
    diff --git a/lib/templates/checkbox-toggleall-slave.mustache b/lib/templates/checkbox-toggleall-slave.mustache index d68ba8e9540..3038c4cc6bc 100644 --- a/lib/templates/checkbox-toggleall-slave.mustache +++ b/lib/templates/checkbox-toggleall-slave.mustache @@ -32,7 +32,7 @@ "label": "Select me!", "checked": true, "classes": "p-1", - "labelclasses": "badge badge-info" + "labelclasses": "badge bg-info text-white" } }} + class="badge bg-secondary text-dark clickable text-wrap text-break line-height-4 m-1"> {{{label}}} {{/items}} diff --git a/lib/templates/form_autocomplete_selection_items.mustache b/lib/templates/form_autocomplete_selection_items.mustache index bb09959abef..3740b4a094b 100644 --- a/lib/templates/form_autocomplete_selection_items.mustache +++ b/lib/templates/form_autocomplete_selection_items.mustache @@ -38,7 +38,7 @@ ], "noSelectionString": "No selection" } }} {{#items}} - + {{{label}}} {{/items}} diff --git a/message/output/popup/templates/message_content_item.mustache b/message/output/popup/templates/message_content_item.mustache index 33663352ff6..fe69d8af58b 100644 --- a/message/output/popup/templates/message_content_item.mustache +++ b/message/output/popup/templates/message_content_item.mustache @@ -69,7 +69,7 @@

    - {{unreadcount}} + {{unreadcount}}
    diff --git a/message/templates/message_drawer_conversations_list.mustache b/message/templates/message_drawer_conversations_list.mustache index cbe3e0eecc1..2997d848bb8 100644 --- a/message/templates/message_drawer_conversations_list.mustache +++ b/message/templates/message_drawer_conversations_list.mustache @@ -98,7 +98,7 @@
    diff --git a/message/templates/message_drawer_messages_list.mustache b/message/templates/message_drawer_messages_list.mustache index 866c30e7078..cf25888cd8a 100644 --- a/message/templates/message_drawer_messages_list.mustache +++ b/message/templates/message_drawer_messages_list.mustache @@ -91,7 +91,7 @@
    {{unreadcount}} diff --git a/message/templates/message_drawer_view_contacts_body.mustache b/message/templates/message_drawer_view_contacts_body.mustache index b945acf98af..f27267bee35 100644 --- a/message/templates/message_drawer_view_contacts_body.mustache +++ b/message/templates/message_drawer_view_contacts_body.mustache @@ -64,7 +64,7 @@ aria-selected="false" > {{#str}} requests {{/str}} - diff --git a/message/templates/message_drawer_view_overview_header.mustache b/message/templates/message_drawer_view_overview_header.mustache index e8041fdd58f..17ca572ea93 100644 --- a/message/templates/message_drawer_view_overview_header.mustache +++ b/message/templates/message_drawer_view_overview_header.mustache @@ -68,7 +68,7 @@ {{#pix}} i/user, core {{/pix}} {{#str}} contacts, core_message {{/str}} diff --git a/message/templates/message_drawer_view_overview_section.mustache b/message/templates/message_drawer_view_overview_section.mustache index bfa62485333..d3151aff747 100644 --- a/message/templates/message_drawer_view_overview_section.mustache +++ b/message/templates/message_drawer_view_overview_section.mustache @@ -62,7 +62,7 @@ {{> core/loading }} diff --git a/mod/forum/templates/discussion_list.mustache b/mod/forum/templates/discussion_list.mustache index 13e5309dbc9..e3443865f35 100644 --- a/mod/forum/templates/discussion_list.mustache +++ b/mod/forum/templates/discussion_list.mustache @@ -215,12 +215,12 @@
    - + {{#str}}locked, forum{{/str}} {{#discussion.timed.istimed}} -