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
Update pagination icons to use SVGs #6573
Conversation
Manage this branch in SquashTest this branch here: https://pagination-icons-wrec0.squash.io |
From what I can remember, before I split it up into multiple templates it was a nasty hodgepodge of |
Thanks for that! I'll see if Thibaud and/or Coen think it's worth trying to do that here, or if we should just keep the scope restricted to the icon changes. |
This looks simple to review, should we try to get this in as it is and you do the refactoring in a separate PR? Or would the refactoring drastically change how the icons are defined? |
@thibaudcolas Yeah, let's hold the refactoring for another PR. It wouldn't change the icon updates, really. |
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.
@@ -11,12 +11,18 @@ | |||
<ul> | |||
<li class="prev"> | |||
{% if page.has_previous %} | |||
<a data-page="{{ page.previous_page_number }}" href="{{ base_url }}{% pagination_querystring page.previous_page_number page_key=page_key %}" class="icon icon-arrow-left {{ classnames }}">{% trans "Previous" %}</a> | |||
<a data-page="{{ page.previous_page_number }}" href="{{ base_url }}{% pagination_querystring page.previous_page_number page_key=page_key %}" class="{{ classnames }}"> | |||
{% icon name="arrow-left" class_name="default" %} |
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’m not a big fan of this default
class name (default what?), but this was here before so oh well.
Yes, the larger size was intentional and I forgot to comment on it! Sorry about that. Glad you like it :) Yeah, the |
f2c7f29
to
706627b
Compare
Updates pagination left and right arrow icons to use SVG icons.
I couldn't figure out how to invoke the
icon
template inclusion tag from inside thepagination_link_previous
andpagination_link_next
tags defined inmodeladmin_tags.py
, so I settled for just rendering theicon.html
template into a variable. Definitely open to hearing better ideas on this!The other mild concern I had was the fact that there are three templates that create very very similar pagination code. I didn't have time to fully digest the differences, but I see in the release notes for 2.5 that it was definitely a conscious decision to split out
ajax_pagination_nav
frompagination_nav
. What I'm really not sure about is why_pagination
andpagination_nav
both exist. The main difference appears to be how the URLs for the pagination links are constructed, but I'm not sure why they are different or if they need to be. @gasman, looks like you're the primary contributor to both files. Would you have any insight into that?Thanks for contributing to Wagtail! 🎉
Before submitting, please review the contributor guidelines https://docs.wagtail.io/en/latest/contributing/index.html and check the following:
make lint
from the Wagtail root)