Skip to content

Filter and paginate apps with AJAX requests when adding apps

When JavaScript is available, Repomaker acts like before.

Otherwise it reacts on a scroll event in MDL's content container. Every time the user scrolls to the bottom closer than 800 pixels, an AJAX request is made to the window URL, extended by Django's built-in pagination paramter ?page=. On first load it will load the second page and saves '2' to HTML's session storage. When the user scrolls again close to the bottom, the script increases the page count by one and requests again. If there are no more apps, Repomaker returns 404 resulting in disabling the script's pagination functionality.

When Repomaker returns some apps, the script gets the first app card and uses this as a template for the loaded ones. It replaces the icon, title and other properties of the app and appends it to the page.

What currently does not work is setting the version of an app because Repomaker somehow does not return it via JSON. Additionally, categories are not working.

Issue #98 (closed) is also about pagination in repo apps, therefore this commit does not close it.

Edited by username-removed-26331

Merge request reports

Loading