Implemented a paging on the profile page for issue #144
Screenshot with "DefaultPackageListPageSize=3"
The bad part is that the UserController is still using the current "PackageService.FindPackagesByOwner" method - so on each page ALL packages of the user will be loaded from the database. To calculate the "TotalDownload" number the code iterates over all packages. If there would be a more clever way to get the "TotalDownload" number the paging could be implemented inside the PackageService as well.
This is one of the oldest open issue (or the oldest?) - so before I rewrite more I wanted to show my current implementation.
"UI" Paging in profiles
Can you do a page size of 10 and also provide a link to "Show All" please?
I use the same page size constant as in the normal packagelist. The screenshot with the page size 3 was just a sample. The current page size is 20.
The showall is a good idea!
add show all packages option on userprofile
Implemented the "Show All Packages" feature:
With "Show All Packages" enabled:
For the page size I still use the "DefaultPackageListPageSize" constant.
After clicking the "show all packages" link, there is no easy way to go back to display the packages with paging (previous and next button). User has to manually browse back using the browser, in order to do this, which is not a good experience.
A suggestion is to add a "Display 20 packages per page" link, on the page of displaying all packages (after clicking the show all link).
Good suggestion - will add this via a new pull request, ok @danliu ?
sounds good to me.
@danliu New PR: #2256