Skip to content

Commit

Permalink
MDL-80396 theme: Refactor media helper class dropped in BS5
Browse files Browse the repository at this point in the history
  • Loading branch information
roland04 committed Jan 19, 2024
1 parent 810554e commit d98c7ed
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 85 deletions.
6 changes: 3 additions & 3 deletions admin/tool/dataprivacy/templates/request_details.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
}
}}
<div class="container" data-requestid="{{id}}">
<div class="media">
<div class="media-left">
<div class="d-flex">
<div class="flex-shrink-0">
<img class="userpicture" src="{{foruser.profileimageurl}}"
alt="{{#str}}pictureof, moodle, {{foruser.fullname}}{{/str}}"
title="{{#str}}pictureof, moodle, {{foruser.fullname}}{{/str}}" />
</div>
<div class="media-body">
<div class="flex-grow-1 ml-3">
<h4 class="mt-0 mb-1">
<a href="{{foruser.profileurl}}" title="{{#str}}viewprofile{{/str}}">{{foruser.fullname}}</a>
</h4>
Expand Down
28 changes: 13 additions & 15 deletions course/format/templates/local/content/cm/cmname.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,19 @@
{{/activityicon}}

{{! Name & Badge}}
<div class="activity-name-area activity-instance d-flex flex-column mr-2 ">
<div class="activitytitle media {{textclasses}} modtype_{{modname}} position-relative align-self-start">
<div class="media-body align-self-center">
<div class="activityname">
{{#activityname}}
{{$ core/inplace_editable }}
{{> core/inplace_editable }}
{{/ core/inplace_editable }}
{{/activityname}}
{{#activitybadge}}
{{$ core_courseformat/local/content/cm/activitybadge }}
{{> core_courseformat/local/content/cm/activitybadge }}
{{/ core_courseformat/local/content/cm/activitybadge }}
{{/activitybadge}}
</div>
<div class="activity-name-area activity-instance d-flex flex-column mr-2">
<div class="activitytitle {{textclasses}} modtype_{{modname}} position-relative align-self-start">
<div class="activityname">
{{#activityname}}
{{$ core/inplace_editable }}
{{> core/inplace_editable }}
{{/ core/inplace_editable }}
{{/activityname}}
{{#activitybadge}}
{{$ core_courseformat/local/content/cm/activitybadge }}
{{> core_courseformat/local/content/cm/activitybadge }}
{{/ core_courseformat/local/content/cm/activitybadge }}
{{/activitybadge}}
</div>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions course/format/templates/local/courseindex/placeholders.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@
{}
}}
<div data-region="loading-placeholder-content" aria-hidden="true" id="course-index-placeholder">
<ul class="media-list">
<li class="media">
<div class="media-body col-md-6 p-0 d-flex align-items-center">
<ul class="placeholders list-unstyled px-5">
<li>
<div class="col-md-6 p-0 d-flex align-items-center">
<div class="bg-pulse-grey rounded-circle mr-2"></div>
<div class="bg-pulse-grey w-100"></div>
</div>
</li>
<li class="media">
<div class="media-body col-md-6 p-0 d-flex align-items-center">
<li>
<div class="col-md-6 p-0 d-flex align-items-center">
<div class="bg-pulse-grey rounded-circle mr-2"></div>
<div class="bg-pulse-grey w-100"></div>
</div>
</li>
<li class="media">
<div class="media-body col-md-6 p-0 d-flex align-items-center">
<li>
<div class="col-md-6 p-0 d-flex align-items-center">
<div class="bg-pulse-grey rounded-circle mr-2"></div>
<div class="bg-pulse-grey w-100"></div>
</div>
</li>
<li class="media">
<div class="media-body col-md-6 p-0 d-flex align-items-center">
<li>
<div class="col-md-6 p-0 d-flex align-items-center">
<div class="bg-pulse-grey rounded-circle mr-2"></div>
<div class="bg-pulse-grey w-100"></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions lib/templates/local/notification/cta.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
}}

<div class="cta alert alert-primary alert-block fade in {{ extraclasses }}" {{# region }}data-region="{{ region }}"{{/ region}}>
<div class="media">
<div class="cta-icon mr-2 icon-size-5">
<div class="d-flex">
<div class="cta-icon mr-2 icon-size-5 flex-shrink-0">
{{# pix }} {{ icon.pix }}, {{ icon.component }} {{/ pix }}
</div>
<div class="media-body align-self-center">
<div class="align-self-center flex-grow-1">
{{{ message }}}<br>
{{# actions }}
<a href="{{ url }}" class="link-underline aalink"
Expand Down
10 changes: 5 additions & 5 deletions tag/templates/tagfeed.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
}

}}
<ul class="tag_feed media-list">
<ul class="tag_feed">
{{#items}}
<li class="media">
<li class="d-flex mb-1">
{{#img}}
<div class="itemimage">
<div class="flex-shrink-0">
{{{img}}}
</div>
{{/img}}
<div class="media-body">
<div class="flex-grow-1 px-2">
{{#heading}}
<div class="media-heading">
<div class="item-heading">
{{{heading}}}
</div>
{{/heading}}
Expand Down
17 changes: 4 additions & 13 deletions theme/boost/scss/moodle/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -869,21 +869,12 @@ tr.flagged-tag a {
padding-left: 17px;
}

.tag_feed.media-list .media .itemimage {
float: left;
}

.tag_feed.media-list .media .itemimage img {
height: 35px;
width: 35px;
}

.tag_feed.media-list .media .media-body {
padding-right: 10px;
padding-left: 10px;
.tag_feed img {
max-height: 35px;
max-width: 35px;
}

.tag_feed .media .muted a {
.tag_feed .muted a {
color: $text-muted;
}

Expand Down
2 changes: 1 addition & 1 deletion theme/boost/scss/moodle/courseindex.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ $courseindex-item-current: $primary !default;
}

// Placeholders.
.media-list {
.placeholders {
.rounded-circle {
height: 1rem;
width: 1rem;
Expand Down
21 changes: 6 additions & 15 deletions theme/boost/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -23756,21 +23756,12 @@ tr.flagged-tag a {
padding-left: 17px;
}

.tag_feed.media-list .media .itemimage {
float: left;
}

.tag_feed.media-list .media .itemimage img {
height: 35px;
width: 35px;
}

.tag_feed.media-list .media .media-body {
padding-right: 10px;
padding-left: 10px;
.tag_feed img {
max-height: 35px;
max-width: 35px;
}

.tag_feed .media .muted a {
.tag_feed .muted a {
color: #6a737b;
}

Expand Down Expand Up @@ -38329,11 +38320,11 @@ div.editor_atto_toolbar button .icon {
.courseindex.editing .d-flex-noedit {
display: flex;
}
.courseindex .media-list .rounded-circle {
.courseindex .placeholders .rounded-circle {
height: 1rem;
width: 1rem;
}
.courseindex .media-list .w-100 {
.courseindex .placeholders .w-100 {
height: 1rem;
margin: 0.5rem 0;
}
Expand Down
12 changes: 6 additions & 6 deletions theme/boost/templates/flat_navigation.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@
<li>
<a class="list-group-item list-group-item-action {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" href="{{{action}}}" data-key="{{key}}" data-isexpandable="{{isexpandable}}" data-indent="{{get_indent}}" data-showdivider="{{showdivider}}" data-type="{{type}}" data-nodetype="{{nodetype}}" data-collapse="{{collapse}}" data-forceopen="{{forceopen}}" data-isactive="{{isactive}}" data-hidden="{{hidden}}" data-preceedwithhr="{{preceedwithhr}}" {{#parent.key}}data-parent-key="{{.}}"{{/parent.key}}>
<div class="ml-{{get_indent}}">
<div class="media">
<div class="d-flex">
{{#icon.pix}}
<span class="media-left">
<span class="flex-shrink-0">
{{#pix}}{{{icon.pix}}}, {{{icon.component}}}, {{{icon.alt}}}{{/pix}}
</span>
{{/icon.pix}}
<span class="media-body {{#isactive}}font-weight-bold{{/isactive}}">{{{text}}}</span>
<span class="flex-grow-1 ml-3 {{#isactive}}font-weight-bold{{/isactive}}">{{{text}}}</span>
</div>
</div>
</a>
Expand All @@ -85,13 +85,13 @@
<li>
<div class="list-group-item {{#classes}}{{.}} {{/classes}}" data-key="{{key}}" data-isexpandable="{{isexpandable}}" data-indent="{{get_indent}}" data-showdivider="{{showdivider}}" data-type="{{type}}" data-nodetype="{{nodetype}}" data-collapse="{{collapse}}" data-forceopen="{{forceopen}}" data-isactive="{{isactive}}" data-hidden="{{hidden}}" data-preceedwithhr="{{preceedwithhr}}" {{#parent.key}}data-parent-key="{{.}}"{{/parent.key}}>
<div class="ml-{{get_indent}}">
<div class="media">
<div class="d-flex">
{{#icon.pix}}
<span class="media-left">
<span class="flex-shrink-0">
{{#pix}}{{{icon.pix}}}, {{{icon.component}}}, {{{icon.alt}}}{{/pix}}
</span>
{{/icon.pix}}
<span class="media-body">{{{text}}}</span>
<span class="flex-grow-1 ml-3">{{{text}}}</span>
</div>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions theme/boost/upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
This file describes API changes in /theme/boost
information provided here is intended especially for theme designers.

=== 4.4 ===
* The bootstrap ´.media´ helper class has been replaced with utility classes (´d-flex´, ´flex-shrink-´, ´flex-grow-´, ...)

=== 4.3 ===
* The $activity-iconcontainer-height and $activity-iconcontainer-width variables have been changed from 50px to 52px.
* New SCSS mixin optional_animate to animate an element unless if the user has reduced motion in their preferences.
Expand Down
21 changes: 6 additions & 15 deletions theme/classic/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -23756,21 +23756,12 @@ tr.flagged-tag a {
padding-left: 17px;
}

.tag_feed.media-list .media .itemimage {
float: left;
}

.tag_feed.media-list .media .itemimage img {
height: 35px;
width: 35px;
}

.tag_feed.media-list .media .media-body {
padding-right: 10px;
padding-left: 10px;
.tag_feed img {
max-height: 35px;
max-width: 35px;
}

.tag_feed .media .muted a {
.tag_feed .muted a {
color: #6a737b;
}

Expand Down Expand Up @@ -38263,11 +38254,11 @@ div.editor_atto_toolbar button .icon {
.courseindex.editing .d-flex-noedit {
display: flex;
}
.courseindex .media-list .rounded-circle {
.courseindex .placeholders .rounded-circle {
height: 1rem;
width: 1rem;
}
.courseindex .media-list .w-100 {
.courseindex .placeholders .w-100 {
height: 1rem;
margin: 0.5rem 0;
}
Expand Down

0 comments on commit d98c7ed

Please sign in to comment.