Commit 6571d43d authored by Olga Brani's avatar Olga Brani Committed by Giorgos Korfiatis
Browse files

astakos: Correct plural in 1 pending membership

parent 1309c393
......@@ -133,7 +133,7 @@
<dl class="alt-style">
<dt>Max participants</dt>
<dd>
{% if object.limit_on_members_number %}
{% if object.limit_on_members_number != None %}
{{object.limit_on_members_number}}
{% else %}Not set{% endif %}
</dd>
......@@ -150,9 +150,10 @@
<dt><a href="{% url project_approved_members object.chain %}" title="view approved members">Approved members</a></dt>
<dd>{{ approved_members_count }}
<span class="faint">
{% if object.limit_on_members_number %}
({% substract object.limit_on_members_number approved_members_count%} memberships remain)
{% if remaining_memberships_count != None %}
({{ remaining_memberships_count }}
membership{{ remaining_memberships_count|pluralize }}
remain{{ remaining_memberships_count|pluralize:"s," }})
{% else %}&nbsp;{% endif %}
</span>
</dd>
......
......@@ -287,7 +287,7 @@ def common_detail(request, chain_or_app_id, project_view=True,
project = None
approved_members_count = 0
pending_members_count = 0
remaining_memberships_count = 0
remaining_memberships_count = None
if project_view:
chain_id = chain_or_app_id
if request.method == 'POST':
......@@ -303,14 +303,15 @@ def common_detail(request, chain_or_app_id, project_view=True,
else:
addmembers_form = AddProjectMembersForm() # initialize form
approved_members_count = 0
pending_members_count = 0
remaining_memberships_count = 0
project, application = get_by_chain_or_404(chain_id)
if project:
members = project.projectmembership_set
approved_members_count = project.members_count()
pending_members_count = project.count_pending_memberships()
_limit = application.limit_on_members_number
if _limit is not None:
remaining_memberships_count = \
max(0, _limit - approved_members_count)
flt = MEMBERSHIP_STATUS_FILTER.get(members_status_filter)
if flt is not None:
members = flt(members)
......@@ -377,6 +378,7 @@ def common_detail(request, chain_or_app_id, project_view=True,
'can_join_request': can_join_req,
'can_leave_request': can_leave_req,
'members_status_filter':members_status_filter,
'remaining_memberships_count': remaining_memberships_count,
})
@require_http_methods(["GET", "POST"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment