Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Apr 6, 2024
1 parent 43144e7 commit b1249bd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2024-03-30 - Bugfix: Smart menu divider did not work for user menu submenus, resolves #537.
* 2024-03-25 - Backport: Boost Union settings were moved to an admin settings category of its own to support the new theme chooser on Moodle 4.4, resolves #482.
This change was backported to this Moodle major version.
* 2024-03-22 - Backport: Align the before_standard_html_head() function with the new hook callback on Moodle 4.4, resolves #604.
Expand Down
9 changes: 9 additions & 0 deletions classes/output/navigation/primary.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ public function get_user_menu(renderer_base $output): array {
foreach ($parentoutput['submenus'] as $sm) {
// Search the 'Language' submenu.
if ($sm->title == $needle) {
// Create and inject a divider node.
$dividernode = [
'title' => '####',
'itemtype' => 'divider',
'divider' => 1,
'link' => '',
];
$sm->items[] = $dividernode;

// Create and inject the 'Set preferred language' link.
$spfnode = [
'title' => get_string('setpreferredlanglink', 'theme_boost_union'),
Expand Down
13 changes: 0 additions & 13 deletions scss/boost_union/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,6 @@ body.hascourseindexcplsol.editing {
padding: .25rem 1.75rem .25rem .75rem;
}

/*---------------------------------------
* Setting: Add preferred language link to language menu.
--------------------------------------*/

/* Add a bottom-top to the 'Set preferred language' link.
This could be rebuilt as soon as https://github.com/moodle-an-hochschulen/moodle-theme_boost_union/issues/537
is solved. */
#user-action-menu .carousel-item.submenu a[href$="user/language.php"] {
border-top: 1px solid $dropdown-divider-bg;
margin-top: 0.5rem;
padding-top: 0.5rem;
}

/*---------------------------------------
* Setting: Show starred courses popover in the navbar.
--------------------------------------*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,21 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
And I am on site homepage
Then I should see smart menu "Quick links" item "Dolor sit amet" in location "Main, Menu, User, Bottom"
And I should not see smart menu "Quick links" item "Lorem ipsum" in location "Main, Menu, User, Bottom"

@javascript
Scenario: Smartmenus: Menu items: Presentation - Use a divider as static menu item
When I log in as "admin"
And I navigate to smart menu "Quick links" items
And I click on "Add menu item" "button"
And I set the following fields to these values:
| Menu item type | Heading |
| Title | ### |
And I click on "Save changes" "button"
# Divider in main navigation.
And ".dropdown-divider" "css_element" should exist in the ".primary-navigation" "css_element"
# Divider in user menu.
And ".dropdown-divider" "css_element" should exist in the "#usermenu-carousel" "css_element"
# Divider in bottom menu.
And ".dropdown-divider" "css_element" should exist in the ".bottom-navigation" "css_element"
# Divider in menubar.
And ".dropdown-divider" "css_element" should exist in the "nav.menubar" "css_element"

0 comments on commit b1249bd

Please sign in to comment.