PR-18 Исправить счетчик сообщений

Исправлено
remotes/origin/PR-41
booblegum 9 years ago
parent 3e0d7c8bef
commit 11c27ab460
  1. 12
      assets/css/main.css
  2. 6
      projects/templates/customer_project_create.html
  3. 2
      users/templates/partials/customer_profile_info_block.html
  4. 14
      users/views.py

@ -4950,9 +4950,9 @@ input[type="radio"] + span {
cursor: pointer; cursor: pointer;
} }
.inset-mb input[type="radio"] { /*.inset-mb input[type="radio"] {*/
opacity: 0; /*opacity: 0;*/
} /*}*/
input[type="radio"]:checked + span { input[type="radio"]:checked + span {
background-position: 0 -23px; background-position: 0 -23px;
@ -6055,9 +6055,9 @@ a.linkS2[data-target="#withdraw-money"]{
border: 1px solid #42B476; border: 1px solid #42B476;
} }
input[type="radio"]{ /*input[type="radio"]{*/
opacity: 0; /*opacity: 0;*/
} /*}*/
.wr-inset-pluss{ .wr-inset-pluss{
margin-top: 24px; margin-top: 24px;

@ -89,7 +89,7 @@
{% if form.work_type.value|int == id %}checked{% endif %} {% if form.work_type.value|int == id %}checked{% endif %}
name="{{ form.work_type.html_name }}"> name="{{ form.work_type.html_name }}">
<span></span> {# <span></span>#}
</label> </label>
<p>{{ text }}</p> <p>{{ text }}</p>
@ -191,7 +191,7 @@
{% if form.deal_type.value == 'secure_deal' %}checked{% endif %} {% if form.deal_type.value == 'secure_deal' %}checked{% endif %}
value="secure_deal"> value="secure_deal">
<span></span> {# <span></span>#}
</label> </label>
<p class="text-afer"> <p class="text-afer">
@ -211,7 +211,7 @@
{% if form.deal_type.value == 'direct_payment' %}checked{% endif %} {% if form.deal_type.value == 'direct_payment' %}checked{% endif %}
value="direct_payment"> value="direct_payment">
<span></span> {# <span></span>#}
</label> </label>
<p class="text-afer"> <p class="text-afer">

@ -61,7 +61,7 @@
<div class="roundsCount"> <div class="roundsCount">
{# <div class="countR">0</div>#} {# <div class="countR">0</div>#}
<div class="countG">{{ customer|get_project_message_count }}</div> <div class="countG">{{ num_current_projects }}</div>
</div> </div>
</li> </li>
{% endif %} {% endif %}

@ -629,7 +629,9 @@ class CustomerProfileOpenProjectsView(BaseMixin, View):
order__team__isnull=True) order__team__isnull=True)
trashed_projects = customer.customer_projects.filter(state='trashed', order__contractor__isnull=True, trashed_projects = customer.customer_projects.filter(state='trashed', order__contractor__isnull=True,
order__team__isnull=True) order__team__isnull=True)
# @Add fast
num_current_projects = customer.customer_projects.filter(state='active').exclude(order__contractor__isnull=True,
order__team__isnull=True).count()
if form.is_valid(): if form.is_valid():
realty = form.cleaned_data.get('realty') realty = form.cleaned_data.get('realty')
@ -661,7 +663,7 @@ class CustomerProfileOpenProjectsView(BaseMixin, View):
'open_project_count': projects.paginator.count, 'open_project_count': projects.paginator.count,
'trashed_project_count': trashed_projects.count(), 'trashed_project_count': trashed_projects.count(),
'num_current_projects': num_current_projects,
'is_paginated': True, 'is_paginated': True,
'page_obj': projects, 'page_obj': projects,
}) })
@ -740,6 +742,7 @@ class CustomerProfileCurrentProjectsView(BaseMixin, View):
projects = customer.customer_projects.filter(state='active').exclude(order__contractor__isnull=True, projects = customer.customer_projects.filter(state='active').exclude(order__contractor__isnull=True,
order__team__isnull=True) order__team__isnull=True)
num_current_projects = projects.count()
# trashed_projects = customer.customer_projects.filter(state='trashed') # trashed_projects = customer.customer_projects.filter(state='trashed')
paginator = Paginator(projects, settings.PAGE_SIZE) paginator = Paginator(projects, settings.PAGE_SIZE)
@ -755,7 +758,7 @@ class CustomerProfileCurrentProjectsView(BaseMixin, View):
context.update({ context.update({
'projects': projects, 'projects': projects,
'customer': customer, 'customer': customer,
'num_current_projects': num_current_projects,
# 'open_project_count': projects.paginator.count, # 'open_project_count': projects.paginator.count,
# 'trashed_project_count': trashed_projects.count(), # 'trashed_project_count': trashed_projects.count(),
@ -859,9 +862,14 @@ class CustomerProfileReviewsView(BaseMixin, View):
customer = get_object_or_404(User.customer_objects, pk=self.kwargs['pk']) customer = get_object_or_404(User.customer_objects, pk=self.kwargs['pk'])
reviews = Review.objects.filter(target_customer=customer) reviews = Review.objects.filter(target_customer=customer)
# @Add fast
num_current_projects = customer.customer_projects.filter(state='active').exclude(order__contractor__isnull=True,
order__team__isnull=True).count()
context.update({ context.update({
'reviews': reviews, 'reviews': reviews,
'customer': customer, 'customer': customer,
'num_current_projects': num_current_projects
}) })
return render(request, self.template_name, context) return render(request, self.template_name, context)

Loading…
Cancel
Save