From 40513a90d904484e554df1d0fffb01c648588577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B0=D0=B7=D0=B0=D1=80=20=D0=9A=D0=BE=D1=82=D1=8E?= =?UTF-8?q?=D0=BA?= Date: Wed, 28 Jan 2015 17:21:16 +0200 Subject: [PATCH] Tasks --- company/edit_views.py | 6 +++- .../includes/company/company_object.html | 35 ++++++++++++------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/company/edit_views.py b/company/edit_views.py index 11e8b775..f2ed62ad 100644 --- a/company/edit_views.py +++ b/company/edit_views.py @@ -25,7 +25,11 @@ class BaseView(ProfileInvalidView): form = self.form_class(self.request.POST, instance=company) company = form.save() - response = {'success': True, 'rating': company.rating} + try: + rating = company.rating + except AttributeError: + rating = company.master.rating + response = {'success': True, 'rating': rating} return HttpResponse(json.dumps(response), content_type='application/json') diff --git a/templates/client/includes/company/company_object.html b/templates/client/includes/company/company_object.html index b779966b..a0b4cafa 100644 --- a/templates/client/includes/company/company_object.html +++ b/templates/client/includes/company/company_object.html @@ -23,22 +23,28 @@
{{ company.specialization }}
+ {% with themes=company.theme.all %} +
+ {% for th in themes %} + {{ th.name }}{% ifnotequal forloop.counter themes|length %},{% endifnotequal %} + {% endfor %} +
+ {% endwith %} +
- {% if company.address %} - {% with address=company.address %} - {% include 'includes/address_block.html' %} +
+ {% with tags=company.tag.all %} + {% for tag in tags %} + {{ tag.name }}, + {% endfor %} {% endwith %} -
- {% endif %} - -
- {% with obj=company filter=filter %} - {% include 'includes/show_tags.html' %} - {% endwith %}

+ {{ company.address_inf }} +
+
@@ -168,12 +174,16 @@