Fix issue #61: Ensure course images are square to avoid scaling issues#62
Conversation
A1L13N
left a comment
There was a problem hiding this comment.
Looks great can you please also apply this to the homepage and the detail.HTML page as well as the create a new course page and the image upload currently crops to the rectangle please make the crop function be a square
Updated fix the issue and make these changes
These changes not only address the original issue of image scaling but also improve the overall appearance of course frames. While the main goal was to ensure that images are uploaded as squares in |
Thanks for the feedback! Just to clarify, could you please elaborate a bit on what you mean by "create a new course page"? As we already have the "Courses" section in the navigation bar, I want to make sure I understand if you're referring to something specific that needs to be added or updated. Let me know, and I'll proceed with the changes! |
When a user creates a new course, they upload an image, I'm not sure if we have an image preview there but I think we don't so I think this is complete. Can you please run the pre-commit so the files get formatted and pass the test? Then we can merge! Thank you! |
A1L13N
left a comment
There was a problem hiding this comment.
please run the pre-commit linting
|
Congratulations on your first merged PR! |
Thank you! Sorry for the delay, I’ve been working on resolving the issue, but it’s still not fixed. It says 'flake8...................................................................Failed. |
…-images Fix issue alphaonelabs#61: Ensure course images are square to avoid scaling issues
This pull request resolves issue #61 by ensuring that course images are displayed as squares, preventing any scaling issues. The following changes have been made:
HTML Template Update:
search.htmltemplate to ensure course images are displayed with a square aspect ratio.divstyle to maintain this square aspect ratio, improving the visual consistency of the images.In
create_test_data.py:external_url="https://example.com/default-material"when creatingCourseMaterialinstances. This ensures that theexternal_urlfield, which likely has aNOT NULLconstraint, is always populated with a valid URL, preventing potential database errors during test data creation.In
models.py:material_typefield in theCourseMaterialmodel. This addition expands the flexibility of course materials, allowing the creation and management of more diverse types of content.