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

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

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

@ -629,7 +629,9 @@ class CustomerProfileOpenProjectsView(BaseMixin, View):
order__team__isnull=True)
trashed_projects = customer.customer_projects.filter(state='trashed', order__contractor__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():
realty = form.cleaned_data.get('realty')
@ -661,7 +663,7 @@ class CustomerProfileOpenProjectsView(BaseMixin, View):
'open_project_count': projects.paginator.count,
'trashed_project_count': trashed_projects.count(),
'num_current_projects': num_current_projects,
'is_paginated': True,
'page_obj': projects,
})
@ -740,6 +742,7 @@ class CustomerProfileCurrentProjectsView(BaseMixin, View):
projects = customer.customer_projects.filter(state='active').exclude(order__contractor__isnull=True,
order__team__isnull=True)
num_current_projects = projects.count()
# trashed_projects = customer.customer_projects.filter(state='trashed')
paginator = Paginator(projects, settings.PAGE_SIZE)
@ -755,7 +758,7 @@ class CustomerProfileCurrentProjectsView(BaseMixin, View):
context.update({
'projects': projects,
'customer': customer,
'num_current_projects': num_current_projects,
# 'open_project_count': projects.paginator.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'])
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({
'reviews': reviews,
'customer': customer,
'num_current_projects': num_current_projects
})
return render(request, self.template_name, context)

Loading…
Cancel
Save