Skip to content

Commit

Permalink
Moved course enrolment icon over course image.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-milette committed May 19, 2024
1 parent 018db13 commit 0993b4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/output/core/course_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,18 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
$content .= '<h3 class="h5 card-title m-1">' . $coursenamelink . '</h4>';
$content .= html_writer::end_tag('div');

$content .= html_writer::start_tag('div', ['class' => 'card-block text-center']);

// Print enrolmenticons.
$content .= html_writer::start_tag('div', ['class' => 'enrolmenticon']);
if ($icons = enrol_get_course_info_icons($course)) {
foreach ($icons as $pixicon) {
$content .= $this->render($pixicon);
}
}
$content .= html_writer::end_tag('div'); // End enrolment icon.

$content .= html_writer::start_tag('div', ['class' => 'pull-right']);
$content .= html_writer::end_tag('div'); // End pull-right.

$content .= html_writer::end_tag('div'); // End card-block.

// Display course contacts. See core_course_list_element::get_course_contacts().
if ($showcardcontact && $course->has_course_contacts()) {
Expand Down
12 changes: 12 additions & 0 deletions scss/trema/courselist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
height: auto;
}
}

.enrolmenticon {
position: absolute;
background-color: rgba(255, 255, 255, .9);
top: 72px;
left: 8px;
border-radius: $softness;
.img, .icon {
padding: 4px;
margin: 0px;
}
}
}

body #page .card-see-more .btn {
Expand Down

0 comments on commit 0993b4f

Please sign in to comment.