Commits

Alexandre Macabies committed a5201fa Draft

Added remaining items count in show_more label format()

  • Participants
  • Parent commits 089cd64

Comments (0)

Files changed (1)

endless_pagination/templatetags/endless.py

         querystring_key = context["endless_querystring_key"]
         querystring = utils.get_querystring_for_page(request, page_number,
             querystring_key, default_number=context["endless_default_number"])
+        remaining = page.paginator.count - page.end_index()
         return {
             'path': context["endless_override_path"] or request.path,
             'querystring_key': querystring_key,
             'querystring': querystring,
             'loading': loading,
-            'label': label,
+            'label': label.format(remaining=remaining),
             'request': request,
-            'remaining': page.paginator.count - page.end_index(),
+            'remaining': remaining,
         }
     # no next page, nothing to see
     return {}