MDL-63064 block_starredcourses: make starred block style consistent

This commit remove an unused template and some custom css that has been added
previously and now is no longer necessary.
This commit is contained in:
lameze 2018-10-30 22:35:55 -04:00
parent 8730c0619c
commit 51437e5f6d
7 changed files with 23 additions and 184 deletions

View File

@ -1,55 +0,0 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public Licensebllsdsadfasfd
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_recentcourses/view-cards
This template renders the carousel for the recentcourses block.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "course 3"
}
]
}
}}
<div>
{{#courses}}
<div>
<div class="card course-card">
<a href="{{viewurl}}" tabindex="-1">
<div class="card-img-top recentcoursesimg" style='background-image: url("{{{courseimage}}}");'>
</div>
</a>
<div class="card-body course-info-container" id="course-info-container-{{id}}">
<div class="d-flex">
<div class="card-title">
<a href="{{viewurl}}"
aria-label="{{#shortentext}}12, {{{fullname}}} {{/shortentext}}">
{{#shortentext}}12, {{{fullname}}} {{/shortentext}}
</a>
</div>
</div>
</div>
</div>
</div>
{{/courses}}
</div>

View File

@ -23,7 +23,7 @@
{}
}}
<div id="block-starredcourses-{{uniqid}}" class="block-starred-courses" data-region="starred-courses" data-userid="{{userid}}">
<div id="block-starredcourses-{{uniqid}}" class="block-starredcourses" data-region="starred-courses">
<div class="container-fluid p-0">
{{> block_starredcourses/view }}
</div>

View File

@ -17,10 +17,10 @@
Example context (json):
{}
}}
<div class="card starred-course-card border-0 mx-1 mb-1">
<div class="card dashboard-card border-0">
<div class="card-img-top bg-pulse-grey w-100" style="height: 7rem">
</div>
<div class="card-body starred-course-info-container">
<div class="card-body recent-course-info-container">
<div class="bg-pulse-grey w-100 m-b-3" style="height: 1rem"></div>
</div>
</div>

View File

@ -26,20 +26,25 @@
]
}
}}
<div class="course-card-container d-flex justify-content-around">
{{#courses}}
<a href="{{viewurl}}">
<div class="card starred-course-card mx-1 mb-1">
<div class="card-img-top starred-course-img" style='background-image: url("{{{courseimage}}}");'>
</div>
<div class="card-body starred-course-info-container" id="course-info-container-{{id}}">
<div class="d-flex">
<div class="card-title d-inline-block text-truncate">
{{{fullname}}}
</div>
</div>
</div>
<div class="card-deck dashboard-card-deck" role="list">
{{#courses}}
<div class="card dashboard-card" role="listitem">
<a href="{{viewurl}}" tabindex="-1">
<div class="card-img dashboard-card-img" style='background-image: url("{{{courseimage}}}");'>
<span class="sr-only">{{#str}}aria:courseimage, block_myoverview{{/str}}</span>
{{> block_myoverview/favourite-icon }}
</div>
</a>
{{/courses}}
<div class="card-body pr-1 course-info-container" id="course-info-container-{{id}}">
<div class="d-flex align-items-start">
<div class="card-title mr-2">
<a href="{{viewurl}}">
<span class="sr-only">{{#str}}aria:coursename, block_myoverview{{/str}}</span>
{{#shortentext}}40, {{{fullname}}} {{/shortentext}}
</a>
</div>
</div>
</div>
</div>
{{/courses}}
</div>

View File

@ -29,7 +29,7 @@
data-nocoursesimg="{{nocoursesimg}}">
<div data-region="starred-courses-view-content">
<div data-region="starred-courses-loading-placeholder">
<div class="course-card-container d-flex justify-content-around">
<div class="card-deck dashboard-card-deck">
{{> block_starredcourses/placeholder-course }}
{{> block_starredcourses/placeholder-course }}
{{> block_starredcourses/placeholder-course }}

View File

@ -237,64 +237,3 @@ body.drawer-open-left #region-main.has-blocks {
margin-right: 2px;
}
}
$card-gutter : $card-deck-margin * 2;
.block_starredcourses {
[data-region="starredcoursess-view-content"] {
overflow-x: hidden;
}
.card-deck {
flex-wrap: nowrap;
}
.starredcoursessimg {
height: 7rem;
background-position: center;
background-size: cover;
}
.starredcourses-info-container {
padding: 0.8rem;
.card-title {
max-width: 100%;
a {
max-width: 100%;
}
}
}
.empty-placeholder-image-lg {
height: 125px;
}
}
$card-gutter : $card-deck-margin * 2;
.block_starredcourses {
[data-region="starred-courses-view-content"] {
overflow-x: hidden;
}
.starred-course-card {
flex-basis: auto;
height: 150px;
width: 200px;
flex-shrink: 0;
}
.course-card-container {
height: 150px;
overflow: hidden;
flex-wrap: wrap;
}
.starred-course-img {
height: 7rem;
background-position: center;
background-size: cover;
}
.starred-course-info-container {
padding: 0.8rem;
.card-title {
max-width: 100%;
a {
max-width: 100%;
}
}
}
.empty-placeholder-image-lg {
height: 125px;
}
}

View File

@ -11251,56 +11251,6 @@ div.editor_atto_toolbar button .icon {
.block_settings .block_tree p.hasicon .icon {
margin-right: 2px; }
.block_starredcourses [data-region="starredcoursess-view-content"] {
overflow-x: hidden; }
.block_starredcourses .card-deck {
flex-wrap: nowrap; }
.block_starredcourses .starredcoursessimg {
height: 7rem;
background-position: center;
background-size: cover; }
.block_starredcourses .starredcourses-info-container {
padding: 0.8rem; }
.block_starredcourses .starredcourses-info-container .card-title {
max-width: 100%; }
.block_starredcourses .starredcourses-info-container .card-title a {
max-width: 100%; }
.block_starredcourses .empty-placeholder-image-lg {
height: 125px; }
.block_starredcourses [data-region="starred-courses-view-content"] {
overflow-x: hidden; }
.block_starredcourses .starred-course-card {
flex-basis: auto;
height: 150px;
width: 200px;
flex-shrink: 0; }
.block_starredcourses .course-card-container {
height: 150px;
overflow: hidden;
flex-wrap: wrap; }
.block_starredcourses .starred-course-img {
height: 7rem;
background-position: center;
background-size: cover; }
.block_starredcourses .starred-course-info-container {
padding: 0.8rem; }
.block_starredcourses .starred-course-info-container .card-title {
max-width: 100%; }
.block_starredcourses .starred-course-info-container .card-title a {
max-width: 100%; }
.block_starredcourses .empty-placeholder-image-lg {
height: 125px; }
.navbar {
max-height: 50px; }