From baf15e001f52e760618214cd9f073975bf389dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Fri, 12 Dec 2025 15:15:08 +0100 Subject: [PATCH 1/3] MDL-87444 theme_boost: Adjust icon sizes The iconsizes map value `1` was extremely small and unusable, so values `1` and `2` have been updated to provide usable icon sizes in the UI. --- public/theme/boost/scss/moodle/buttons.scss | 4 +- public/theme/boost/scss/moodle/icons.scss | 8 +-- public/theme/boost/style/moodle.css | 56 ++++++++++----------- public/theme/classic/style/moodle.css | 56 ++++++++++----------- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/public/theme/boost/scss/moodle/buttons.scss b/public/theme/boost/scss/moodle/buttons.scss index 935c6e2a19e..fd44853e520 100644 --- a/public/theme/boost/scss/moodle/buttons.scss +++ b/public/theme/boost/scss/moodle/buttons.scss @@ -98,8 +98,8 @@ p.arrow_button { } @each $size, $length in $iconsizes { &.icon-size-#{$size} { - height: calc(#{$length} + 1rem); - width: calc(#{$length} + 1rem); + height: calc(#{$length} * 2); + width: calc(#{$length} * 2); --#{$prefix}btn-font-size: #{$length}; --#{$prefix}btn-line-height: #{$length}; } diff --git a/public/theme/boost/scss/moodle/icons.scss b/public/theme/boost/scss/moodle/icons.scss index 5ab96f6eb4a..d9b64a9ae7d 100644 --- a/public/theme/boost/scss/moodle/icons.scss +++ b/public/theme/boost/scss/moodle/icons.scss @@ -18,8 +18,8 @@ $icon-box-height: 48px; $iconsizes: () !default; $iconsizes: map-merge(( 0: 0, - 1: ($icon-height * .25), - 2: ($icon-height * .5), + 1: ($icon-height * .5), + 2: ($icon-height * .75), 3: $icon-height, 4: ($icon-height * 1.5), 5: ($icon-height * 2), @@ -29,8 +29,8 @@ $iconsizes: map-merge(( $iconwidthsizes: () !default; $iconwidthsizes: map-merge(( 0: 0, - 1: ($icon-width * .25), - 2: ($icon-width * .5), + 1: ($icon-width * .5), + 2: ($icon-width * .75), 3: $icon-width, 4: ($icon-width * 1.5), 5: ($icon-width * 2), diff --git a/public/theme/boost/style/moodle.css b/public/theme/boost/style/moodle.css index bbc9fd4626a..ceea982dfbd 100644 --- a/public/theme/boost/style/moodle.css +++ b/public/theme/boost/style/moodle.css @@ -28627,14 +28627,6 @@ img.icon { } .icon-size-1 .icon { - height: 4px !important; /* stylelint-disable-line declaration-no-important */ - width: 5px !important; /* stylelint-disable-line declaration-no-important */ - max-height: 4px !important; /* stylelint-disable-line declaration-no-important */ - max-width: 5px !important; /* stylelint-disable-line declaration-no-important */ - font-size: 4px !important; /* stylelint-disable-line declaration-no-important */ -} - -.icon-size-2 .icon { height: 8px !important; /* stylelint-disable-line declaration-no-important */ width: 10px !important; /* stylelint-disable-line declaration-no-important */ max-height: 8px !important; /* stylelint-disable-line declaration-no-important */ @@ -28642,6 +28634,14 @@ img.icon { font-size: 8px !important; /* stylelint-disable-line declaration-no-important */ } +.icon-size-2 .icon { + height: 12px !important; /* stylelint-disable-line declaration-no-important */ + width: 15px !important; /* stylelint-disable-line declaration-no-important */ + max-height: 12px !important; /* stylelint-disable-line declaration-no-important */ + max-width: 15px !important; /* stylelint-disable-line declaration-no-important */ + font-size: 12px !important; /* stylelint-disable-line declaration-no-important */ +} + .icon-size-3 .icon { height: 16px !important; /* stylelint-disable-line declaration-no-important */ width: 20px !important; /* stylelint-disable-line declaration-no-important */ @@ -37565,50 +37565,50 @@ p.arrow_button { margin: 0; } .btn-icon.icon-size-0 { - height: calc(0 + 1rem); - width: calc(0 + 1rem); + height: calc(0 * 2); + width: calc(0 * 2); --bs-btn-font-size: 0; --bs-btn-line-height: 0; } .btn-icon.icon-size-1 { - height: calc(4px + 1rem); - width: calc(4px + 1rem); - --bs-btn-font-size: 4px; - --bs-btn-line-height: 4px; -} -.btn-icon.icon-size-2 { - height: calc(8px + 1rem); - width: calc(8px + 1rem); + height: calc(8px * 2); + width: calc(8px * 2); --bs-btn-font-size: 8px; --bs-btn-line-height: 8px; } +.btn-icon.icon-size-2 { + height: calc(12px * 2); + width: calc(12px * 2); + --bs-btn-font-size: 12px; + --bs-btn-line-height: 12px; +} .btn-icon.icon-size-3 { - height: calc(16px + 1rem); - width: calc(16px + 1rem); + height: calc(16px * 2); + width: calc(16px * 2); --bs-btn-font-size: 16px; --bs-btn-line-height: 16px; } .btn-icon.icon-size-4 { - height: calc(24px + 1rem); - width: calc(24px + 1rem); + height: calc(24px * 2); + width: calc(24px * 2); --bs-btn-font-size: 24px; --bs-btn-line-height: 24px; } .btn-icon.icon-size-5 { - height: calc(32px + 1rem); - width: calc(32px + 1rem); + height: calc(32px * 2); + width: calc(32px * 2); --bs-btn-font-size: 32px; --bs-btn-line-height: 32px; } .btn-icon.icon-size-6 { - height: calc(40px + 1rem); - width: calc(40px + 1rem); + height: calc(40px * 2); + width: calc(40px * 2); --bs-btn-font-size: 40px; --bs-btn-line-height: 40px; } .btn-icon.icon-size-7 { - height: calc(48px + 1rem); - width: calc(48px + 1rem); + height: calc(48px * 2); + width: calc(48px * 2); --bs-btn-font-size: 48px; --bs-btn-line-height: 48px; } diff --git a/public/theme/classic/style/moodle.css b/public/theme/classic/style/moodle.css index fbd4171896b..c76863f7ecd 100644 --- a/public/theme/classic/style/moodle.css +++ b/public/theme/classic/style/moodle.css @@ -28627,14 +28627,6 @@ img.icon { } .icon-size-1 .icon { - height: 4px !important; /* stylelint-disable-line declaration-no-important */ - width: 5px !important; /* stylelint-disable-line declaration-no-important */ - max-height: 4px !important; /* stylelint-disable-line declaration-no-important */ - max-width: 5px !important; /* stylelint-disable-line declaration-no-important */ - font-size: 4px !important; /* stylelint-disable-line declaration-no-important */ -} - -.icon-size-2 .icon { height: 8px !important; /* stylelint-disable-line declaration-no-important */ width: 10px !important; /* stylelint-disable-line declaration-no-important */ max-height: 8px !important; /* stylelint-disable-line declaration-no-important */ @@ -28642,6 +28634,14 @@ img.icon { font-size: 8px !important; /* stylelint-disable-line declaration-no-important */ } +.icon-size-2 .icon { + height: 12px !important; /* stylelint-disable-line declaration-no-important */ + width: 15px !important; /* stylelint-disable-line declaration-no-important */ + max-height: 12px !important; /* stylelint-disable-line declaration-no-important */ + max-width: 15px !important; /* stylelint-disable-line declaration-no-important */ + font-size: 12px !important; /* stylelint-disable-line declaration-no-important */ +} + .icon-size-3 .icon { height: 16px !important; /* stylelint-disable-line declaration-no-important */ width: 20px !important; /* stylelint-disable-line declaration-no-important */ @@ -37565,50 +37565,50 @@ p.arrow_button { margin: 0; } .btn-icon.icon-size-0 { - height: calc(0 + 1rem); - width: calc(0 + 1rem); + height: calc(0 * 2); + width: calc(0 * 2); --bs-btn-font-size: 0; --bs-btn-line-height: 0; } .btn-icon.icon-size-1 { - height: calc(4px + 1rem); - width: calc(4px + 1rem); - --bs-btn-font-size: 4px; - --bs-btn-line-height: 4px; -} -.btn-icon.icon-size-2 { - height: calc(8px + 1rem); - width: calc(8px + 1rem); + height: calc(8px * 2); + width: calc(8px * 2); --bs-btn-font-size: 8px; --bs-btn-line-height: 8px; } +.btn-icon.icon-size-2 { + height: calc(12px * 2); + width: calc(12px * 2); + --bs-btn-font-size: 12px; + --bs-btn-line-height: 12px; +} .btn-icon.icon-size-3 { - height: calc(16px + 1rem); - width: calc(16px + 1rem); + height: calc(16px * 2); + width: calc(16px * 2); --bs-btn-font-size: 16px; --bs-btn-line-height: 16px; } .btn-icon.icon-size-4 { - height: calc(24px + 1rem); - width: calc(24px + 1rem); + height: calc(24px * 2); + width: calc(24px * 2); --bs-btn-font-size: 24px; --bs-btn-line-height: 24px; } .btn-icon.icon-size-5 { - height: calc(32px + 1rem); - width: calc(32px + 1rem); + height: calc(32px * 2); + width: calc(32px * 2); --bs-btn-font-size: 32px; --bs-btn-line-height: 32px; } .btn-icon.icon-size-6 { - height: calc(40px + 1rem); - width: calc(40px + 1rem); + height: calc(40px * 2); + width: calc(40px * 2); --bs-btn-font-size: 40px; --bs-btn-line-height: 40px; } .btn-icon.icon-size-7 { - height: calc(48px + 1rem); - width: calc(48px + 1rem); + height: calc(48px * 2); + width: calc(48px * 2); --bs-btn-font-size: 48px; --bs-btn-line-height: 48px; } From 07fd45ea21a9981da6e101b0e5897a2e994ded02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Mon, 15 Dec 2025 17:17:34 +0100 Subject: [PATCH 2/3] MDL-87444 core: Add 'extraclasses' param to drag_handle Add new 'extraclasses' parameter to drag_handle template. That will help to customise the button sizing and extra styles. --- .../actions/edit_table/edit_table.class.php | 51 ++++++++++++++----- .../edit_xml_file/edit_xml_file.class.php | 15 ++++-- public/lib/templates/drag_handle.mustache | 11 +++- 3 files changed, 59 insertions(+), 18 deletions(-) diff --git a/public/admin/tool/xmldb/actions/edit_table/edit_table.class.php b/public/admin/tool/xmldb/actions/edit_table/edit_table.class.php index b83b2d8cc2a..d63a403e213 100644 --- a/public/admin/tool/xmldb/actions/edit_table/edit_table.class.php +++ b/public/admin/tool/xmldb/actions/edit_table/edit_table.class.php @@ -212,10 +212,19 @@ class edit_table extends XMLDBAction { $row = 0; foreach ($fields as $field) { // Drag element up/down. - $move = (count($fields) > 1) ? html_writer::span($OUTPUT->render_from_template('core/drag_handle', - ['movetitle' => get_string('movecontent', 'moodle', $field->getName())]), '', - ['data-action' => 'move_updown_field', 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), - 'data-table' => $table->getName(), 'data-field' => $field->getName()]) : ''; + $draghandle = html_writer::span( + content: $OUTPUT->render_from_template( + 'core/drag_handle', + ['movetitle' => get_string('movecontent', 'moodle', $field->getName()), 'extraclasses' => 'me-2'] + ), + attributes: [ + 'data-action' => 'move_updown_field', + 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), + 'data-table' => $table->getName(), + 'data-field' => $field->getName(), + ] + ); + $move = (count($fields) > 1) ? $draghandle : ''; // The field name (link to edit - if the field has no uses) if (!$structure->getFieldUses($table->getName(), $field->getName())) { $f = '' . $field->getName() . ''; @@ -263,10 +272,19 @@ class edit_table extends XMLDBAction { $row = 0; foreach ($keys as $key) { // Drag element up/down. - $move = (count($keys) > 1) ? html_writer::span($OUTPUT->render_from_template('core/drag_handle', - ['movetitle' => get_string('movecontent', 'moodle', $key->getName())]), '', - ['data-action' => 'move_updown_key', 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), - 'data-table' => $table->getName(), 'data-key' => $key->getName()]) : ''; + $draghandle = html_writer::span( + content: $OUTPUT->render_from_template( + 'core/drag_handle', + ['movetitle' => get_string('movecontent', 'moodle', $field->getName()), 'extraclasses' => 'me-2'] + ), + attributes: [ + 'data-action' => 'move_updown_key', + 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), + 'data-table' => $table->getName(), + 'data-key' => $key->getName(), + ] + ); + $move = (count($keys) > 1) ? $draghandle : ''; // The key name (link to edit - if the key has no uses) if (!$structure->getKeyUses($table->getName(), $key->getName())) { $k = '' . $key->getName() . ''; @@ -309,10 +327,19 @@ class edit_table extends XMLDBAction { $row = 0; foreach ($indexes as $index) { // Drag element up/down. - $move = (count($indexes) > 1) ? html_writer::span($OUTPUT->render_from_template('core/drag_handle', - ['movetitle' => get_string('movecontent', 'moodle', $index->getName())]), '', - ['data-action' => 'move_updown_index', 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), - 'data-table' => $table->getName(), 'data-index' => $index->getName()]) : ''; + $draghandle = html_writer::span( + content: $OUTPUT->render_from_template( + 'core/drag_handle', + ['movetitle' => get_string('movecontent', 'moodle', $field->getName()), 'extraclasses' => 'me-2'] + ), + attributes: [ + 'data-action' => 'move_updown_index', + 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), + 'data-table' => $table->getName(), + 'data-index' => $index->getName(), + ] + ); + $move = (count($indexes) > 1) ? $draghandle : ''; // The index name (link to edit) $i = '' . $index->getName() . ''; // Calculate buttons diff --git a/public/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php b/public/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php index 0f8962cb09d..fe87e634644 100644 --- a/public/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php +++ b/public/admin/tool/xmldb/actions/edit_xml_file/edit_xml_file.class.php @@ -183,10 +183,17 @@ class edit_xml_file extends XMLDBAction { $row = 0; foreach ($tables as $table) { // Drag element for sortorder. - $move = html_writer::span($OUTPUT->render_from_template('core/drag_handle', - ['movetitle' => get_string('movecontent', 'moodle', $table->getName())]), '', - ['data-action' => 'move_updown_table', 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), - 'data-table' => $table->getName()]); + $move = html_writer::span( + content: $OUTPUT->render_from_template( + 'core/drag_handle', + ['movetitle' => get_string('movecontent', 'moodle', $table->getName()), 'extraclasses' => 'me-2'] + ), + attributes: [ + 'data-action' => 'move_updown_table', + 'data-dir' => str_replace($CFG->dirroot, '', $dirpath), + 'data-table' => $table->getName(), + ] + ); // The table name (link to edit table) $t = '' . $table->getName() . ''; // Calculate buttons diff --git a/public/lib/templates/drag_handle.mustache b/public/lib/templates/drag_handle.mustache index b4f1e45b26f..877837e3a99 100644 --- a/public/lib/templates/drag_handle.mustache +++ b/public/lib/templates/drag_handle.mustache @@ -21,9 +21,16 @@ Example context (json): { - "movetitle": "Move this element" + "movetitle": "Move this element", + "extraclasses": "icon-size-2" } }} - From 31756634e537f1a7dfac0979dde9fc038c203e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Fri, 12 Dec 2025 15:42:02 +0100 Subject: [PATCH 3/3] MDL-87444 reportbuilder: Fix button icons UI --- .../classes/table/custom_report_table.php | 2 +- .../local/conditions/header.mustache | 14 ++++----- .../templates/local/settings/filters.mustache | 30 ++++++++++--------- .../templates/local/settings/sorting.mustache | 4 ++- .../templates/table_header_cell.mustache | 8 +++-- .../boost/scss/moodle/reportbuilder.scss | 6 ---- public/theme/boost/style/moodle.css | 6 ---- public/theme/classic/style/moodle.css | 6 ---- 8 files changed, 32 insertions(+), 44 deletions(-) diff --git a/public/reportbuilder/classes/table/custom_report_table.php b/public/reportbuilder/classes/table/custom_report_table.php index 9f06036802a..3082494ed8d 100644 --- a/public/reportbuilder/classes/table/custom_report_table.php +++ b/public/reportbuilder/classes/table/custom_report_table.php @@ -261,7 +261,7 @@ class custom_report_table extends base_report_table { ]); echo html_writer::tag('th', $headercell, [ - 'class' => 'border-end border-start', + 'class' => 'border-end border-start p-2', 'scope' => 'col', 'data-region' => 'column-header', 'data-column-id' => $column->get_persistent()->get('id'), diff --git a/public/reportbuilder/templates/local/conditions/header.mustache b/public/reportbuilder/templates/local/conditions/header.mustache index cb231b6c39d..89f7b8f78ee 100644 --- a/public/reportbuilder/templates/local/conditions/header.mustache +++ b/public/reportbuilder/templates/local/conditions/header.mustache @@ -28,14 +28,14 @@ }}
-
- {{>core/drag_handle}} -
-
- {{entityname}} • {{heading}} -
+
+ {{ + {{entityname}} • {{heading}}
- +
+
+ {{{headingeditable}}}
- {{/activefilters}} diff --git a/public/reportbuilder/templates/local/settings/sorting.mustache b/public/reportbuilder/templates/local/settings/sorting.mustache index c536919caa8..716191b790d 100644 --- a/public/reportbuilder/templates/local/settings/sorting.mustache +++ b/public/reportbuilder/templates/local/settings/sorting.mustache @@ -53,7 +53,9 @@ data-column-sort-name="{{title}}" data-column-sort-direction="{{sortdirection}}" data-column-sort-position="{{sortorder}}"> - {{>core/drag_handle}} + {{