From c782b59347efbc187c4ad30767a18b95f78a28ae 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: Thu, 12 Feb 2015 18:05:15 +0200 Subject: [PATCH] Some tasks --- accounts/views.py | 2 +- company/edit_forms.py | 4 ++-- company/edit_views.py | 2 +- templates/client/includes/accounts/current_user.html | 2 +- templates/client/includes/accounts/simple_user.html | 2 +- templates/client/includes/company/company_edit.html | 2 +- templates/client/includes/company/company_object.html | 2 +- templates/client/includes/show_logo.html | 10 +++++++++- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/accounts/views.py b/accounts/views.py index 138d5343..f0cf357a 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -296,7 +296,7 @@ class AvatarView(BaseProfileView): form = self.form_class(self.request.POST, self.request.FILES, instance=profile) profile = form.save() if self.request.is_ajax(): - im = get_thumbnail(profile.avatar, '100x100', crop='center') + im = get_thumbnail(profile.avatar, '100x100') response = {'success': True, 'url': im.url, 'rating': profile.user.rating} return HttpResponse(json.dumps(response), content_type='application/json') else: diff --git a/company/edit_forms.py b/company/edit_forms.py index a4786137..bd3481b4 100644 --- a/company/edit_forms.py +++ b/company/edit_forms.py @@ -37,7 +37,7 @@ class SpecializationForm(BaseForm): class HomeForm(BaseForm): city = forms.CharField(label='Город', required=False, widget=forms.HiddenInput(attrs={'class': 'select2'})) - country = forms.ChoiceField(label=_(u'Страна'), choices=[(c.id, c.name) for c in Country.objects.all()], required=False, + country = forms.ChoiceField(label=_(u'Страна'), choices=[('', '')]+[(c.id, c.name) for c in list(Country.objects.all())], required=False, widget=forms.Select(attrs={'class': 'select2'})) def __init__(self, *args, **kwargs): super(HomeForm, self).__init__(*args, **kwargs) @@ -109,7 +109,7 @@ class SocialForm(BaseForm): class ThemeForm(BaseForm): - theme = forms.ModelMultipleChoiceField(queryset=Theme.objects.all()) + theme = forms.ModelMultipleChoiceField(oqueryset=Theme.objects.all()) class Meta: model = Company fields = ('theme',) diff --git a/company/edit_views.py b/company/edit_views.py index 86b67258..25ecbd10 100644 --- a/company/edit_views.py +++ b/company/edit_views.py @@ -53,7 +53,7 @@ class LogoView(BaseView): form = self.form_class(self.request.POST, self.request.FILES, instance=company) company = form.save() if self.request.is_ajax(): - im = get_thumbnail(company.logo, '100x100', crop='center') + im = get_thumbnail(company.logo, '100x100') response = {'success': True, 'url': im.url, 'rating': company.rating} return HttpResponse(json.dumps(response), content_type='application/json') else: diff --git a/templates/client/includes/accounts/current_user.html b/templates/client/includes/accounts/current_user.html index 47ef119c..29a4d978 100644 --- a/templates/client/includes/accounts/current_user.html +++ b/templates/client/includes/accounts/current_user.html @@ -22,7 +22,7 @@
{% if request.user.profile.avatar %} - {% thumbnail request.user.profile.avatar "100x100" crop="center" as im %} + {% thumbnail request.user.profile.avatar "100x100" as im %} {% endthumbnail %} {% else %} diff --git a/templates/client/includes/accounts/simple_user.html b/templates/client/includes/accounts/simple_user.html index 9f47d95d..96e5de74 100644 --- a/templates/client/includes/accounts/simple_user.html +++ b/templates/client/includes/accounts/simple_user.html @@ -8,7 +8,7 @@