From 11c27ab4606b8084ad9a2c3f482491aaeeed63d0 Mon Sep 17 00:00:00 2001 From: booblegum Date: Tue, 22 Nov 2016 21:35:28 +0300 Subject: [PATCH] =?UTF-8?q?PR-18=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D1=81=D1=87=D0=B5=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправлено --- assets/css/main.css | 12 ++++++------ projects/templates/customer_project_create.html | 6 +++--- .../partials/customer_profile_info_block.html | 2 +- users/views.py | 14 +++++++++++--- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 0afa2c3..30d3ad6 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -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; diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html index bba6cd8..9a8131a 100644 --- a/projects/templates/customer_project_create.html +++ b/projects/templates/customer_project_create.html @@ -89,7 +89,7 @@ {% if form.work_type.value|int == id %}checked{% endif %} name="{{ form.work_type.html_name }}"> - +{# #}

{{ text }}

@@ -191,7 +191,7 @@ {% if form.deal_type.value == 'secure_deal' %}checked{% endif %} value="secure_deal"> - +{# #}

@@ -211,7 +211,7 @@ {% if form.deal_type.value == 'direct_payment' %}checked{% endif %} value="direct_payment"> - +{# #}

diff --git a/users/templates/partials/customer_profile_info_block.html b/users/templates/partials/customer_profile_info_block.html index f0cac88..28dc017 100644 --- a/users/templates/partials/customer_profile_info_block.html +++ b/users/templates/partials/customer_profile_info_block.html @@ -61,7 +61,7 @@

{#
0
#} -
{{ customer|get_project_message_count }}
+
{{ num_current_projects }}
{% endif %} diff --git a/users/views.py b/users/views.py index 4fdb5e2..cc32c27 100644 --- a/users/views.py +++ b/users/views.py @@ -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)