willianmano / moodle-theme_moove

A Moodle Boost child theme
GNU General Public License v3.0
170 stars 155 forks source link

Student viewing course page before they are enrolled - the course image shows top left corner of image, not center of image #425

Closed davefoord closed 11 months ago

davefoord commented 1 year ago

Describe the bug When a course has a course image attached, any item which shows the image will crop the image focussing on the center of the image. However, if a student follows a link to a course onto which they are not yet enrolled - this shows the course image, but it crops to the top left corner of the image, which looks really odd.

To Reproduce Steps to reproduce the behavior:

  1. Create a course with a large image attached as the course image. Do not enrol your test student onto the course
  2. Log in as the test student
  3. Visit the course page

Expected behavior Course image should crop to the center of the image, as happens on things like the dashboard, my courses etc.

Your environment (please complete the following information):

davefoord commented 1 year ago

Has anyone looked at this issue yet? I am assuming that it will be a relatively easy fix - and would be very useful.

davefoord commented 1 year ago

Actually - I have managed to work out the CSS that I need to add, to correct this, if that helps you at all:

.dashboard-card .dashboard-card-img { background-position: center; background-size: cover; }

willianmano commented 11 months ago

@davefoord I added your code. Thank you.