jmcclell / django-bootstrap-pagination

Django template tag for rendering Page objects as Bootstrap pagination HTML
MIT License
212 stars 83 forks source link

relative GET parameters #34

Closed LennyLip closed 5 years ago

LennyLip commented 9 years ago

Docs:

 If None, then the
               default template simply appends the url parameter as a
               relative URL link, eg: <a href="?page=1">1</a>

hm, im my case (last chrome and firefox windows) it is not relative.

page url http://site.com/url/nested/ with pagination pagination urls on page: http://site.com/?page=2 , etc

i think we need too add request.path here https://github.com/jmcclell/django-bootstrap-pagination/blob/master/bootstrap_pagination/templatetags/bootstrap_pagination.py#L39

LennyLip commented 9 years ago

Fast fix:

add context.request.path before get_page_url https://github.com/jmcclell/django-bootstrap-pagination/blob/master/bootstrap_pagination/templatetags/bootstrap_pagination.py#L179

url = get_page_url(curpage, context.current_app, url_view_name, url_extra_args, url_extra_kwargs, url_param_name, url_get_params)

to

url = context.request.path+get_page_url(curpage, context.current_app, url_view_name, url_extra_args, url_extra_kwargs, url_param_name, url_get_params)

etc... it is works correctly now

jmcclell commented 8 years ago

This would be a great time for a PR :)

jmcclell commented 5 years ago

I tried reproducing this and was not able to. Re-open if you can provide a test case that demonstrates the issue.