remotes/origin/1203
Назар Котюк 11 years ago
parent 4b9a5a1889
commit 1b25c9c6a6
  1. 8
      accounts/forms.py
  2. 2
      accounts/views.py
  3. 16
      article/views.py
  4. 2
      company/edit_views.py
  5. 2
      company/models.py
  6. 5
      conference/admin.py
  7. 2
      conference/forms.py
  8. 15
      templates/admin/conference/conference.html
  9. 10
      templates/admin/conference/conference_all.html
  10. 14
      templates/admin/conference/conference_list.html
  11. 2
      templates/client/includes/accounts/current_user.html
  12. 2
      templates/client/includes/accounts/simple_user.html
  13. 2
      templates/client/includes/company/company_edit.html
  14. 4
      templates/client/includes/company/company_object.html
  15. 11
      templates/client/popups/user_information.html

@ -218,7 +218,7 @@ class EmailAnnouncementForm(forms.Form):
class RegistrationCompleteForm(forms.ModelForm):
country = forms.ChoiceField(label='Страна', choices=[(c.id, c.name) for c in Country.objects.all()],
country = forms.ModelChoiceField(label='Страна', queryset= Country.objects.all(),
widget=forms.Select(attrs={'class': 'select2'}))
city = forms.CharField(label='Город', widget=forms.HiddenInput())
url = forms.CharField(widget=forms.TextInput(attrs={'placeholder': _(u'url(обязательно)')}))
@ -254,12 +254,6 @@ class RegistrationCompleteForm(forms.ModelForm):
return None
def clean_country(self):
try:
return Country.objects.get(id=self.cleaned_data['country'])
except City.DoesNotExist:
return None
def clean_url(self):
url = self.cleaned_data['url']
if not is_latin(url):

@ -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')
im = get_thumbnail(profile.avatar, '100x100', format="PNG")
response = {'success': True, 'url': im.url, 'rating': profile.user.rating}
return HttpResponse(json.dumps(response), content_type='application/json')
else:

@ -1,7 +1,9 @@
import json
from django.views.generic import DetailView, ListView
from django.http import HttpResponse
from models import Article
from forms import ArticleFilterForm
from theme.models import Tag
@ -18,7 +20,10 @@ class NewsList(ListView):
qs = qs.filter(theme__id__in=themes)
tags = self.request.GET.getlist('tag')
if u'' in tags:
tags.remove(u'')
if tags:
tags = tags[0].split(',')
qs = qs.filter(tag__id__in=tags)
return qs
@ -29,6 +34,15 @@ class NewsList(ListView):
context = super(NewsList, self).get_context_data(object_list=self.object_list)
if self.request.GET:
filter_form = ArticleFilterForm(self.request.GET)
tags = self.request.GET.getlist('tag')
if u'' in tags:
tags.remove(u'')
if tags:
tags = tags[0].split(',')
tag_qs = Tag.objects.filter(id__in=tags)
tags = [{'id': str(tag.id), 'text': tag.name} for tag in tag_qs]
filter_form.fields['tag'].widget.attrs['data-predifined'] = json.dumps(tags)
filter_form.fields['tag'].widget.attrs['value'] = ''
else:
filter_form = ArticleFilterForm()
@ -57,6 +71,8 @@ class BlogList(ListView):
qs = qs.filter(theme__id__in=themes)
tags = self.request.GET.getlist('tag')
if u'' in tags:
tags.remove(u'')
if tags:
qs = qs.filter(tag__id__in=tags)

@ -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')
im = get_thumbnail(company.logo, '100x100', format="PNG")
response = {'success': True, 'url': im.url, 'rating': company.rating}
return HttpResponse(json.dumps(response), content_type='application/json')
else:

@ -119,7 +119,7 @@ class Company(TranslatableModel, ExpoMixin):
def calculate_rating(company):
rating_simple = {'country': 5, 'city': 5, 'address_inf': 10, 'phone': 10, 'fax': 5, 'email': 10,
'facebook': 5, 'twitter': 5, 'linkedin': 5, 'vk': 5, 'web_page': 10, #'logo': 20,
'facebook': 5, 'twitter': 5, 'linkedin': 5, 'vk': 5, 'web_page': 10, 'logo': 20,
'specialization': 5, 'description':15, 'foundation': 5, 'staff_number': 5}# участие и посещение доделать
rating_methods = {'theme': 10, 'tag': 5, 'photo':5}
# base rating

@ -236,9 +236,10 @@ class ConferenceView(AdminView):
data = {'web_page':obj.web_page, 'foundation_year': obj.foundation_year,
'data_begin':obj.data_begin, 'data_end':obj.data_end, 'currency':obj.currency,
'tax':obj.tax, 'min_price':obj.min_price, 'max_price':obj.max_price,
'link':obj.link, 'conference_id':obj.id, 'expohit': obj.expohit,
'link':obj.link, 'conference_id':obj.id, 'expohit': obj.expohit, 'periodic':obj.periodic,
'discount': obj.discount,'canceled': obj.canceled, 'moved': obj.moved,
'visitors': obj.visitors, 'members': obj.members,
'visitors': obj.visitors, 'members': obj.members, 'logo': obj.logo,
'audience':[item for item, bool in obj.audience if bool==True],
'quality_label': [item for item, bool in obj.quality_label if bool==True]}
if obj.place:

@ -172,7 +172,7 @@ class ConferenceCreateForm(forms.Form):
if data.get('country'):
conference.country = Country.objects.get(id=data['country'].id)#.id cause select uses queryset
conference.country = Country.objects.get(id=data['country'])#.id cause select uses queryset
if data.get('city'):
conference.city = City.objects.get(id=data['city'])

@ -149,6 +149,13 @@
</div>
</div>
</div>
{# logo #}
<div class="control-group {% if form.logo.errors %}error{% endif %}">
<label class="control-label">{{ form.logo.label }}:</label>
<div class="controls">{{ form.logo }}
<span class="help-inline">{{ form.logo.errors }}</span>
</div>
</div>
</div>
<div class="box span8" >
@ -160,7 +167,13 @@
{% with field='description' form=form languages=languages %}
{% include 'admin/forms/multilang.html' %}
{% endwith %}
{# periodic #}
<div class="control-group {% if form.periodic.errors %}error{% endif %}">
<label class="control-label">{{ form.periodic.label }}:</label>
<div class="controls">{{ form.periodic }}
<span class="help-inline">{{ form.periodic.errors }}</span>
</div>
</div>
{# web_page #}
<div class="control-group {% if form.web_page.errors %}error{% endif %}">
<label class="control-label">{{ form.web_page.label }}:</label>

@ -45,20 +45,16 @@
</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/conference/change/{{ item.url|lower }}">
<a class="btn-small btn-info" href="/admin/conference/{{ item.url|lower }}">
Изменить
</a>
</td>
<td>
<a class="btn-small btn-inverse" href="/admin/conference/copy/{{ item.url|lower }}">
Копировать
</a>
</td>
<td>
<a class="btn btn-danger" href="/admin/conference/delete/{{ item.url|lower }}">
<i class="icon-trash icon-white"></i> Удалить
Удалить
</a>
</td>

@ -56,20 +56,14 @@
</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/conference/change/{{ item.url|lower }}">
<a class="btn-small btn-info" href="/admin/conference/{{ item.url|lower }}">
Изменить
</a>
</td>
<td>
<a class="btn-small btn-inverse" href="/admin/conference/copy/{{ item.url|lower }}">
Копировать
</a>
</td>
<td>
<a class="btn btn-danger" href="/admin/conference/delete/{{ item.url|lower }}">
<i class="icon-trash icon-white"></i> Удалить
<a class="btn-small btn-danger" href="/admin/conference/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
@ -78,7 +72,7 @@
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/conference/add"><i class="icon-plus-sign icon-white"></i> Добавить конференцию</a>
<a class="btn btn-success" href="/admin/conference/"><i class="icon-plus-sign icon-white"></i> Добавить конференцию</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}

@ -22,7 +22,7 @@
<div id="pick-block" class="pic_block">
{% if request.user.profile.avatar %}
{% thumbnail request.user.profile.avatar "100x100" as im %}
{% thumbnail request.user.profile.avatar "100x100" format="PNG" as im %}
<img class="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% else %}

@ -8,7 +8,7 @@
<aside>
<div class="i-pict">
{% if member.profile.avatar %}
{% thumbnail member.profile.avatar "100x100" as im %}
{% thumbnail member.profile.avatar "100x100" format="PNG" as im %}
<img class="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% else %}

@ -20,7 +20,7 @@
<div id="pick-block" class="pic_block">
{% if company.logo %}
{% thumbnail company.logo "100x100" as im %}
{% thumbnail company.logo "100x100" format="PNG" as im %}
<img class="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% else %}

@ -9,7 +9,7 @@
<aside>
<div class="i-pict">
{% if company.logo %}
{% thumbnail company.logo "100x100" as im %}
{% thumbnail company.logo "100x100" format="PNG" as im %}
<img class="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% else %}
@ -24,7 +24,7 @@
<div class="i-title">{{ company.name|safe }}</div>
<div class="i-place p-editable editable-wrap ">
<span class="static-value">
Украина, Белая Церковь
{{ company.country.name }}, {{ company.city.name }}
</span>
</div>
</header>

@ -13,7 +13,16 @@
<li class="input_top">
<div class="pwf-line">
<div class="pwf-field">
{{ form.country }}
<select class="select2" id="id_country" name="country">
{% with countries=form.country.field.queryset %}
{% for country in countries %}
<option value="{{ country.id }}" data-phone-code="{% if country.phone_code %}{{ country.phone_code }}{% endif %}" >{{ country.name }}</option>
{% endfor %}
{% endwith %}
</select>
</div>
<div class="pwf-msg err-message-box"></div>
</div>

Loading…
Cancel
Save