Skip to content

Commit

Permalink
Use "count of total" for the progress in projects table
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Nov 16, 2023
1 parent 2c2afef commit ade14af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rdmo/projects/templatetags/projects_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ def project_progress(project):
if project.progress_count is None or project.progress_total is None:
return ''

return _('%(count)s of %(total)s') % {
'count': project.progress_count,
'total': project.progress_total
}

@register.simple_tag()
def project_progress_ratio(project):
if project.progress_count is None or project.progress_total is None:
return ''

try:
ratio = project.progress_count / project.progress_total
except ZeroDivisionError:
Expand Down

0 comments on commit ade14af

Please sign in to comment.