Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add counters to project overview #606

Merged
merged 22 commits into from
Apr 27, 2023

Conversation

MyPyDavid
Copy link
Member

@MyPyDavid MyPyDavid commented Apr 5, 2023

This PR contains one of the features mentioned in #355.

  • Adding a counter which shows the total number of projects that exist on the site
  • Perhaps adding an additional counter which shows the number of projects which are currently displayed (after filters have been applied)
  • Counters (numbers) were added to the templates

    • rdmo/projects/templates/projects/projects.html

    • rdmo/projects/templates/projects/projects_pagination.html

    • rdmo/projects/templates/projects/site_projects.html

    • "Search" renamed to "Filter Projects

    • a counter is placed under filter input block in small text:

  • add new translations
  • a bugfix for the pagination in combination with filter was added in the context data of rdmo/projects/views/project.py:

    • added function in rdmo/projects/utils.py
def set_context_querystring_with_filter_and_page(context: dict) -> dict:
   '''prepares the filter part of the querystring for the next and previous hyperlinks in the pagination'''
   if context["filter"].data:
       querystring = context["filter"].data.copy()
       if context["filter"].data.get('page'):
           del querystring['page']
       context['querystring'] = querystring.urlencode()
   return context
# the 'updated' from a Project should always return a valid DateTime value
# when Greatest returns null, then with Coalesce the for 'updated' is taken as fall-back
queryset = queryset.annotate(last_changed=Coalesce(Greatest(last_changed_subquery, 'updated'), 'updated'))

@MyPyDavid MyPyDavid self-assigned this Apr 5, 2023
@coveralls
Copy link

coveralls commented Apr 11, 2023

Coverage Status

Coverage: 90.724% (+0.3%) from 90.469% when pulling 84f9c01 on feature/355-add-counters-to-project-overview into 813df5e on dev-1.10.0.

rdmo/projects/templates/projects/projects_pagination.html Outdated Show resolved Hide resolved
rdmo/projects/templates/projects/site_projects.html Outdated Show resolved Hide resolved
rdmo/projects/views/project.py Outdated Show resolved Hide resolved
@MyPyDavid MyPyDavid added this to the 1.10.0 milestone Apr 14, 2023
@MyPyDavid MyPyDavid marked this pull request as ready for review April 25, 2023 06:23
@jochenklar jochenklar merged commit 7ccd755 into dev-1.10.0 Apr 27, 2023
14 checks passed
@jochenklar jochenklar deleted the feature/355-add-counters-to-project-overview branch April 27, 2023 11:35
CalamityC pushed a commit to CalamityC/rdmo that referenced this pull request Nov 23, 2023
…-counters-to-project-overview

add counters to project overview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants