diff --git a/theme/noname/classes/output/core_renderer.php b/theme/noname/classes/output/core_renderer.php index 7e839cfd7c4..984e05a1196 100644 --- a/theme/noname/classes/output/core_renderer.php +++ b/theme/noname/classes/output/core_renderer.php @@ -33,6 +33,7 @@ use single_select; use paging_bar; use url_select; use context_course; +use pix_icon; defined('MOODLE_INTERNAL') || die; @@ -353,7 +354,31 @@ class core_renderer extends \core_renderer { * @return string HTML */ public function render_action_menu(action_menu $menu) { - return $this->render_from_template('core/action_menu', $menu); + + // We don't want the class icon there! + foreach ($menu->get_secondary_actions() as $action) { + if ($action instanceof \action_menu_link && $action->has_class('icon')) { + $action->attributes['class'] = preg_replace('/(^|\s+)icon(\s+|$)/i', '', $action->attributes['class']); + } + } + + $context = $menu->export_for_template($this); + + // We do not want the icon with the caret, the caret is added by Bootstrap. + if (empty($context->primary->menutrigger)) { + $newurl = $this->pix_url('t/edit', 'moodle'); + $context->primary->icon['attributes'] = array_reduce($context->primary->icon['attributes'], + function($carry, $item) use ($newurl) { + if ($item['name'] === 'src') { + $item['value'] = $newurl->out(false); + } + $carry[] = $item; + return $carry; + }, [] + ); + } + + return $this->render_from_template('core/action_menu', $context); } /** diff --git a/theme/noname/scss/moodle/blocks.scss b/theme/noname/scss/moodle/blocks.scss index 02da1c416f1..7badb6d4c87 100644 --- a/theme/noname/scss/moodle/blocks.scss +++ b/theme/noname/scss/moodle/blocks.scss @@ -18,7 +18,7 @@ /* So that the caret takes the colour of the icon. */ color: #999; &::after { - margin-left: -($spacer/2); + margin-left: 0; } } } diff --git a/theme/noname/scss/moodle/core.scss b/theme/noname/scss/moodle/core.scss index 8e55f9663c5..232cb739d95 100644 --- a/theme/noname/scss/moodle/core.scss +++ b/theme/noname/scss/moodle/core.scss @@ -171,7 +171,6 @@ img.resize { width: 1em; } .action-menu .dropdown-toggle { - margin-right: 0.5rem; text-decoration: none; } .action-menu { @@ -1724,11 +1723,6 @@ ul.dragdrop-keyboard-drag li { list-style-type: none; } -.block-control-actions .moodle-core-dragdrop-draghandle img { - width: 12px; - height: 12px; -} - a.disabled:hover, a.disabled { text-decoration: none; diff --git a/theme/noname/scss/moodle/course.scss b/theme/noname/scss/moodle/course.scss index 032679ec2c5..79d451c3278 100644 --- a/theme/noname/scss/moodle/course.scss +++ b/theme/noname/scss/moodle/course.scss @@ -106,9 +106,12 @@ } .filler { + // This must be sized like an icon to fill the space. width: 16px; height: 16px; - padding: 0.3em; + margin: 0; + padding: 0; + margin: 0 ($spacer / 2); display: inline-block; } diff --git a/theme/noname/scss/moodle/icons.scss b/theme/noname/scss/moodle/icons.scss index e40ef059d8a..a8e8d97a67c 100644 --- a/theme/noname/scss/moodle/icons.scss +++ b/theme/noname/scss/moodle/icons.scss @@ -20,7 +20,7 @@ a:first-of-type > .icon { } // Fix the first item in a drop down menu (it's a list of links and icons, but has been made vertical. -.dropdown a.dropdown-item .icon { +.dropdown .dropdown-item .icon { margin-left: 0px; } diff --git a/theme/noname/scss/moodle/modules.scss b/theme/noname/scss/moodle/modules.scss index 6638a0165f2..3ebe8c0b1d2 100644 --- a/theme/noname/scss/moodle/modules.scss +++ b/theme/noname/scss/moodle/modules.scss @@ -225,13 +225,6 @@ div#dock { width: 100%; } -// Dropdown styling. -.dropdown-menu { - > li > a { - padding: 3px 20px 3px 8px; - } -} - // Survey module .path-mod-survey { @@ -267,14 +260,6 @@ div#dock { // } // } //} -.dropdown-menu { - .divider { - width: auto; - height: 1px; - border-left: 0 none; - border-right: 0 none; - } -} // Usermenu .usermenu { diff --git a/theme/noname/templates/core/action_menu.mustache b/theme/noname/templates/core/action_menu.mustache index c4fc342b3b2..892e204e6c0 100644 --- a/theme/noname/templates/core/action_menu.mustache +++ b/theme/noname/templates/core/action_menu.mustache @@ -1,22 +1,34 @@ -
- {{#get_primary_actions}} - {{> core/action_menu_item_icon}} - {{/get_primary_actions}} - - - diff --git a/theme/noname/templates/core/action_menu_item.mustache b/theme/noname/templates/core/action_menu_item.mustache index 2a857e20dd2..d00323a5c48 100644 --- a/theme/noname/templates/core/action_menu_item.mustache +++ b/theme/noname/templates/core/action_menu_item.mustache @@ -1,5 +1,24 @@ -{{#text}} - - {{#icon}}{{{get_icon_html}}}{{/icon}}{{text}} - -{{/text}} \ No newline at end of file +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Action menu item. +}} +{{#actionmenulink}}{{> core/action_menu_link }}{{/actionmenulink}} +{{#actionmenufiller}} {{/actionmenufiller}} +{{#actionlink}}{{> core/action_link }}{{/actionlink}} +{{#pixicon}}{{> core/pix_icon }}{{/pixicon}} +{{#rawhtml}}{{{.}}}{{/rawhtml}} \ No newline at end of file diff --git a/theme/noname/templates/core/action_menu_item_icon.mustache b/theme/noname/templates/core/action_menu_item_icon.mustache deleted file mode 100644 index b34c88b92e2..00000000000 --- a/theme/noname/templates/core/action_menu_item_icon.mustache +++ /dev/null @@ -1,5 +0,0 @@ -{{#text}} - - {{#icon}}{{{get_icon_html}}}{{/icon}}{{text}} - -{{/text}} \ No newline at end of file diff --git a/theme/noname/templates/core/action_menu_link.mustache b/theme/noname/templates/core/action_menu_link.mustache new file mode 100644 index 00000000000..3c41ad8dd7b --- /dev/null +++ b/theme/noname/templates/core/action_menu_link.mustache @@ -0,0 +1,25 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Action menu link. +}} +{{^disabled}} + {{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}{{{text}}}{{/showtext}} +{{/disabled}} +{{#disabled}} + {{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}} +{{/disabled}} diff --git a/theme/noname/templates/core/action_menu_trigger.mustache b/theme/noname/templates/core/action_menu_trigger.mustache new file mode 100644 index 00000000000..45cb14c940e --- /dev/null +++ b/theme/noname/templates/core/action_menu_trigger.mustache @@ -0,0 +1,31 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Action menu trigger. +}} + + + {{#secondary}} + + {{/secondary}} + diff --git a/theme/noname/templates/core/pix_icon.mustache b/theme/noname/templates/core/pix_icon.mustache index 1d36061e1f0..ec3cbadbab5 100644 --- a/theme/noname/templates/core/pix_icon.mustache +++ b/theme/noname/templates/core/pix_icon.mustache @@ -39,4 +39,4 @@ } }} - + \ No newline at end of file