hellysmile / django-activeurl

Easy-to-use active URL highlighting for Django
http://django-activeurl.readthedocs.io/en/latest/
Apache License 2.0
158 stars 29 forks source link

URL's with GET parameters won't show as active #20

Closed tony closed 7 years ago

tony commented 7 years ago

e.g. <a href="{% url 'account_login' %}?next={{request.get_full_path}}" won't show as active.

Solution: consider an option that chops off / ignores GET params around https://github.com/hellysmile/django-activeurl/blob/master/django_activeurl/utils.py#L79

hellysmile commented 7 years ago

Hey! It is on my roadmap for more then 1 year. Unforuannely I am not working with django full-time right now. Pull request are welcome to the refactoring branch. I ecpect to do this feature my own in 1.5 month during next vacation ;)

hellysmile commented 7 years ago

Btw, You can try this fork https://github.com/flaiming/django-activeurl/commit/6b6bc4dafe732b327862a2800a271832b5fdb712#diff-90af05de253ae0f93450449acf00552dR60

tony commented 7 years ago

I'm going to try a slightly different approach. A new param with a default value, rather than a setting.

Then I'm going to add a test for it and PR.

Re: https://github.com/flaiming/django-activeurl/commit/6b6bc4dafe732b327862a2800a271832b5fdb712#commitcomment-9649019

I'm going to do a first PR with re.sub w/ tests. Then we can figure out urlparse in a future PR

tony commented 7 years ago

This is in now.