diff --git a/classes/output/courseformat/content.php b/classes/output/courseformat/content.php index ebc5ef68..63591219 100644 --- a/classes/output/courseformat/content.php +++ b/classes/output/courseformat/content.php @@ -159,9 +159,6 @@ public function export_for_template(\renderer_base $output) { // Section badge in grid box. $data->sectionbadgeingridbox = ($coursesettings['sectionbadgeingridbox'] == 2); - // Title and / org badge? - $data->sectiontitleandorbadgeingridbox = ($data->sectiontitleingridbox || $data->sectionbadgeingridbox); - // Popup. if (!$editing) { $data->popup = false; diff --git a/styles.css b/styles.css index d2e01232..8ce760a9 100644 --- a/styles.css +++ b/styles.css @@ -79,6 +79,12 @@ position: relative; } +.format-grid .thegrid .grid-image .grid-badge-middle { + left: 0; + position: absolute; + right: 0; +} + .format-grid .thegrid .grid-generatedimage { background-size: contain; height: 140px; diff --git a/templates/grid.mustache b/templates/grid.mustache index d17a6545..64419809 100644 --- a/templates/grid.mustache +++ b/templates/grid.mustache @@ -28,7 +28,6 @@ * number - Section number. * sectiontitleingridbox - Show the section title? * sectionbadgeingridbox - Show the section bagde if any? - * sectiontitleandorbadgeingridbox - Is the title and or badge in the grid box? * iscurrent - Current section? * sectionurl - Section URL. * sectionname - Section name. @@ -66,7 +65,6 @@ ], "sectiontitleingridbox": true, "sectionbadgeingridbox": true, - "sectiontitleandorbadgeingridbox": true, "showcompletion": true } }} @@ -87,11 +85,9 @@ {{#popup}}
{{/popup}} - {{#sectiontitleandorbadgeingridbox}} + {{#sectiontitleingridbox}}
- {{#sectiontitleingridbox}}

{{{sectionname}}}

- {{/sectiontitleingridbox}} {{#sectionbadgeingridbox}}{{#hasbadge}}
{{$ core_courseformat/local/content/section/badges }} @@ -100,20 +96,34 @@
{{/hasbadge}}{{/sectionbadgeingridbox}}
- {{/sectiontitleandorbadgeingridbox}} + {{/sectiontitleingridbox}} {{#imageuri}} -
+
{{imagealttext}} + {{^sectiontitleingridbox}}{{#hasbadge}} +
+ {{$ core_courseformat/local/content/section/badges }} + {{> core_courseformat/local/content/section/badges }} + {{/ core_courseformat/local/content/section/badges }} +
+ {{/hasbadge}}{{/sectiontitleingridbox}} {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}}
{{/imageuri}} {{#generatedimageuri}} -
+
+ {{^sectiontitleingridbox}}{{#hasbadge}} +
+ {{$ core_courseformat/local/content/section/badges }} + {{> core_courseformat/local/content/section/badges }} + {{/ core_courseformat/local/content/section/badges }} +
+ {{/hasbadge}}{{/sectiontitleingridbox}} {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}}
{{/generatedimageuri}} {{#imageerror}} -
+

{{imageerror}}

{{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}}