Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59599

Navigation tree: Grade node is never set to active

    XMLWordPrintable

    Details

      Description

      Hi,

      during styling the nav drawer menu in our Boost child theme, I encountered that the selected nodes will be displayed bold and set to active if a user clicked them except for the grades node.

      This behaviour is not only given in Boost theme but also in Clean theme (and probably in More theme but I did not test this).

      Screenshots for getting an impression of the difference:

      • Boost:
        • Clicked on "Badges"
        • Clicked on "Grades"
      • Clean:
        • Clicked on "Badges"
        • Clicked on "Grades"

      The code shows following differences:

      • Boost:
        • Clicked on "Badges":

          <a class="list-group-item list-group-item-action font-weight-bold" (...) data-key="badgesview" (...) data-isactive="1" (...)>
          

        • Clicked on "Grades":

          <a class="list-group-item list-group-item-action (...) data-key="grades" (...) data-isactive="0" (...)>
          

      The grades node keeps the attribute for data-isactive = 0 and therefore the class font-weight-bold would not been added as the renderer checks for the active status:
      https://github.com/moodle/moodle/blob/master/theme/boost/templates/flat_navigation.mustache#L65

      • Clean:
        • Clicked on "Badges":

          <p class="tree_item hasicon active_tree_node" role="treeitem" tabindex="0" aria-selected="true">(...)</p>
          

        • Clicked on "Grades":

          <p class="tree_item hasicon" role="treeitem" tabindex="0" aria-selected="true">(...)</p>
          

      In Clean the grades node never gets the class "active_tree_node" and so here the displaying will also be different (not bold) to the other clicked nodes.

      Steps to reproduce

      1. Login into Moodle
      2. Create a course
      3. Go into this course
      4. Click in the course navigation on "Badges"
        -> See that the badges page will be loaded and the text "Badges" will be displayed in bold.
      5. Click in the course navigation on "Grades"
      6. -> See that the grades page will be loaded and the text "Grades" will NOT be displayed in bold.

        Attachments

        1. boost_badges.png
          boost_badges.png
          11 kB
        2. boost_grades.png
          boost_grades.png
          11 kB
        3. clean_grades.png
          clean_grades.png
          15 kB
        4. clesan_badges.png
          clesan_badges.png
          15 kB
        5. image-2018-07-11-18-39-13-585.png
          image-2018-07-11-18-39-13-585.png
          158 kB
        6. image-2018-07-12-11-17-00-133.png
          image-2018-07-12-11-17-00-133.png
          169 kB
        7. int.png
          int.png
          50 kB
        8. weekly.png
          weekly.png
          52 kB

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m