Moodle
  1. Moodle
  2. MDL-37674

no-header class for HTML blocks with no header

    Details

    • Testing Instructions:
      Hide
      1. Log in as an admin.
      2. Browse to a course.
      3. Inspect the navigation block and check that it doesn't have the "no-header" class.
      4. Turn on editing.
      5. Add an instance of the course summary block.
      6. Turn off editing.
      7. Inspect the course summary block and check it has the "no-header" class.
      Show
      Log in as an admin. Browse to a course. Inspect the navigation block and check that it doesn't have the "no-header" class. Turn on editing. Add an instance of the course summary block. Turn off editing. Inspect the course summary block and check it has the "no-header" class.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      wip-MDL-37674-m26

      Description

      Depending on how you've styled your blocks, a block that has no header can lead to a missing top border on block content. It would be really nice if there were a class on the .block element that indicated that there was no header, so that if, for example, content then needs to be given a border-top and a border-radius on the two top corners, theme designers have a style with which to target those blocks.

      The .block_course_summary block has no header by default. Another block which can have no header, if a header title is not entered for it, is the HTML block.

      I am able to add a .no-header class to the .block_course_summary block with the patches above below, but am not able to get it working for the HTML block.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Michael de Raadt added a comment -

            Thanks for putting that forward.

            Feel free to request a peer review.

            Show
            Michael de Raadt added a comment - Thanks for putting that forward. Feel free to request a peer review.
            Hide
            Sam Hemelryk added a comment -

            Hi Amy,

            The code looks spot on thanks.

            There was one thing I noted, it may or may not be of concern so I'll just mention it and let you decide.
            When editing is turned on a block with no title can still have an actions, and if there are actions a header is added containing just the actions.
            In that situation the block ends up with both the no-header class and a header.

            If that doesn't concern you good as gold feel free to push this to integration when you are ready. (If you don't have the permission for that let me know and I'll push it up for you)

            Many thanks
            Sam

            Show
            Sam Hemelryk added a comment - Hi Amy, The code looks spot on thanks. There was one thing I noted, it may or may not be of concern so I'll just mention it and let you decide. When editing is turned on a block with no title can still have an actions, and if there are actions a header is added containing just the actions. In that situation the block ends up with both the no-header class and a header. If that doesn't concern you good as gold feel free to push this to integration when you are ready. (If you don't have the permission for that let me know and I'll push it up for you) Many thanks Sam
            Hide
            Amy Groshek added a comment - - edited

            Sam Hemelryk Hm, good point. In that case I would have the editing body class with which to make a more specific selection and undo anything that would conflict with block presentation. But that means that anyone using the .no-header class also has to anticipate that issue. I'll have a look and see whether I can get info about whether editing is on when the block markup is rendered, to conditionally print that .no-header class.

            Show
            Amy Groshek added a comment - - edited Sam Hemelryk Hm, good point. In that case I would have the editing body class with which to make a more specific selection and undo anything that would conflict with block presentation. But that means that anyone using the .no-header class also has to anticipate that issue. I'll have a look and see whether I can get info about whether editing is on when the block markup is rendered, to conditionally print that .no-header class.
            Hide
            Amy Groshek added a comment -

            So, I've looked for a way to read editing on/off from the moodleblock class & can't figure it out. I still think that this class, in combination with the .editing body class, can be useful, so, have rebased and will request peer review again and see if someone else can push to integration.

            Show
            Amy Groshek added a comment - So, I've looked for a way to read editing on/off from the moodleblock class & can't figure it out. I still think that this class, in combination with the .editing body class, can be useful, so, have rebased and will request peer review again and see if someone else can push to integration.
            Hide
            Sam Hemelryk added a comment -

            Sorry this slipped through the cracks Amy.

            Given you are happy with the approach taken I've pushed this for integration review for you.
            I've also rebased your branches and produced the required stable branches using your commit (all cherry-picked so the commit is still yours)

            Many thanks and sorry about the delay
            Sam

            Show
            Sam Hemelryk added a comment - Sorry this slipped through the cracks Amy. Given you are happy with the approach taken I've pushed this for integration review for you. I've also rebased your branches and produced the required stable branches using your commit (all cherry-picked so the commit is still yours) Many thanks and sorry about the delay Sam
            Hide
            Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            Dan Poltawski added a comment -

            Thanks Amy/Sam, i've integrated this now. As this is an improvement i've integrated it to master only.

            However, following our process:
            http://docs.moodle.org/dev/Integration_Review#Process_for_requesting_a_non_bug-fix_backport

            I've created a backport request for it to be backported to the stable branches: MDL-41308

            Show
            Dan Poltawski added a comment - Thanks Amy/Sam, i've integrated this now. As this is an improvement i've integrated it to master only. However, following our process: http://docs.moodle.org/dev/Integration_Review#Process_for_requesting_a_non_bug-fix_backport I've created a backport request for it to be backported to the stable branches: MDL-41308
            Hide
            Jérôme Mouneyrac added a comment -

            no-header appears in master but not in 2.5/2.4

            Show
            Jérôme Mouneyrac added a comment - no-header appears in master but not in 2.5/2.4
            Hide
            Jérôme Mouneyrac added a comment -

            Ah crap Dan just said that... So you can pass it.

            Show
            Jérôme Mouneyrac added a comment - Ah crap Dan just said that... So you can pass it.
            Hide
            Damyon Wiese added a comment -

            Thanks for your efforts. This issue is one of the outstanding issues that passed all our testing and was accepted into Moodle this week.

            Hurray!

            Show
            Damyon Wiese added a comment - Thanks for your efforts. This issue is one of the outstanding issues that passed all our testing and was accepted into Moodle this week. Hurray!
            Hide
            Amy Groshek added a comment -

            I go away on vacation for one week and suddenly my little long-lost issue is picked up and passed. How sweet! Thanks all!

            Show
            Amy Groshek added a comment - I go away on vacation for one week and suddenly my little long-lost issue is picked up and passed. How sweet! Thanks all!
            Hide
            Dan Poltawski added a comment -

            Hope you had a nice break Amy!

            Show
            Dan Poltawski added a comment - Hope you had a nice break Amy!

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: