moodle-an-hochschulen / moodle-theme_boost_campus

Moodle 3.x Boost child theme which is intended to meet the needs of university campuses and adds several features and improvements ––– for Moodle 4.x please use our Theme Boost Union
GNU General Public License v3.0
38 stars 25 forks source link

Block "Add a block" in activity editing UI #50

Closed lucaboesch closed 5 years ago

lucaboesch commented 5 years ago

Hi Uni Ulm Moodle Team

Your Boost Campus work is terrific!

I noticed a design inconsistency, though, which collides with usual Boost behaviour. Block "Add a block" does show where it shouldn't IMHO.

To reproduce:

Go to a course, have an activity (e.g. a quiz) in it. You could also reproduce with the notification forum if you wish. Turn editing on for the course. Click the activity to get to the activity editing user interface.

What you expect: There's no "Add a block" block. What actually happens: There is a "Add a block" block.

Thanks for enquiring.

boost_course_editing_activity_edit boost_campus_course_editing_activity_edit

lucaboesch commented 5 years ago

It seems this is affecting Boost Campus on Moodle 3.5, too.

abias commented 5 years ago

Hi Luca,

thank you for creating this issue.

There's an easy explanation for this difference in behaviour between theme_boost and theme_boost_campus and it goes back to the very first phase of developing theme_boost_campus.

In a theme's config.php, you can set the area where the "Add a block" dropdown will be shown. If you compare https://github.com/moodleuulm/moodle-theme_boost_campus/blob/master/config.php#L167 and https://github.com/moodle/moodle/blob/master/theme/boost/config.php#L158 you will see that theme_boost_campus does not inherit BLOCK_ADDBLOCK_POSITION_FLATNAV from theme_boost but does overwrite this configuration with BLOCK_ADDBLOCK_POSITION_DEFAULT.

This change was based on our local analysis of our teachers' expectations who were accustomed to see the "Add a block" dropdown in the page's right column (where also the blocks appear after being added) and wouldn't have expected to find it in the Nav drawer.

However, I have to admit that this change doesn't have a theme setting and also isn't documented as hardcoded change in README.md.

If you would like to see this configurable, please don't hesitate to send us a PR with a new theme setting. Otherwise, we will build a setting as soon as we have time.

Cheers, Alex

lucaboesch commented 5 years ago

Dear Alex

I'd gladly do this. What do you propose as setting label for the preference? "Omit 'Add a block' within activities settings", default to false, does that fit your needs?

Best, Luca

abias commented 5 years ago

Hi Luca,

Kathrin as plugin maintainer has the final say, but I would propose not to built this setting as a checkbox but as a dropdown setting, similar to theme_boost_campus | incoursesettingsswitchtoroleposition.

The label would be "Position of 'Add a block' widget" and the options would be:

  1. At the bottom of the nav drawer (default)
  2. At the bottom of the default block region

BTW, as you can see on https://github.com/moodle/moodle/blob/master/lib/blocklib.php#L48, there would also be the possibility to let the theme place the "Add a block" widget anywhere on the page and it would make sense to think about an even better place than the Nav drawer, but this is beyond the scope of this issue.