Boost - Collapse Right Blocks Progress

Boost - Collapse Right Blocks Progress

by Rick Jerz -
Number of replies: 14
Picture of Particularly helpful Moodlers Picture of Testers

Back when Moodle 3.2 (or so) was released and I switched to the new Boost theme, I had noticed that the right blocks could not be collapsed.  There was a good amount of discussion about this (see https://moodle.org/mod/forum/discuss.php?d=341576#p1387015 ), including some good thoughts from Martin and others in Moodle HQ.

I created MDL-57305 as a feature request.

Well, good news, Daniel (and Gareth) has worked on this feature request and have made some very good progress.  We now have a working example, maybe even a solution.  I see that Gareth has continued with code that suggests additional ways to implement this feature.

Based on Daniel's code, I made the following video to demonstrate what I was looking for.


I am making this post to encourage folks to vote on MDL-57305, where  Daniel's fix has added this feature back into Boost,  and he mentions that the core code exists but had been removed from the Boost theme.  I would like to see the code back to Boost. 

I welcome additional ideas.

Average of ratings: Useful (3)
In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

In addition to what Rick has said, I've implemented the code in my new Foundation theme (beta test server only at the moment) in version 3.5.0.5 -> https://github.com/gjb2048/moodle-theme_foundation/releases/tag/V3.5.0.5 - if you want to try it out.

Average of ratings: Useful (2)
In reply to Gareth J Barnard

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Gareth, I always do things manually.  Remind me, when I download from your git location, unzip this file, do I rename the folder "foundation" and then move it into the moodle/theme folder?

In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Rick,

Please see: https://github.com/gjb2048/moodle-theme_foundation#installation - also you need to be running Moodle 3.5.2+ (Build: 20181027) - please see: https://moodle.org/mod/forum/discuss.php?d=377745#p1524271

So you do need to rename the folder from 'moodle-theme_foundation-3.5.0.5' to 'foundation'.  When published in the Moodle plugins DB, this is automatic.

G

In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Rick,

You can change the icons quite easily, by just changing the font icon name of the SCSS variables in the theme/foundation/scss/blocks.scss file.

For example I tried out using these icons: and

.block {
    .block-action {
        @include fa-icon();
        cursor: pointer;
        float: right;
        margin: .2rem .6rem 0 0;
        &:before {
            content: $fa-var-caret-square-o-down;
        }
    }
    &.hidden {
        .block-action:before {
            content: $fa-var-caret-square-o-up;
        }
        .card-text {
            display: none;
        }
    }
}

Don't forget to Purge caches after saving your changes!!!

Cheers

Mary

Average of ratings: Useful (2)
In reply to Mary Evans

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Yep, works great!  Thanks Mary.

You have also caused me to explore all the icons available on https://fontawesome.com/v4.7.0/icons/

I did make a slight change to what you did, Mary.  I decided to use caret-right and caret-down, so that these icons match (i.e., consistent)  the ones that I am using from Gareth's collapsed topics.  I really like this!

I hate to say it, but at this point in time, I am really pleased with the way my moodle is looking.  I have no complaints.  Sure, I still need to do a little tweaking, but overall, this collapsing of right blocks was really, in my opinion, needed.  I would love to see it put back into core (yep, maybe 3.7, but maybe it can be slid into one of the 3.6 updates.)

Also, to make the placement of the icon a little tighter, I added:

/* Ricks modification */

.card-title {

    margin-bottom: .0rem;

}

Attachment icons.jpg
In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Rick, 

I'm glad you decided on those changes.

if you have not done so already, I would advise you to do just that and create a Tracker to add that functionality for the blocks, as it makes a lot of sense.

As for the bottom margin change, you only needed to add a zero, no need to add rem too. At the end if the day a 0 is a ZERO.

Cheers

Mary

In reply to Mary Evans

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Hi Mary, yep, we have gone the full circle.  This all started when I created MDL-57305 as a feature request, nearly two years ago!

It was Daniel who got the ball rolling, and Gareth (and you) contributed ideas.  Gareth has already been incorporating (experimenting) some of this into his foundation theme.

So, what we now seem to have is a viable solution that I would love to see integrated into core.  Somewhere along the way, Martin  martin said that he didn't support this feature request, but that was two years ago, and who knows, maybe Martin did not understand exactly what we were seeking.  Even you contributed some ideas back in https://moodle.org/mod/forum/discuss.php?d=348332#p1408690.

So now I wonder, what is the best way to get this back into core?  I think either Daniel or Gareth suggested that maybe it would make its way into 3.7, maybe a bit too late for 3.6.

Okay, you are correct and I can remove the "rem."  Thanks.

In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
I had forgotten that discussion. The renderer option is still doable as the card element is also added using a renderer In order to make the blocks into flat blocks. If anything I have a feeling it was my idea, as I recall voicing that change in a discussion when Boost was being created. It's probably in the forum for new developments.

That said, however, my idea of making blocks into  'cards' was one that had a flip side, where the title and settings would be on the front, so that when tapped the card would flip over and show contents on the reverse which could be extended if needed. 

My problem was I never followed it up...as Boost was a new theme and not an easy one to understand at that time. Now I know more about how Boost works I may try out some of my ideas.




In reply to Mary Evans

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Well Mary, there could be a number of ways to approach these right-side blocks.  What I have right now is what I wanted when I switched to Boost.  I haven't studied the code changes to see how complex this modification is, but these changes are working perfectly, and I would still prefer core changes instead of having to manually do this myself.

Thanks for your help.

In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Exploring Moodle 3.7, I added the following comment to my MDL-57305 feature request.  If anyone has any ideas, I am interested in hearing them.

"Daniel (and others), I was testing Moodle 3.7 today and discovered that the code fixes that I have been applying do not translate to Moodle 3.7.  Yep, I knew that this would eventually happen.  The files contained within ../boost/temples is completely different.  I am stuck not knowing what to do.  Daniel, maybe you already know how to implement your "collapsed blocks" feature into 3.7.  Maybe there is an easier way?  Any thoughts will be appreciated.

Since the right-side blocks in boost serve many purposes, the ability to collapse them remains important.  For example, I use the "Online Users" block, and this semester, having 145 students in one course, this block grew in size when a lot of users were in Moodle.  Also, I use the Checklist add-in block, which shows all 145 students.  Again, the right side grows in size."

In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I finally got back to working on "collapsing right blocks" that broke with Moodle 3.7.  There were no significant changes.  It was just that I needed to find where some of these files had moved to, in 3.7, and apply some minor cosmetic changes.  Below are my notes about what needs to be done.  Daniel had done most of the work, and without his initial help, I would not have had success.  Thanks, Daniel.


In reply to Rick Jerz

Re: Boost - Collapse Right Blocks Progress

by Gloria del Pilar Villarreal Cuellar -

Hi Rick! I was wondering if this was the right way to do it on Moodle 3.8.2+ I would appreciate the help. Thanks!

In reply to Gloria del Pilar Villarreal Cuellar

Re: Boost - Collapse Right Blocks Progress

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Hi Gloria, below are my own instructions that I follow each time I upgrade Moodle. I think that the text file should be easy to follow.

Yes, this is still working for me (Moodle 3.8.3+ (Build: 20200522)).  Someday, Moodle will make some changes and then this fix will probably not work, and I will have to seek Daniel's help once again.  But for now, things are good.

If you find some wording that would make my text file (instructions) better, let me know.

Also, Daniel recommends building this into another Moodle theme.  Yep, I understand what he is say, I am not skilled (yet) at theme building.  So I just apply these fixes every time I upgrade.