Skip to content
Snippets Groups Projects
Commit 3e682f64 authored by Alexander Bias's avatar Alexander Bias Committed by Kathrin Osswald
Browse files

Add the possibility to set the block column width on the Dashboard and all other pages.

parent 6442cfea
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ Changes ...@@ -6,6 +6,7 @@ Changes
### Unreleased ### Unreleased
* 2019-04-16 - Add the possibility to set the block column width on the Dashboard and all other pages.
* 2019-04-16 - Fixed template paths in mustache templates. * 2019-04-16 - Fixed template paths in mustache templates.
* 2019-04-16 - Adjusted navbar.mustache template due to upstream changes in theme Boost. * 2019-04-16 - Adjusted navbar.mustache template due to upstream changes in theme Boost.
* 2019-04-15 - Adjusted loginform.mustache and helpicon.mustache templates due to upstream changes in theme Boost. * 2019-04-15 - Adjusted loginform.mustache and helpicon.mustache templates due to upstream changes in theme Boost.
......
...@@ -184,6 +184,11 @@ $string['blockdesignheadingsetting'] = 'Blocks'; ...@@ -184,6 +184,11 @@ $string['blockdesignheadingsetting'] = 'Blocks';
$string['blockiconsetting'] = 'Block icon'; $string['blockiconsetting'] = 'Block icon';
$string['blockiconsetting_desc'] = 'With this setting you can add a default Font Awesome icon in front of the block title. If checked, we additionally provide individual icon replacements for many Moodle core blocks and also some widely used blocks. You also can change the icons easily for each block individually in your raw SCSS via the change of the Font Awesome content. For all available icons please visit http://fontawesome.io/icons/ and use the Unicode value of the icon to replace the default one. <br/> The code to change the icon looks like this example change for the block "People": <br/>'; $string['blockiconsetting_desc'] = 'With this setting you can add a default Font Awesome icon in front of the block title. If checked, we additionally provide individual icon replacements for many Moodle core blocks and also some widely used blocks. You also can change the icons easily for each block individually in your raw SCSS via the change of the Font Awesome content. For all available icons please visit http://fontawesome.io/icons/ and use the Unicode value of the icon to replace the default one. <br/> The code to change the icon looks like this example change for the block "People": <br/>';
$string['blockiconsetting_desc_code'] = '.block_people .card-block .card-title::before { content: \'\f0c0\' ; }'; $string['blockiconsetting_desc_code'] = '.block_people .card-block .card-title::before { content: \'\f0c0\' ; }';
$string['blockcolumnwidthsetting'] = 'Block column width on all other pages';
$string['blockcolumnwidthsetting_desc'] = 'With this setting you can change the width (in pixels) of the block column on all other pages except the Dashboard.';
$string['blockcolumnwidthdashboardsetting'] = 'Block column width on Dashboard';
$string['blockcolumnwidthdashboardsetting_desc'] = 'With this setting you can change the width (in pixels) of the block column on the Dashboard.';
$string['blockcolumnwidthdefault'] = 'The default width from Moodle 3.6 on is 360px, until Moodle 3.5 the width was 250px.';
// ...Navbar. // ...Navbar.
$string['navbardesignheadingsetting'] = 'Navbar'; $string['navbardesignheadingsetting'] = 'Navbar';
$string['darknavbarsetting'] = 'Dark navbar'; $string['darknavbarsetting'] = 'Dark navbar';
......
...@@ -101,7 +101,9 @@ function theme_boost_campus_get_pre_scss($theme) { ...@@ -101,7 +101,9 @@ function theme_boost_campus_get_pre_scss($theme) {
'footerhideusertourslink' => ['footerhideusertourslink'], 'footerhideusertourslink' => ['footerhideusertourslink'],
'navdrawerfullwidth' => ['navdrawerfullwidth'], 'navdrawerfullwidth' => ['navdrawerfullwidth'],
'helptextmodal' => ['helptextmodal'], 'helptextmodal' => ['helptextmodal'],
'breakpoint' => ['breakpoint'] 'breakpoint' => ['breakpoint'],
'blockcolumnwidth' => ['blockcolumnwidth'],
'blockcolumnwidthdashboard' => ['blockcolumnwidthdashboard']
// MODIFICATION END. // MODIFICATION END.
]; ];
...@@ -116,6 +118,18 @@ function theme_boost_campus_get_pre_scss($theme) { ...@@ -116,6 +118,18 @@ function theme_boost_campus_get_pre_scss($theme) {
}, (array) $targets); }, (array) $targets);
} }
// MODIFICATION START: Overwrite Boost core SCSS variables which need units and thus couldn't be added to $configurable above.
// Set variables which are processed in the context of the blockcolumnwidth setting.
$scss .= '$blocks-column-width: ' . $theme->settings->blockcolumnwidth . "px;\n";
$scss .= '$grid-gutter-width: '. "30px;\n";
// MODIFICATION END.
// MODIFICATION START: Set own SCSS variables which need units or calculations and thus couldn't be added to $configurable above.
// Set variables which are processed in the context of the blockcolumnwidth setting.
$scss .= '$blocks-column-width-dashboard: ' . $theme->settings->blockcolumnwidthdashboard . "px;\n";
$scss .= '$blocks-plus-gutter-dashboard: $blocks-column-width-dashboard + ( $grid-gutter-width / 2 )' . ";\n";
// MODIFICATION END.
// MODIFICATION START: Add login background images that are uploaded to the setting 'loginbackgroundimage' to CSS. // MODIFICATION START: Add login background images that are uploaded to the setting 'loginbackgroundimage' to CSS.
$scss .= theme_boost_campus_get_loginbackgroundimage_scss(); $scss .= theme_boost_campus_get_loginbackgroundimage_scss();
// MODIFICATION END. // MODIFICATION END.
......
...@@ -28,6 +28,19 @@ ...@@ -28,6 +28,19 @@
} }
} }
/* Change the block column width if setting 'blockcolumnwidthdashboard' is different from setting 'blockcolumnwidth'. */
@if variable-exists(blockcolumnwidthdashboard) and variable-exists(blockcolumnwidth) {
@if $blockcolumnwidthdashboard != $blockcolumnwidth {
#page-my-index [data-region="blocks-column"] {
width: $blocks-column-width-dashboard;
}
#page-my-index #region-main-settings-menu.has-blocks,
#page-my-index #region-main.has-blocks {
width: calc(100% - #{$blocks-plus-gutter-dashboard});
}
}
}
/*------------------------------------ /*------------------------------------
Login page Login page
......
...@@ -585,6 +585,24 @@ if ($ADMIN->fulltree) { ...@@ -585,6 +585,24 @@ if ($ADMIN->fulltree) {
$setting->set_updatedcallback('theme_reset_all_caches'); $setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting); $page->add($setting);
// Setting for the width of the block column on the Dashboard.
$name = 'theme_boost_campus/blockcolumnwidthdashboard';
$title = get_string('blockcolumnwidthdashboardsetting', 'theme_boost_campus', null, true);
$description = get_string('blockcolumnwidthdashboardsetting_desc', 'theme_boost_campus', null, true).' '.
get_string('blockcolumnwidthdefault', 'theme_boost_campus', null, true);
$setting = new admin_setting_configtext_with_maxlength($name, $title, $description, 360, PARAM_INT, null, 3);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Setting for the width of the block column on all other pages.
$name = 'theme_boost_campus/blockcolumnwidth';
$title = get_string('blockcolumnwidthsetting', 'theme_boost_campus', null, true);
$description = get_string('blockcolumnwidthsetting_desc', 'theme_boost_campus', null, true).' '.
get_string('blockcolumnwidthdefault', 'theme_boost_campus', null, true);
$setting = new admin_setting_configtext_with_maxlength($name, $title, $description, 360, PARAM_INT, null, 3);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Settings title to group navbar related settings together with a common heading. We don't want a description here. // Settings title to group navbar related settings together with a common heading. We don't want a description here.
$name = 'theme_boost_campus/navbardesignheading'; $name = 'theme_boost_campus/navbardesignheading';
$title = get_string('navbardesignheadingsetting', 'theme_boost_campus', null, true); $title = get_string('navbardesignheadingsetting', 'theme_boost_campus', null, true);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->component = 'theme_boost_campus'; $plugin->component = 'theme_boost_campus';
$plugin->version = 2019021400; $plugin->version = 2019041100;
$plugin->release = 'v3.6-r2'; $plugin->release = 'v3.6-r2';
$plugin->requires = 2018120300; $plugin->requires = 2018120300;
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment