-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
💄 [#1169] Make images/icons have static sizes in cards #526
💄 [#1169] Make images/icons have static sizes in cards #526
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #526 +/- ##
========================================
Coverage 96.47% 96.47%
========================================
Files 539 540 +1
Lines 19211 19216 +5
========================================
+ Hits 18534 18539 +5
Misses 677 677
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@jiromaykin laten we deze zo samen even doornemen |
18985b0
to
5232c1b
Compare
@alextreme We could decide to add this version for now, as a form on 'intermediate but improved' state - this version doesn't have the 'fallback' option removed yet though - should we make it required to always choose an icon? |
No, as discussed on monday we can keep the fallback option as-is, as long as we don't cause weird aspect ratio's anymore this should be fine. Happy to merge if you and Vasileios are happy with this |
This intermediate stage still needs to be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused with this PR. I understood that we want the changes only for the theme-cards and not for the product ones (which will be fixed in another PR). If I am wrong let me know please.
@@ -60,7 +60,7 @@ def page_title(self): | |||
def get_context_data(self, **kwargs): | |||
config = SiteConfiguration.get_solo() | |||
|
|||
limit = 3 if self.request.user.is_authenticated else 4 | |||
limit = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this variable now as the limit is not dynamic any more. Let's use the number directly in each queryset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future I may have to make a difference between the mobile limit and the desktop limit, which hopefully can be done in the templates somewhere (not sure yet), so I guess this can be cleaned up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vaszig I now see the 'limit' is used 5 times in this file; is it really a good idea to remove the 'limit' variable? I would think it is cleaner to keep it and reuse it instead of the value? (in javascript I would keep the variable, not sure if this is also Python convention).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a variable if I wanted first to evaluate something and then reuse it (Not in Python, in every language). Here we don;t need to evaluate something, it's just an integer. But this is my knowledge, @Bartvaderkin can you tell us your opinion please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vaszig @jiromaykin I would keep the variable, so we can see all the usages are linked to the same value. If we'd put the plain number everywhere you get a magic number situation where it isn't clear which numbers are related or just happen to have the same value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bartvaderkin @vaszig Hoorrah! in Javascript I would use a 'const' for numbers like these - so I declare this PR as finished and ready for review again :-)
This is a PR that will change overall responsiveness of all of the columns so everything looks better already before continuing to fine-tuning later; so this one is more about the weird resizing of ALL of the card-columns -this means the Theme card images will remain stable - the Product card images don't need responsiveness for now so they don't need to change here; old columns that need to become 'static' on mobile example: |
f85ec93
to
7aa99f7
Compare
eb4f9ee
to
111a455
Compare
@vaszig This may not look very impressive, but hopefully this works well as an in-between stage with some new CSS classes for future views; hopefully I haven't made any columns/views act all weird here. |
|
||
.home { | ||
.card-container { | ||
grid-template-columns: repeat(auto-fit, 228px); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vaszig For mobile: horizontal scrolling will be added later in a different issue so it will look better, but the cards will need to remain this same size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think @alextreme ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now, the scrolling is something Jiro will continue on but these changes are a necessary first step for that.
issue here: https://taiga.maykinmedia.nl/project/open-inwoner/task/1169
This would solve the problem where 'icons' no longer look like this (with potentially cut-off heads): when the screensize gets smaller than the container - the only way to do this would be to set static sizes for the cards on all screenwidths, and inform the user which sizes need to be used for icons.
Note: this is not for images in Product cards.
ToDo:
other todo's to make the card align with design will be done later when decision is made about horizontal scroll and about the number of carsds in 1 column on mobile