Skip to content

Commit

Permalink
MBS-9292: Fix intro layout
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Aug 26, 2024
1 parent 59e2af3 commit bad2e8b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
12 changes: 10 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,23 @@ function learningmap_cm_info_view(cm_info $cm): void {
);
}

$contentbeforemap = $groupdropdown . $intro;
$hascontentbeforemap = !empty($contentbeforemap);

$mapcontainer = $OUTPUT->render_from_template(
'mod_learningmap/rendercontainer',
['cmId' => $cm->id, 'enableLiveUpdater' => true]
[
'cmId' => $cm->id,
'enableLiveUpdater' => true,
'contentbeforemap' => $contentbeforemap,
'hascontentbeforemap' => $hascontentbeforemap,
]
);

$cm->set_custom_cmlist_item(true);
}

$cm->set_content($groupdropdown . $intro . $mapcontainer, true);
$cm->set_content($mapcontainer, true);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,7 @@
.learningmap-backlink {
padding-top: 1rem;
}

.learningmap-container {
width: 100%;
}
25 changes: 22 additions & 3 deletions templates/rendercontainer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,30 @@
Example context (json):
{
"cmId": "123",
"enableLiveUpdater": true
"enableLiveUpdater": true,
<<<<<<< Updated upstream
"contentbeforemap": "<p>Some content before the map</p>"
}
}}
<div id="learningmap-render-container-{{cmId}}" class="learningmap-render-container">
{{> mod_learningmap/loadingplaceholder}}
<div class="learningmap-container">
<div class="learningmap-content-before-map">
{{{contentbeforemap}}}
</div>
=======
"contentbeforemap": "<p>Some content before the map</p>",
"hascontentbeforemap": true
}
}}
<div class="learningmap-container">
{{#hascontentbeforemap}}
<div class="learningmap-content-before-map">
{{{contentbeforemap}}}
</div>
{{/hascontentbeforemap}}
>>>>>>> Stashed changes
<div id="learningmap-render-container-{{cmId}}" class="learningmap-render-container">
{{> mod_learningmap/loadingplaceholder}}
</div>
</div>
{{#js}}
require(['mod_learningmap/renderer'], function(renderer) {
Expand Down

0 comments on commit bad2e8b

Please sign in to comment.