remotes/origin/1203
Назар Котюк 11 years ago
parent 531c85fe6f
commit a4c804348d
  1. 2
      company/views.py
  2. 1
      proj/settings.py
  3. 14
      templates/client/includes/accounts/current_user.html

@ -166,7 +166,7 @@ def get_company(request):
if request.is_ajax():
term = request.GET['term']
qs = Company.objects.language().filter(translations__name__contains=term).distinct()
result = [{'id': company.id, 'label': company.name} for company in qs]
result = [{'id': company.id, 'label': company.name, 'logo': company.logo.url if company.logo else settings.NO_LOGO } for company in qs]
return HttpResponse(json.dumps(result), content_type='application/json')
else:
return HttpResponse('not ajax')

@ -413,3 +413,4 @@ except ImportError, e:
ADMIN_PAGINATION = 20
CLIENT_PAGINATION = 15
TEMPLATE_DEBUG = DEBUG
NO_LOGO = '/static/client/img/no-logo.png'

@ -413,6 +413,20 @@
</div>
{# END about #}
{# companies #}
{% with companies=request.user.created_company.all %}
{% for company in companies %}
{# ссылка с названиями #}
<a href="{{ company.get_permanent_url }}">{{ company.name }}</a>
{# лого #}
{% include 'client/includes/show_logo.html' with obj=company %}
{% endfor %}
{% endwith %}
{# END companies #}
</div>
</div>
</div>

Loading…
Cancel
Save