pytition / Pytition

Django app for self-hosted privacy-friendly online petitions
https://pytition.org
BSD 3-Clause "New" or "Revised" License
100 stars 28 forks source link

Add pagination for petitions (#240) #242

Closed pnu-s closed 4 years ago

pnu-s commented 4 years ago

Fixes #240

image

Notes:

pnu-s commented 4 years ago

@fallen Damn, I totally forgot to check whether the template generic_petition_list.html was used for other views... Not sure neither how petitions.has_other_pages doesn't crash but it seems this case is handled by Django.

I'm not sure what is the best option here:

  1. Move the pagination HTML to index.html
  2. Add the paginator everywhere

I'd go with option 1 personally, as I'm not sure pagination makes sense everywhere (for instance for the all_petition option).

WDYT?

fallen commented 4 years ago

I'm not sure what is the best option here:

1. Move the pagination HTML to index.html

2. Add the paginator everywhere

I'd go with option 1 personally, as I'm not sure pagination makes sense everywhere (for instance for the all_petition option).

WDYT?

I kind of think using Paginator makes sense everywhere, except - I would say - in the dashboards. What do you think @martinlehoux ?

pnu-s commented 4 years ago

@fallen Then I guess it doesn't make sense to keep the whole all_petitions.html template, as it is essentially the same as index.html now with pagination.

I can make the changes. I'll add it anyway on org and user profile, it will only show if there are more than 12 petitions, otherwise it'll be the same as now

fallen commented 4 years ago

@fallen Then I guess it doesn't make sense to keep the whole all_petitions.html template, as it is essentially the same as index.html now with pagination.

I can make the changes. I'll add it anyway on org and user profile, it will only show if there are more than 12 petitions, otherwise it'll be the same as now

Sure, you're right, I think we can get rid of all_petitions.html. Nice catch!

pnu-s commented 4 years ago

Just made the changes as discussed.