Skip to content

Commit

Permalink
Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jun 7, 2023
1 parent 95421a4 commit a05bfc4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
23 changes: 14 additions & 9 deletions classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public function login_info($withlinks = null) {
array(
'id' => $course->id,
'sesskey' => sesskey(),
'switchrole' => 0,
'switchrole' => 0,
'returnurl' => $this->page->url->out_as_local_url(false)
)
);
Expand Down Expand Up @@ -495,7 +495,9 @@ protected function block_header_collapse(block_contents $bc) {
if ($bc->blockinstanceid) {
$attributes['id'] = 'instance-'.$bc->blockinstanceid.'-header';
}
$title = html_writer::tag('h2', $bc->title, $attributes);
$title = html_writer::tag('div',
html_writer::tag('h2', $bc->title, $attributes)
);
}

$blockid = null;
Expand All @@ -512,10 +514,10 @@ protected function block_header_collapse(block_contents $bc) {
$output = '';
if ($title || $controlshtml) {
$output .= html_writer::tag(
'div',
'div',
html_writer::tag('div', $iconarea.
html_writer::tag('div', $title.$controlshtml),
array('class' => 'title-container')),
html_writer::tag('div', $title.$controlshtml, array('class' => 'title-container')),
array('class' => 'header-container')),
array('class' => 'header')
);
}
Expand Down Expand Up @@ -574,8 +576,11 @@ public function blocks_for_region($region, $fakeblocksonly = false) {
$thisblock->name = 'block_flat_navigation';
$thisblock->title = '<span class="title">'.$flatnavname.'</span>';
$thisblock->header = '<div role="button" class="collapselink" data-toggle="collapse" data-target="#subcollapsefake9999" '.
'aria-expanded="false" aria-controls="instfake9999"><div class="header"><div class="title"><div class="d-inline-block '.
'icon-container"><div class="courseblock-icon"></div></div><h2 class="sqtitle">'.$flatnavname.'</h2></div></div></div>';
'aria-expanded="false" aria-controls="instfake9999"><div class="header">'.
'<div class="header-container">'.
'<div class="d-inline-block icon-container"><div class="courseblock-icon"></div></div>'.
'<div class="title-container">'.
'<div><h2 class="sqtitle">'.$flatnavname.'</h2></div></div></div></div></div>';
$thisblock->content = $this->render_from_template('theme_squared/flat_navigation_content', $templatecontext);
$thisblock->blockinstanceid = "fake9999"; // Not sure! But we are a 'fake' block.
$thisblock->instanceid = "fake9999";
Expand Down Expand Up @@ -821,9 +826,9 @@ protected function block_annotation(block_contents $bc) {
}

protected function squared_prepare_textlinks($textlinks) {
$textsnippets = explode ( ';', $textlinks );
$textsnippets = explode (';', $textlinks);
foreach ($textsnippets as $value) {
$textandlinks [] = explode ( ',', $value, 2 );
$textandlinks[] = explode (',', $value, 2 );
}
$renderedtext = '';
$lastelement = end ( $textandlinks );
Expand Down
13 changes: 11 additions & 2 deletions scss/_blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
color: inherit;
}
}
.title-container {
.header-container {
display: grid;
grid-template-columns: 64px auto;

.icon-container {
margin-bottom: -5px;
width: 64px;
.courseblock-icon {
margin: 5px 18px;
Expand All @@ -42,6 +44,13 @@
}
}
}

.title-container {
display: flex;
flex-direction: row;
justify-content: space-between;
}

.block_action,
h2.sqtitle {
display: inline !important;
Expand Down
2 changes: 1 addition & 1 deletion tests/coursecattoolbox_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Toolbox unit tests for the Squared theme.
* @group theme_squared
*/
class coursecattoolbox_testcase extends advanced_testcase {
class coursecattoolbox_testcase extends \advanced_testcase {

private $testcategory;
private $toolbox;
Expand Down

0 comments on commit a05bfc4

Please sign in to comment.