diff --git a/styles.css b/styles.css index 5a2834e0..5beba435 100644 --- a/styles.css +++ b/styles.css @@ -71,12 +71,26 @@ .format-grid .thegrid .grid-image-container { height: 140px; + min-height: 140px; } .format-grid .thegrid .grid-image { position: relative; } +.format-grid .thegrid .grid-image .grid-badge-middle { + left: 0; + position: absolute; + right: 0; +} + +.format-grid .thegrid .grid-image .grid-badge-bottom { + bottom: 1.5rem; + left: 0; + position: absolute; + right: 0; +} + .format-grid .thegrid .grid-generatedimage { background-size: contain; height: 100%; @@ -104,14 +118,14 @@ border-radius: 45px; border-style: solid; border-width: 3px; - bottom: 8%; + bottom: 1rem; display: flex; flex-direction: column; height: 42px; justify-content: center; padding: 4px; position: absolute; - right: 8%; + right: 0.5rem; width: 42px; } diff --git a/templates/coursestyles.mustache b/templates/coursestyles.mustache index f86ca0b1..bdc496da 100644 --- a/templates/coursestyles.mustache +++ b/templates/coursestyles.mustache @@ -36,6 +36,7 @@ /* -- Grid -- */ .format-grid .thegrid .grid-image-container { height: {{height}}px; + min-height: {{height}}px; } .format-grid .thegrid .grid-section { diff --git a/templates/grid.mustache b/templates/grid.mustache index b26e260d..08987447 100644 --- a/templates/grid.mustache +++ b/templates/grid.mustache @@ -26,6 +26,8 @@ * sectionbreak - There is a section break for this section. * sectionbreakheading - Section break heading. * number - Section number. + * sectiontitleingridbox - Show the section title? + * sectionbadgeingridbox - Show the section bagde if any? * iscurrent - Current section? * sectionurl - Section URL. * sectionname - Section name. @@ -61,6 +63,8 @@ "sectioncompletionmarkup": "" } ], + "sectiontitleingridbox": true, + "sectionbadgeingridbox": true, "showcompletion": true } }} @@ -82,35 +86,51 @@
{{/popup}}
+ {{#sectiontitleingridbox}}

{{{sectionname}}}

- {{#hasbadge}} + {{#sectionbadgeingridbox}}{{#hasbadge}}
{{$ core_courseformat/local/content/section/badges }} {{> core_courseformat/local/content/section/badges }} {{/ core_courseformat/local/content/section/badges }}
- {{/hasbadge}} + {{/hasbadge}}{{/sectionbadgeingridbox}}
-
-
- {{#imageuri}} -
- {{imagealttext}} - {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}} -
- {{/imageuri}} - {{#generatedimageuri}} -
- {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}} -
- {{/generatedimageuri}} - {{#imageerror}} -
-

{{imageerror}}

- {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}} + {{/sectiontitleingridbox}} +
+ {{#imageuri}} +
+ {{imagealttext}} + {{^sectiontitleingridbox}}{{#sectionbadgeingridbox}}{{#hasbadge}} +
+ {{$ core_courseformat/local/content/section/badges }} + {{> core_courseformat/local/content/section/badges }} + {{/ core_courseformat/local/content/section/badges }} +
+ {{/hasbadge}}{{/sectionbadgeingridbox}}{{/sectiontitleingridbox}} + {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}} +
+ {{/imageuri}} + {{#generatedimageuri}} +
+ {{^sectiontitleingridbox}}{{#sectionbadgeingridbox}}{{#hasbadge}} +
+ {{$ core_courseformat/local/content/section/badges }} + {{> core_courseformat/local/content/section/badges }} + {{/ core_courseformat/local/content/section/badges }} +
+ {{/hasbadge}}{{/sectionbadgeingridbox}}{{/sectiontitleingridbox}} + {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}} +
+ {{/generatedimageuri}} + {{#imageerror}} +
+

{{imageerror}}

+ {{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}} +
+ {{/imageerror}}
- {{/imageerror}}
{{^popup}} {{#notavailable}}
{{/notavailable}}