realsuayip / django-sozluk

an exhaustive ekşi sözlük clone, powered by Python
https://sozluk.me
BSD 3-Clause "New" or "Revised" License
320 stars 79 forks source link

Pagination is not showing #63

Closed jsdev11 closed 2 years ago

jsdev11 commented 2 years ago

I've installed the script to play around a little and realized that no matter how many entries I posted, "Show more" and/or pagination did not show up on left sidebar.

I posted 60 + entries and didn't see any pagination or show more, just scrollbar was showing. graphql request always returns:

hasNext: false
hasOtherPages: false
number: 1
objectList: [60+ objects]
paginator: {pageRange: [1], numPages: 1}
numPages: 1
pageRange: [1]

Is this a bug?

realsuayip commented 2 years ago

Go to your settings page and check "entries per page", its probably at 100, set it to 10 and you'll see 6+ pages

jsdev11 commented 2 years ago

On settings page minimum values are entries per page: 10 and topics per page: 30. Can I change this minimum value(s) programmatically or at least can I set these minimum values for authors by default?

Also how about the guests?

# Default options for content object counts
TOPICS_PER_PAGE_DEFAULT = 10  # For guests only
ENTRIES_PER_PAGE_DEFAULT = 10  # For guests only
ENTRIES_PER_PAGE_PROFILE = 15  # Global setting

If I set the TOPICS_PER_PAGE_DEFAULT to 10. Then it always shows last 10 topics on the left sidebar and show more button doesn't load other topics (for guests).

jsdev11 commented 2 years ago

After several hard refresh & restarting the docker etc, now I can see the pagination for guests.

realsuayip commented 2 years ago

these are default values. logged-in users can also dynamically change topics per page and entries per page via

example.com/settings

jsdev11 commented 2 years ago

these are default values. logged-in users can also dynamically change topics per page and entries per page via

example.com/settings

For registered users, topics per page is 50 by default and the minimum value is 30. Can I make the default selected value 30 for registered users? And If possible, can I change the minimum value to a lower one, e.g. 20.

realsuayip commented 2 years ago

Yes, see

https://github.com/realsuayip/django-sozluk/blob/4d8432699fde8abaab7981d09298fb65145c1dba/dictionary/models/author.py#L172

jsdev11 commented 2 years ago

Yes, see

https://github.com/realsuayip/django-sozluk/blob/4d8432699fde8abaab7981d09298fb65145c1dba/dictionary/models/author.py#L172

One line above :) Thank you so much!