remotes/origin/1203
kotzilla 12 years ago
parent 2c28e0a4e9
commit c4a9451564
  1. 2
      accounts/edit_forms.py
  2. 17
      accounts/views.py
  3. 8
      city/admin.py
  4. 3
      city/admin_urls.py
  5. 5
      city/forms.py
  6. 8
      exposition/admin.py
  7. 3
      exposition/admin_urls.py
  8. 5
      exposition/forms.py
  9. 26
      functions/admin_forms.py
  10. 84
      functions/admin_views.py
  11. 6
      photologue/client_urls.py
  12. 15
      photologue/client_view.py
  13. 8
      place_exposition/admin.py
  14. 6
      place_exposition/admin_urls.py
  15. 22
      place_exposition/forms.py
  16. 9
      settings/templatetags/template_filters.py
  17. 69
      templates/admin/accounts/user_list.html
  18. 10
      templates/admin/admin_list.html
  19. 56
      templates/admin/city/city_list.html
  20. 62
      templates/admin/company/company_list.html
  21. 86
      templates/admin/conference/conference_list.html
  22. 57
      templates/admin/country/contry_list.html
  23. 81
      templates/admin/exposition/exposition_list.html
  24. 47
      templates/admin/includes/admin_pagination.html
  25. 58
      templates/admin/organiser/organiser_list.html
  26. 2
      templates/admin/place_conference/place_conference_all.html
  27. 65
      templates/admin/place_conference/place_conference_list.html
  28. 66
      templates/admin/place_exposition/place_exposition_list.html
  29. 87
      templates/admin/seminar/seminar_list.html
  30. 70
      templates/admin/theme/tag_list.html
  31. 66
      templates/admin/theme/theme_list.html
  32. 64
      templates/admin/translator/translator_list.html
  33. 89
      templates/admin/webinar/webinar_list.html
  34. 30
      templates/client/accounts/new_profile.html
  35. 1
      templates/client/blank.html
  36. 78
      templates/client/place/place_photo.html
  37. 48
      templates/client/popups/photo.html
  38. 68
      templates/client/static_client/css/main.css
  39. 158
      templates/client/static_client/js/main.js
  40. 9
      templates/client/static_client/js/pages/company.js
  41. 149
      templates/client/static_client/js/pages/place_photo.js
  42. 94
      templates/client/static_client/js/pages/profile.js

@ -8,7 +8,7 @@ from company.models import Company
class AvatarForm(forms.ModelForm): class AvatarForm(forms.ModelForm):
avatar = forms.ImageField(label=_(u'Выберите файл (GIF, JPG, PNG. Размер 100 × 100 пикселей)'), avatar = forms.ImageField(label=_(u'Выберите файл (GIF, JPG, PNG. Размер 100 × 100 пикселей)'),
required=False) required=False, widget=forms.FileInput(attrs={'class': 'input'}))
class Meta: class Meta:
model = Profile model = Profile
fields = ('avatar',) fields = ('avatar',)

@ -14,6 +14,8 @@ from models import User
import json, datetime import json, datetime
import calendar as python_calendar import calendar as python_calendar
from django.views.generic import TemplateView, FormView, ListView from django.views.generic import TemplateView, FormView, ListView
from sorl.thumbnail import get_thumbnail
class SettingsView(TemplateView): class SettingsView(TemplateView):
template_name = 'accounts/settings.html' template_name = 'accounts/settings.html'
@ -240,10 +242,19 @@ class AvatarView(BaseProfileView):
def form_valid(self, form): def form_valid(self, form):
profile = self.request.user.profile profile = self.request.user.profile
if not self.request.FILES:
response = {'success': False, 'message':'files is empty'}
return HttpResponse(json.dumps(response), content_type='application/json')
form = self.form_class(self.request.POST, self.request.FILES, instance=profile) form = self.form_class(self.request.POST, self.request.FILES, instance=profile)
form.save() form.save()
response = {'success': True} if self.request.is_ajax():
return HttpResponse(json.dumps(response), content_type='application/json') im = get_thumbnail(profile.avatar, '100x100', crop='center')
response = {'success': True, 'url': im.url}
#response = {'success': True}
return HttpResponse(json.dumps(response), content_type='application/json')
else:
return HttpResponseRedirect('/profile/')
class HomeView(BaseProfileView): class HomeView(BaseProfileView):
@ -300,7 +311,6 @@ def test(request):
from exposition.models import Exposition from exposition.models import Exposition
def get_user(url): def get_user(url):
try: try:
url = int(url) url = int(url)
@ -355,4 +365,3 @@ class UserSeminarView(UserEventView):
user = get_user(url) user = get_user(url)
self.obj = user self.obj = user
return user.seminar_users.all() return user.seminar_users.all()

@ -6,12 +6,13 @@ from django.conf import settings
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
#models and forms #models and forms
from forms import CityForm, CityDeleteForm from forms import CityForm, CityDeleteForm, CityFilterForm
from models import City from models import City
from file.models import FileModel from file.models import FileModel
from file.forms import FileModelForm from file.forms import FileModelForm
#custom views #custom views
from functions.custom_views import objects_list, add_object_with_file, delete_object from functions.custom_views import objects_list, add_object_with_file, delete_object
from functions.admin_views import AdminListView
def city_all(request): def city_all(request):
@ -105,3 +106,8 @@ def search_city(request):
result = [{'id': city.id, 'label': city.name} for city in qs] result = [{'id': city.id, 'label': city.name} for city in qs]
return HttpResponse(json.dumps(result), content_type='application/json') return HttpResponse(json.dumps(result), content_type='application/json')
class CityListView(AdminListView):
template_name = 'admin/city/city_list.html'
form_class = CityFilterForm
model = City

@ -1,11 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from admin import CityListView
urlpatterns = patterns('city.admin', urlpatterns = patterns('city.admin',
url(r'^add/$', 'city_add'), url(r'^add/$', 'city_add'),
url(r'^delete/(?P<url>.*)/$', 'city_delete'), url(r'^delete/(?P<url>.*)/$', 'city_delete'),
url(r'^change/(.*)/$', 'city_change'), url(r'^change/(.*)/$', 'city_change'),
url(r'^all/$', 'city_all'), url(r'^all/$', CityListView.as_view()),
url(r'^search/$', 'search_city'), url(r'^search/$', 'search_city'),
) )

@ -13,6 +13,7 @@ from directories.models import Iata
from functions.translate import fill_with_signal from functions.translate import fill_with_signal
from functions.form_check import is_positive_integer, translit_with_separator from functions.form_check import is_positive_integer, translit_with_separator
from functions.files import check_tmp_files from functions.files import check_tmp_files
from functions.admin_forms import AdminFilterForm
class CityForm(forms.Form): class CityForm(forms.Form):
@ -159,3 +160,7 @@ class CityDeleteForm(forms.ModelForm):
class Meta: class Meta:
model = City model = City
fields = ('url',) fields = ('url',)
class CityFilterForm(AdminFilterForm):
model = City

@ -9,7 +9,7 @@ from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
# models and forms # models and forms
from models import Exposition, TimeTable, Statistic, TmpTimeTable from models import Exposition, TimeTable, Statistic, TmpTimeTable
from forms import ExpositionCreateForm, ExpositionDeleteForm, TimeTableForm, StatisticForm from forms import ExpositionCreateForm, ExpositionDeleteForm, TimeTableForm, StatisticForm, ExpositionFilterForm
from theme.models import Tag from theme.models import Tag
from city.models import City from city.models import City
from file.models import FileModel, TmpFile from file.models import FileModel, TmpFile
@ -19,6 +19,7 @@ import random
# custom views # custom views
from functions.custom_views import objects_list, delete_object from functions.custom_views import objects_list, delete_object
from functions.views_help import get_referer from functions.views_help import get_referer
from functions.admin_views import AdminListView
def exposition_all(request): def exposition_all(request):
@ -230,3 +231,8 @@ def exposition_change(request, url):
args['obj_id'] = getattr(exposition, 'id') args['obj_id'] = getattr(exposition, 'id')
return render_to_response('exposition_add.html', args) return render_to_response('exposition_add.html', args)
class ExpositionListView(AdminListView):
template_name = 'admin/exposition/exposition_list.html'
form_class = ExpositionFilterForm
model = Exposition

@ -1,11 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url from django.conf.urls import patterns, include, url
from admin import ExpositionListView
urlpatterns = patterns('exposition.admin', urlpatterns = patterns('exposition.admin',
url(r'^add.*/$', 'exposition_add'), url(r'^add.*/$', 'exposition_add'),
url(r'^delete/(?P<url>.*)/$', 'exposition_delete'), url(r'^delete/(?P<url>.*)/$', 'exposition_delete'),
url(r'^change/(?P<url>.*)/$', 'exposition_change'), url(r'^change/(?P<url>.*)/$', 'exposition_change'),
url(r'^all/$', 'exposition_all'), url(r'^all/$', ExpositionListView.as_view()),
url(r'^switch/(?P<url>.*)/(?P<action>.*)$', 'exposition_switch'), url(r'^switch/(?P<url>.*)/(?P<action>.*)$', 'exposition_switch'),
url(r'^copy/(?P<url>.*)$', 'exposition_copy'), url(r'^copy/(?P<url>.*)$', 'exposition_copy'),
) )

@ -22,6 +22,7 @@ from functions.form_check import is_positive_integer
from functions.files import check_tmp_files from functions.files import check_tmp_files
from functions.form_check import translit_with_separator from functions.form_check import translit_with_separator
from settings.settings import date_formats from settings.settings import date_formats
from functions.admin_forms import AdminFilterForm
class ExpositionCreateForm(forms.Form): class ExpositionCreateForm(forms.Form):
@ -480,3 +481,7 @@ class TimeTableForm(forms.Form):
fill_with_signal(TimeTable, timetable, data) fill_with_signal(TimeTable, timetable, data)
return timetable return timetable
class ExpositionFilterForm(AdminFilterForm):
model = Exposition

@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _
class AdminForm(forms.Form): class AdminForm(forms.Form):
@ -14,3 +16,27 @@ class AdminForm(forms.Form):
# uses enumerate for detect iteration number # uses enumerate for detect iteration number
# first iteration is a default lang so it required fields # first iteration is a default lang so it required fields
required = True if lid == 0 else False required = True if lid == 0 else False
class AdminFilterForm(forms.Form):
"""
class for filtering lists in admin panel
"""
model = None # which models work with
name = forms.CharField(label=_(u'Имя'), required=False)
def filter(self):
"""
return filtered queryset
form must be cleaned before calling this method
"""
data = self.cleaned_data
name = data['name']
model = self.model
qs = model.objects.all()
if name:
qs = qs.filter(translations__name__contains=name)
return qs

@ -1,4 +1,4 @@
from django.views.generic import FormView from django.views.generic import FormView, ListView
from django.shortcuts import render_to_response, get_object_or_404 from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.conf import settings from django.conf import settings
@ -60,3 +60,85 @@ class AdminView(FormView):
else: else:
return form_class() return form_class()
""" """
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
def paginate_results(qs, page=None):
paginator = Paginator(qs, settings.ADMIN_PAGINATION)
try:
result = paginator.page(page)
except PageNotAnInteger:
# If page is not an integer, deliver first page.
result = paginator.page(1)
except EmptyPage:
# If page is out of range (e.g. 9999), deliver last page of results.
result = paginator.page(paginator.num_pages)
return result
class AdminListView(FormView):
def get_form(self, form_class):
if self.request.GET:
return form_class(self.request.GET)
else:
return form_class(**self.get_form_kwargs())
def get(self, request, *args, **kwargs):
if request.GET:
form_class = self.get_form_class()
form = self.get_form(form_class)
if form.is_valid():
return self.form_valid(form)
else:
return self.form_invalid(form)
else:
return super(AdminListView, self).get(request, *args, **kwargs)
def form_valid(self, form):
"""
filtering queryset and return paginated results
"""
qs = form.filter()
result = paginate_results(qs, page=self.request.GET.get('page'))
context = self.get_context_data(form=form)
context.update({'object_list': result})
return self.render_to_response(context)
def get_context_data(self, **kwargs):
context = super(AdminListView, self).get_context_data(**kwargs)
qs = self.model.objects.all()
result = paginate_results(qs, page=self.request.GET.get('page'))
context['object_list'] = result
return context
"""
class AdminListView(ListView):
model = None
paginate_by = settings.ADMIN_PAGINATION
template_name = None
filter_form = None
def get_queryset(self):
if self.filter_form is None:
return super(AdminListView, self).get_queryset()
else:
form = self.filter_form(self.request.GET)
if form.is_valid():
result = form.filter()
return result
else:
return super(AdminListView, self).get_queryset()
def get_context_data(self, **kwargs):
context = super(AdminListView, self).get_context_data(self, **kwargs)
context =
"""

@ -3,7 +3,9 @@ from django.conf.urls import patterns, url
from client_view import GalleryView, PhotoView from client_view import GalleryView, PhotoView
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'gallery/(?P<slug>.*)$', GalleryView.as_view()), #url(r'gallery/(?P<slug>.*)$', GalleryView.as_view()),
url(r'photo/(?P<slug>.*)$', PhotoView.as_view()), #url(r'photo/(?P<slug>.*)$', PhotoView.as_view()),
url(r'^show/photo/$', 'photologue.client_view.ajax_photo'),
) )

@ -1,7 +1,9 @@
import warnings import warnings
import json
from django.conf import settings from django.conf import settings
from django.views.generic import DetailView, ListView from django.views.generic import DetailView, ListView
from photologue.models import Gallery, Photo from photologue.models import Gallery, Photo
from django.shortcuts import get_object_or_404, HttpResponse
# Number of galleries to display per page. # Number of galleries to display per page.
@ -29,3 +31,16 @@ class PhotoView(DetailView):
slug_field = 'slug' slug_field = 'slug'
template_name = 'client/photoreport/photo.html' template_name = 'client/photoreport/photo.html'
def ajax_photo(request):
if request.GET:
id = request.GET.get('id')
photo = get_object_or_404(Photo, pk=id)
response = {'title': photo.caption, 'text': photo.title, 'url':photo.get_display_url()}
return HttpResponse(json.dumps(response), content_type='application/json')
else:
return HttpResponse('123')

@ -10,7 +10,7 @@ from django.contrib.auth.decorators import login_required
from django.forms.formsets import BaseFormSet, formset_factory from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.models import modelformset_factory from django.forms.models import modelformset_factory
#models and forms #models and forms
from forms import ExpositionForm, PlaceExpositionFormDelete, HallForm from forms import ExpositionForm, PlaceExpositionFormDelete, HallForm, PlaceExpositionFilter
from models import PlaceExposition, Hall from models import PlaceExposition, Hall
from city.models import City from city.models import City
from file.models import FileModel, TmpFile from file.models import FileModel, TmpFile
@ -192,7 +192,7 @@ def exposition_change(request, url):
#test---------------------- #test----------------------
from functions.admin_views import AdminView from functions.admin_views import AdminView, AdminListView
class PlaceExpositionView(AdminView): class PlaceExpositionView(AdminView):
@ -257,3 +257,7 @@ class PlaceExpositionView(AdminView):
return context return context
class PlaceExpositionListView(AdminListView):
template_name = 'admin/place_exposition/place_exposition_list.html'
form_class = PlaceExpositionFilter
model = PlaceExposition

@ -1,13 +1,15 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url from django.conf.urls import patterns, include, url
from admin import PlaceExpositionView from admin import PlaceExpositionView, PlaceExpositionListView
urlpatterns = patterns('place_exposition.admin', urlpatterns = patterns('place_exposition.admin',
url(r'^all/$', 'exposition_all'), #url(r'^all/$', 'exposition_all'),
url(r'^all/$', PlaceExpositionListView.as_view()),
url(r'^add.*/$', 'exposition_add'), url(r'^add.*/$', 'exposition_add'),
url(r'^delete/(?P<url>.*)/$', 'exposition_delete'), url(r'^delete/(?P<url>.*)/$', 'exposition_delete'),
url(r'^change/(?P<url>.*)/$', 'exposition_change'), url(r'^change/(?P<url>.*)/$', 'exposition_change'),
url(r'^copy/(?P<url>.*)/$', 'place_exposition_copy'), url(r'^copy/(?P<url>.*)/$', 'place_exposition_copy'),
url(r'^$', PlaceExpositionView.as_view()), url(r'^$', PlaceExpositionView.as_view()),
url(r'^(?P<url>.*)/$', PlaceExpositionView.as_view()), url(r'^(?P<url>.*)/$', PlaceExpositionView.as_view()),

@ -293,5 +293,23 @@ class HallForm(forms.ModelForm):
capacity = cleaned_data.get('capacity').strip() capacity = cleaned_data.get('capacity').strip()
return is_positive_integer(capacity, 'Вместимость должна состоять из цифр') return is_positive_integer(capacity, 'Вместимость должна состоять из цифр')
class TestForm(forms.Form):
pass
from functions.admin_forms import AdminFilterForm
from django.utils.translation import ugettext_lazy as _
class PlaceExpositionFilter(AdminFilterForm):
country = forms.MultipleChoiceField(choices=[(item.id, item.name) for item in list(Country.objects.all())],
required=False, widget=forms.SelectMultiple())
model = PlaceExposition
def filter(self):
qs = super(PlaceExpositionFilter, self).filter()
data = self.cleaned_data
country = data['country']
if country:
qs = qs.filter(country_id__in=country)
return qs

@ -14,6 +14,15 @@ from photoreport.models import Photoreport
register = template.Library() register = template.Library()
@register.filter
def delete_get_key(request, key=None):
get = request.GET.copy()
if key in get:
del get[key]
return get.urlencode()
@register.filter @register.filter
def get_item(dictionary, key): def get_item(dictionary, key):
return dictionary.get(key) return dictionary.get(key)

@ -0,0 +1,69 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список пользователей</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Email</th>
<th>Полное имя</th>
<th>Админ</th>
<th>Переводчик</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.email }}</td>
<td>{{ item.get_full_name }}</td>
{% if item.is_admin %}
<td>Да</td>
{% else %}
<td>&nbsp;</td>
{% endif %}
{% if item.is_translator %}
<td>Да</td>
{% else %}
<td>&nbsp;</td>
{% endif %}
<td class="center sorting_1">
<a class="btn btn-info" href="/admin/accounts/change/{% if item.url %}{{ item.url }}{% else %}{{ item.id }}{% endif %}">
<i class="icon-edit icon-white"></i> Изменить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% load static %}
{% block scripts %}
{# selects #}
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/>
<script src="{% static 'js/select/select2.js' %}"></script>
<script src="{% static 'custom_js/make_select.js' %}"></script>
{% endblock %}

@ -0,0 +1,56 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список городов</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Город</th>
<th>Страна</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{% ifnotequal item.country.name None %}{{ item.country }} {% endifnotequal %}</td>
<td class="center sorting_1">
<a class="btn btn-info" href="/admin/city/change/{{ item.url|lower }}">
<i class="icon-edit icon-white"></i> Изменить
</a>
<a class="btn btn-danger delete" href="/admin/city/delete/{{ item.url }}/">
<i class="icon-trash icon-white"></i> Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/city/add"><i class="icon-plus-sign icon-white"></i> Добавить город</a>
</div>
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,62 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список компаний</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Компания</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td class="center sorting_1">
<a class="btn btn-info" href="/admin/company/change/{% if item.url %}{{ item.url }}{% else %}{{ item.id }}{% endif %}">
<i class="icon-edit icon-white"></i> Изменить
</a>
<a class="btn btn-danger" href="/admin/company/delete/{{ item.id }}">
<i class="icon-trash icon-white"></i> Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/company/add"><i class="icon-plus-sign icon-white"></i> Добавить компанию</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,86 @@
{% extends 'admin_list.html' %}
{% load static %}
{% block scripts %}
<script src="{% static 'custom_js/event_switcher.js' %}"></script>
{% endblock %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список конференций</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Дата начала</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.data_begin }}</td>
<td>
<a class="btn-small btn-warning off" style="{% if item.is_published %}{% else %}display: none;{% endif %}"
href="/admin/conference/switch/{{ item.url }}/off">
Отключить
</a>
<a class="btn-small btn-success on" style="{% if item.is_published %}display: none;{% else %}{% endif %}"
href="/admin/conference/switch/{{ item.url }}/on">
Включить
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/conference/change/{{ 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>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/conference/add"><i class="icon-plus-sign icon-white"></i> Добавить конференцию</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,57 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список стран</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Страна</th>
<th>Столица</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td>{% ifnotequal item.capital None %}{{ item.capital }} {% endifnotequal %}</td>
<td class="center sorting_1">
<a class="btn btn-info" href="/admin/country/change/{{ item.url|lower }}">
<i class="icon-edit icon-white"></i> Изменить
</a>
<a class="btn btn-danger delete" href="/admin/country/delete/{{ item.url }}/">
<i class="icon-trash icon-white"></i> Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/country/add"><i class="icon-plus-sign icon-white"></i> Добавить страну</a>
</div>
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,81 @@
{% extends 'admin_list.html' %}
{% block styles %}
td a{
float:left;
margin: 0 10px 10px 0
}
{% endblock %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список выставок</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Дата начала</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.data_begin }}</td>
<td style="width: 200px; height:100px;">
<a class="btn-small btn-warning off" style="{% if item.is_published %}{% else %}display: none;{% endif %}"
href="/admin/exposition/switch/{{ item.url }}/off">
Отключить
</a>
<a class="btn-small btn-success on" style="{% if item.is_published %}display: none;{% else %}{% endif %}"
href="/admin/exposition/switch/{{ item.url }}/on">
Включить
</a>
<a class="btn-small btn-info" href="/admin/exposition/change/{{ item.url|lower }}">
Изменить
</a>
<a class="btn-small btn-inverse" href="/admin/exposition/copy/{{ item.url }}" id="copy">
Копировать
</a>
<a class="btn-small btn-danger" href="/admin/exposition/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/exposition/add"><i class="icon-plus-sign icon-white"></i> Добавить выставку</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -1,4 +1,4 @@
{% comment %}
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<ul> <ul>
{% if page_obj.has_previous %} {% if page_obj.has_previous %}
@ -10,3 +10,48 @@
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
{% endcomment %}
{% load template_filters %}
{% if page_obj.paginator.num_pages > 1 %}
<section id="paginations">
<ul class="pagination" style="float:right;margin-right:20px;">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}&{{ request|delete_get_key:'page'}}">&laquo;</a>
</li>
{% endif %}
{% if page_obj.number > 2 %}
<li><a href="?page={{ 1 }}&{{ request|delete_get_key:'page'}}">{{ 1 }}</a></li>
{% if page_obj.number > 3 %}
<li><a href="#" style="border:0;">...</a></li>
{% endif %}
{% endif %}
{% if page_obj.has_previous %}
<li><a href="?page={{ page_obj.previous_page_number }}&{{ request|delete_get_key:'page'}}">{{ page_obj.previous_page_number }}</a></li>
{% endif %}
<li class="active">
<a href="#">{{ page_obj.number }}</a>
</li>
{% if page_obj.has_next %}
<li><a href="?page={{ page_obj.next_page_number }}&{{ request|delete_get_key:'page'}}">{{ page_obj.next_page_number }}</a></li>
{% endif %}
{% if page_obj.paginator.num_pages|subtract:page_obj.number > 1 %}
{% if page_obj.paginator.num_pages|subtract:page_obj.number > 2 %}
<li><a href="#" style="border:0;">...</a></li>
{% endif %}
<li><a href="?page={{ page_obj.paginator.num_pages }}&{{ request|delete_get_key:'page'}}">{{ page_obj.paginator.num_pages }}</a></li>
{% endif %}
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}&{{ request|delete_get_key:'page'}}">&raquo;</a>
</li>
{% endif %}
</ul>
</section>
{% endif %}

@ -0,0 +1,58 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список организаторов</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Организатор</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td class="center sorting_1">
<a class="btn btn-info" href="/admin/organiser/change/{{ item.id }}">
<i class="icon-edit icon-white"></i> Изменить
</a>
<a class="btn btn-danger" href="/admin/organiser/delete/{{ item.id }}">
<i class="icon-trash icon-white"></i> Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/organiser/add"><i class="icon-plus-sign icon-white"></i> Добавить организатора</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -2,7 +2,7 @@
{% block body %} {% block body %}
<div class="box span8"> <div class="box span8">
<div class="box-header well"> <div class="box-header well">
<h2><i class="icon-arrow-down"></i>Места проведения конференций</h2> <h2><i class="icon-arrow-down"></i>Места проведения конференций</h2>
</div> </div>

@ -0,0 +1,65 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Места проведения конференций</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Страна</th>
<th>Город</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{% ifnotequal item.country None %}{{ item.country }} {% endifnotequal %}</td>
<td>{% ifnotequal item.city None %}{{ item.city }} {% endifnotequal %}</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/place_conference/change/{{ item.url|lower }}">
Изменить
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-inverse" href="/admin/place_conference/copy/{{ item.url|lower }}">
Копировать
</a>
</td>
<td>
<a class="btn-small btn-danger" href="/admin/place_conference/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/place_conference/add"><i class="icon-plus-sign icon-white"></i> Добавить конферец зал</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,66 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Места проведения выставок</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Страна</th>
<th>Город</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{% ifnotequal item.country None %}{{ item.country }} {% endifnotequal %}</td>
<td>{% ifnotequal item.city None %}{{ item.city }} {% endifnotequal %}</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/place_exposition/change/{{ item.url|lower }}">
Изменить
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-inverse" href="/admin/place_exposition/copy/{{ item.url|lower }}">
Копировать
</a>
</td>
<td>
<a class="btn-small btn-danger" href="/admin/place_exposition/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/place_exposition/add"><i class="icon-plus-sign icon-white"></i> Добавить выставочный центр</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,87 @@
{% extends 'admin_list.html' %}
{% load static %}
{% block scripts %}
<script src="{% static 'custom_js/event_switcher.js' %}"></script>
{% endblock %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список семинаров</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Дата начала</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.data_begin }}</td>
<td>
<a class="btn-small btn-warning off" style="{% if item.is_published %}{% else %}display: none;{% endif %}"
href="/admin/seminar/switch/{{ item.url }}/off">
Отключить
</a>
<a class="btn-small btn-success on" style="{% if item.is_published %}display: none;{% else %}{% endif %}"
href="/admin/seminar/switch/{{ item.url }}/on">
Включить
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/seminar/change/{{ item.url|lower }}">
Изменить
</a>
</td>
<td>
<a class="btn-small btn-inverse" href="/admin/seminar/copy/{{ item.url|lower }}">
Удалить
</a>
</td>
<td>
<a class="btn-small btn-danger" href="/admin/seminar/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/seminar/add"><i class="icon-plus-sign icon-white"></i> Добавить семинар</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,70 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список тегов</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Название</th>
<th>Тема</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td>{{ item.theme }}</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/theme/tag/change/{{ item.id }}">
Изменить
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-inverse" href="/admin/theme/tag/copy/{{ item.id }}">
Копировать
</a>
</td>
<td>
<a class="btn-small btn-danger delete" href="/admin/theme/tag/delete/{{ item.id }}/">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/theme/tag/add"><i class="icon-plus-sign icon-white"></i> Добавить тег</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,66 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список тем</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Название</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/theme/theme/change/{{ item.id }}">
Изменить
</a>
</td>
<td>
<a class="btn-small btn-inverse" href="/admin/theme/theme/copy/{{ item.id }}/">
Копировать
</a>
</td>
<td>
<a class="btn-small btn-danger delete" href="/admin/theme/theme/delete/{{ item.id }}/">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/theme/theme/add"><i class="icon-plus-sign icon-white"></i> Добавить тематику</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,64 @@
{% extends 'admin_list.html' %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список переводчиков</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>id</th>
<th>Пользователь</th>
<th>Страна</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.id }}</td>
{% for u in item.user.all %}
<td>{{ u }}</td>
<td>{{ u.country }}</td>
{% endfor %}
<td class="center sorting_1">
<a class="btn btn-info" href="/admin/translator/change/{{ item.id }}">
<i class="icon-edit icon-white"></i> Изменить
</a>
<a class="btn btn-danger delete" href="/admin/translator/delete/{{ item.id }}/">
<i class="icon-trash icon-white"></i> Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/translator/add"><i class="icon-plus-sign icon-white"></i> Добавить перводчика</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -0,0 +1,89 @@
{% extends 'admin_list.html' %}
{% load static %}
{% block scripts %}
<script src="{% static 'custom_js/event_switcher.js' %}"></script>
{% endblock %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
</form>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список вебинаров</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Дата</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.data_begin }}</td>
<td>
<a class="btn-small btn-warning off" style="{% if item.is_published %}{% else %}display: none;{% endif %}"
href="/admin/webinar/switch/{{ item.url }}/off">
Отключить
</a>
<a class="btn-small btn-success on" style="{% if item.is_published %}display: none;{% else %}{% endif %}"
href="/admin/webinar/switch/{{ item.url }}/on">
Включить
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/webinar/change/{{ item.url|lower }}">
Изменить
</a>
</td>
<td>
<a class="btn-small btn-inverse" href="/admin/webinar/copy/{{ item.url|lower }}">
Копировать
</a>
</td>
<td>
<a class="btn-small btn-danger" href="/admin/webinar/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/webinar/add"><i class="icon-plus-sign icon-white"></i> Добавить вебинар</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -2,6 +2,7 @@
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% load template_filters %} {% load template_filters %}
{% load thumbnail %}
{% block style %} {% block style %}
<link rel="stylesheet" href="{% static 'client/css/select2.css' %}"> <link rel="stylesheet" href="{% static 'client/css/select2.css' %}">
@ -30,13 +31,28 @@
<div class="m-article"> <div class="m-article">
<div class="item-wrap clearfix"> <div class="item-wrap clearfix">
<aside> <aside>
<div class="i-pict"> <div class="i-pict p-editable">
<a class="add_pic_block" title=""> <form class="clearfix update-profile-form" enctype="multipart/form-data" id="avatar_form" action="/profile/update/avatar/" method="post">{% csrf_token %}
<span></span>
<i>Добавить фото</i>
<b>+20</b>
<input type="file" class="input" value=""> {% if request.user.profile.avatar %}
</a> <a class="pic_block" style="padding-top: 0;" title="" id="pick-block">
{% thumbnail request.user.profile.avatar "100x100" crop="center" as im %}
<img clas="user-avatar" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}
{% else %}
<a class="add_pic_block" title="" id="pick-block">
<p class="add-wrapper">
<span></span>
<i>Добавить фото</i>
<b>+20</b>
</p>
{% endif %}
{{ avatar_form.avatar }}
</a>
<a href="javascript:void(0);" id="pic-edit-photo" class="pic-edit-photo" {% if not request.user.profile.avatar %}style="display:none;"{% endif %}>Изменить фото</a>
</form>
</div> </div>
<div class="i-rating" title="Рейтинг: 551">551</div> <div class="i-rating" title="Рейтинг: 551">551</div>
<div class="reason_block"> <div class="reason_block">

@ -167,6 +167,7 @@ This template include basic anf main styles and js files,
<script src="{% static 'client/js/pages/complete_registration.js' %}"></script> <script src="{% static 'client/js/pages/complete_registration.js' %}"></script>
{% endif %} {% endif %}
{% endif %} {% endif %}
<div id="wait-ajax" class="wait-ajax" style="display:none;"><img src="{% static 'client/img/ajax-loader.gif' %}" alt=""/></div> <div id="wait-ajax" class="wait-ajax" style="display:none;"><img src="{% static 'client/img/ajax-loader.gif' %}" alt=""/></div>
</body> </body>

@ -47,9 +47,7 @@
{% for photo in object_list %} {% for photo in object_list %}
<li> <li>
<a class="open-photo" href="#" > <a class="open-photo" href="#" >
<img src="{{ photo.get_client_thumbnail_url }}" alt="{{ photo.title }}" <img src="{{ photo.get_client_thumbnail_url }}" data-image-id="{{ photo.id }}"/>
data-user-id="{{ user.id }}" data-image-id="{{ photo.id }}"
data-image-name="{{ photo.title }}" data-image-description="{{ photo.description }}"/>
<span class="pg-title">{{ photo.title }}</span> <span class="pg-title">{{ photo.title }}</span>
</a> </a>
</li> </li>
@ -69,66 +67,16 @@
{% endblock %} {% endblock %}
{% block photogallery %} {% block photogallery %}
<div id="pw-gallery" class="popup-gallery-container"> {% include 'client/popups/photo.html' %}
<div class="pg-container-wrap"> {% endblock %}
<div class="popup-gallery-outer"> {% block scripts %}
<div class="popup-gallery"> <script src="{% static 'client/js/pages/place_photo.js' %}"></script>
<a class="pg-close"></a> <script>
<div class="pg-wrap clearfix"> //js module initialization
<div class="pg-photos"> //TODO: разобраться с опциями модуля
EXPO.placePhoto.init({
<img src="{% static 'client/img/_del-temp/glr-1.jpg' %}" width="730" height="533" alt="" class="photoTag" modalId:'pw-gallery',
data-user-id="25" data-image-id="150" data-album-id="150"/> modalTrigger:'open-photo'
});
</div> </script>
<div class="pg-info">
<div class="pgi-wrap scroll-container">
<div class="pg-photo-info">
<div class="pg-photo-title"></div>
<div class="pg-photo-text"></div>
<hr />
<div class="pg-photo-descr">
<h3>{% trans 'На фотографии отмечены' %}:</h3>
</div>
<hr />
</div>
<!--
<div class="pg-comments">
<div class="pgc-title">{% trans 'Коментарии' %}:</div>
<div class="pgc-body">
<ul>
</ul>
</div>
</div>
</div>
{% if user.is_authenticated %}
<form class="pgc-form">
<hr />
<div class="pgc-field">
<label for="comment">{% trans 'Оставьте свой комментарий' %}:</label>
<textarea name="comment" id="comment" cols="30" rows="10"></textarea>
</div>
-->
<div class="pgc-buttons">
<!--<button type="submit" class="icon-check">ок</button>-->
<a class="button blue icon-tag addTag" id="externalLink" href="#">{% trans 'отметить человека' %}</a>
</div>
<!--
</form>
-->
{% endif %}
</div>
</div>
<div class="pg-photos-controls">
<a class="pgpc-prev" href="#">&lt;</a>
<a class="pgpc-next" href="#">&gt;</a>
</div>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}

@ -1,53 +1,29 @@
{% load i18n %}
{% load static %} {% load static %}
{% load i18n %}
<div id="pw-gallery" class="popup-gallery-container"> <div id="pw-gallery" class="popup-gallery-container">
<div class="pg-container-wrap"> <!--<div class="pg-container-wrap">-->
<div class="popup-gallery-outer"> <!--<div class="popup-gallery-outer">-->
<div class="popup-gallery"> <div class="popup-gallery">
<a class="pg-close"></a> <a class="pg-close"></a>
<div class="pg-wrap clearfix"> <div class="pg-wrap clearfix">
<div class="pg-photos"> <div class="pg-photos">
<img src="/media/photologue/cache/ADNEC-Marina-View-1-with-helipad_display.jpg" alt=""/>
<img src="{{ photo.get_display_url}}" alt="{{ photo.title }}" class="photoTag" <!--/media/photologue/cache/ADNEC-Marina-View-1-with-helipad_display.jpg-->
data-user-id="25" data-image-id="150" data-album-id="150"/> <!--TODO: тут должна грузится картинка-->
</div> </div>
<div class="pg-info"> <div class="pg-info pg-only-text">
<div class="pgi-wrap scroll-container"> <div class="pgi-wrap scroll-container">
<div class="pg-photo-info"> <div class="pg-photo-info">
<div class="pg-photo-title">{{ photo.title }}</div> <div class="pg-photo-title">{{ photo.title }}Лазерный период: основные моменты</div>
<div class="pg-photo-text"></div> <div class="pg-photo-text">
<hr /> Проекция абсолютной угловой скорости на оси системы координат xyz последовательно переворачивает поплавковый угол крена. Непосредственно из законов сохранения следует, что точность курса опасна. Подвес, согласно третьему закону Ньютона, представляет собой гироскопический маятник, что явно следует из прецессионных уравнений движения.
<div class="pg-photo-descr">
<h3>{% trans 'На фотографии отмечены' %}:</h3>
</div> </div>
<hr /> <hr />
</div> </div>
<div class="pg-comments">
<div class="pgc-title">{% trans 'Коментарии' %}:</div>
<div class="pgc-body">
<ul>
</ul>
</div>
</div>
</div> </div>
{% if user.is_authenticated %}
<form class="pgc-form">
<hr />
<div class="pgc-field">
<label for="comment">{% trans 'Оставьте свой комментарий' %}:</label>
<textarea name="comment" id="comment" cols="30" rows="10"></textarea>
</div>
<div class="pgc-buttons">
<button type="submit" class="icon-check">ок</button>
<a class="button blue icon-tag addTag" id="externalLink" href="#">{% trans 'отметить человека' %}</a>
</div>
</form>
{% endif %}
</div> </div>
</div> </div>
<div class="pg-photos-controls"> <div class="pg-photos-controls">
@ -55,7 +31,7 @@
<a class="pgpc-next" href="#">&gt;</a> <a class="pgpc-next" href="#">&gt;</a>
</div> </div>
</div> </div>
</div> <!--</div>-->
</div> <!--</div>-->
</div> </div>

@ -4991,7 +4991,6 @@ form.s-message {
.cli-pict, .cli-pict,
.i-pict { .i-pict {
width: 100px; width: 100px;
height: 100px;
line-height: 96px; line-height: 96px;
text-align: center; text-align: center;
background: #ffffff; background: #ffffff;
@ -5010,6 +5009,12 @@ form.s-message {
.i-pict { .i-pict {
margin: 0 0 10px; margin: 0 0 10px;
position: relative;
}
.i-pict .user-avatar{
display: block;
width: 100%;
height: 100%;
} }
.cl-photos .cli-pict, .cl-photos .cli-pict,
@ -5746,22 +5751,26 @@ form.s-message {
} }
.popup-gallery-outer { .popup-gallery-outer {
display: table-cell; position: fixed;
vertical-align: middle; width: 100%;
text-align: center; height: 100px;
padding: 20px 50px;
} }
/*TODO: popup Галерея*/
.popup-gallery { .popup-gallery {
position: relative; position: absolute;
display: inline-block; display: block;
width: 1040px; width: 1040px;
height: 534px;
top: 50%;
left: 50%;
margin-top: -267px;
margin-left: -520px;
} }
.popup-gallery .pg-wrap { .popup-gallery .pg-wrap {
position: relative; position: relative;
background: #fff; background: #fff;
height: 533px;
padding-left: 730px; padding-left: 730px;
overflow: hidden; overflow: hidden;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
@ -5866,7 +5875,15 @@ form.s-message {
.pg-comments ul li { .pg-comments ul li {
margin-top: 10px; margin-top: 10px;
} }
.pg-only-text .pg-photo-title{
font-size: 24px;
line-height: 1em;
margin-top: 24px;
margin-bottom: 36px;
/*text-indent:1em;*/
margin-left: 0.5em;
}
/* the end of gallerypopup*/
.pgc-user { .pgc-user {
color: #ff6600; color: #ff6600;
} }
@ -11891,7 +11908,36 @@ margin: 5px -11px 0 -15px;}
.add_pic_block:hover { color: #ff6600;} .add_pic_block:hover { color: #ff6600;}
.add_pic_block:hover span { background-color: #ff6600;} .add_pic_block:hover span { background-color: #ff6600;}
.add_pic_block:hover b:before { background-position: -181px -32px;} .add_pic_block:hover b:before { background-position: -181px -32px;}
.add_pic_block .add-wrapper{
margin: 0;
padding: 0;}
.pic_block{
width: 100px;
display: block;
overflow: hidden;
}
.pic_block .input{
opacity: 0;
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
z-index: 0;
}
.pic_block img{
position: relative;
z-index: 1;
}
.pic-edit-photo{
display: none;
line-height: 1em;
margin-top: 0.5em;
}
.pe-active .pic-edit-photo{
display: block;
}
.add_link_text { padding-left: 0 !important; line-height: 20px; min-height: 25px;} .add_link_text { padding-left: 0 !important; line-height: 20px; min-height: 25px;}
.add_link_text_text { font-size: 17px; color: #a2a2a2;font-family:'dindisplay_pro'; font-weight: 500; display: inline-block; position: relative; top: -1px;} .add_link_text_text { font-size: 17px; color: #a2a2a2;font-family:'dindisplay_pro'; font-weight: 500; display: inline-block; position: relative; top: -1px;}
.add_link_text_top { min-height: 60px;} .add_link_text_top { min-height: 60px;}

@ -1596,85 +1596,85 @@ function placeInput(width){
/* Открыть увеличенную фотографию /* Открыть увеличенную фотографию
* загружать текущую и картинки по нажатию стрелок наверное при помощи ajax * загружать текущую и картинки по нажатию стрелок наверное при помощи ajax
* */ * */
$('a.open-photo').on('click', function () { // $('a.open-photo').on('click', function () {
var $popupGallery = $('#pw-gallery'); // var $popupGallery = $('#pw-gallery');
// configure image // // configure image
var $img = $(this).find('img').clone(); // var $img = $(this).find('img').clone();
$img.addClass('photoTag'); // $img.addClass('photoTag');
//
$img_block = $popupGallery.find('.pg-photos'); // $img_block = $popupGallery.find('.pg-photos');
$img_block.html($img); // $img_block.html($img);
//
// add id for image description // // add id for image description
var id = 'imgid'+$img.attr('data-image-id') // var id = 'imgid'+$img.attr('data-image-id')
$popupGallery.find('.pg-photo-descr').attr('id', id); // $popupGallery.find('.pg-photo-descr').attr('id', id);
$popupGallery.find('.pg-photo-descr ul').remove(); // $popupGallery.find('.pg-photo-descr ul').remove();
//
$popupGallery.find('.pg-photo-title').html($img.attr('data-image-name')) // $popupGallery.find('.pg-photo-title').html($img.attr('data-image-name'))
$popupGallery.find('.pg-photo-text').html($img.attr('data-image-description')) // $popupGallery.find('.pg-photo-text').html($img.attr('data-image-description'))
// end configure image // // end configure image
//
// Список людей для автокомплита: // // Список людей для автокомплита:
//
$.getJSON('/accounts/get-tag-users/',function(json){ // $.getJSON('/accounts/get-tag-users/',function(json){
window.photoTagData = json; // window.photoTagData = json;
}); // });
//
//
//
// отметки // // отметки
$('.photoTag').photoTag({ // $('.photoTag').photoTag({
externalAddTagLinks: { // externalAddTagLinks: {
bind: true, // bind: true,
selector: ".addTag" // selector: ".addTag"
}, // },
requestTagsUrl: '/photo/existing-tags/', // requestTagsUrl: '/photo/existing-tags/',
deleteTagsUrl: '/photo/delete-tag/', // deleteTagsUrl: '/photo/delete-tag/',
addTagUrl: '/photo/add-tag/', // addTagUrl: '/photo/add-tag/',
parametersForNewTag: { // parametersForNewTag: {
name: { // name: {
parameterKey: 'name', // parameterKey: 'name',
isAutocomplete: true, // isAutocomplete: true,
label: 'Введите имя:' // label: 'Введите имя:'
} // }
} // }
}); // });
// --------------------------------------- // // ---------------------------------------
//
var $popupOuter = $('div.popup-gallery-outer', $popupGallery); // var $popupOuter = $('div.popup-gallery-outer', $popupGallery);
var $closePopup = $('a.pg-close', $popupGallery); // var $closePopup = $('a.pg-close', $popupGallery);
var $prevSlide = $('a.pgpc-prev', $popupGallery); // var $prevSlide = $('a.pgpc-prev', $popupGallery);
var $nextSlide = $('a.pgpc-next', $popupGallery); // var $nextSlide = $('a.pgpc-next', $popupGallery);
//
//
function closeGallery() { // function closeGallery() {
$popupGallery.fadeOut(300, function () { // $popupGallery.fadeOut(300, function () {
$body.removeClass('no-scroll'); // $body.removeClass('no-scroll');
}); // });
return false; // return false;
} // }
//
$closePopup.on('click', closeGallery); // $closePopup.on('click', closeGallery);
$popupOuter.on('click', function (event) { // $popupOuter.on('click', function (event) {
var targetObj = $(event.target); // var targetObj = $(event.target);
if (targetObj.parents().filter('.popup-gallery').length < 1) { // if (targetObj.parents().filter('.popup-gallery').length < 1) {
closeGallery() // closeGallery()
} // }
}); // });
//
$prevSlide.on('click', function () { // $prevSlide.on('click', function () {
return false; // return false;
}); // });
//
$nextSlide.on('click', function () { // $nextSlide.on('click', function () {
return false; // return false;
}); // });
//
$body.addClass('no-scroll'); // $body.addClass('no-scroll');
$popupGallery.fadeIn(300); // $popupGallery.fadeIn(300);
//
return false; // return false;
}); // });
$('a.icb-edit-profile').on('click', function () { $('a.icb-edit-profile').on('click', function () {
var $editBtn = $(this); var $editBtn = $(this);

@ -49,9 +49,6 @@ EXPO.company = (function() {
formDataString = decodeURI(formData).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"').replace(/\//ig, '\\/').replace(/\\n/g, '\\n'); formDataString = decodeURI(formData).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"').replace(/\//ig, '\\/').replace(/\\n/g, '\\n');
this.formData = JSON.parse('{"' + formDataString + '"}'); this.formData = JSON.parse('{"' + formDataString + '"}');
this.formId = formName; this.formId = formName;
console.log('pushData:');
console.log(data);
}, },
pullData: function (data) { pullData: function (data) {
@ -64,9 +61,6 @@ EXPO.company = (function() {
message: " handler function for processing response after form submit not defined, please define it!" message: " handler function for processing response after form submit not defined, please define it!"
}; };
} }
console.log('pullData: ');
console.log(data);
}, },
// method to fulfill edited inputs with new content // method to fulfill edited inputs with new content
@ -148,9 +142,6 @@ EXPO.company = (function() {
$img, imgSrc, $input, inputValue; $img, imgSrc, $input, inputValue;
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
console.log('self:');
console.log(self);
for (item in self.formData) { for (item in self.formData) {
$input = $('#id_'+item); $input = $('#id_'+item);
if($.trim(self.formData[item]) != '' && $input.length){ if($.trim(self.formData[item]) != '' && $input.length){

@ -0,0 +1,149 @@
var EXPO = EXPO || {}; //isolated namespace
//общий для всех страниц модуль Функционал общий для всех страниц
// module requires JQuery library
EXPO.placePhoto = (function() {
// variables
var that = {};
that.settings = {
}; //default module setting
that.lang ={};
//dependences
//private
// constructor for popup window on gallery page
var ModalBox = function(){
// object properties
this.rawData;
this.currentId;
// привязка к html данным шаблона формы
this.control;
};
//methods for ModalBox object
ModalBox.prototype = {
//some kind of 'protected' methods
_getAjax: function () {
},
_renderSlide: function () {
},
_getId: function () {
},
//public methods
close: function () {
},
open: function () {
},
nextSlide:function () {
},
prevSlide: function () {
},
// method to get sliderPopup visible and pass to modalBox first initial id and make some init routine
show: function () {
}
};
// methods
//инициализация общих свойств
that.init = function(options) {
// settings extending
$.extend(this.lang, options.lang);
options.lang = null;
$.extend(this.settings, options);
// begin of initialization
var self = this;
$(function () {
$('a.open-photo').on('click', function () {
var $popupGallery = $('#pw-gallery');
// configure image
var $img = $(this).find('img').clone();
$img.addClass('photoTag');
$img_block = $popupGallery.find('.pg-photos');
$img_block.html($img);
// add id for image description
var id = 'imgid'+$img.attr('data-image-id')
$popupGallery.find('.pg-photo-descr').attr('id', id);
$popupGallery.find('.pg-photo-descr ul').remove();
$popupGallery.find('.pg-photo-title').html($img.attr('data-image-name'))
$popupGallery.find('.pg-photo-text').html($img.attr('data-image-description'))
// end configure image
// Список людей для автокомплита:
$.getJSON('/accounts/get-tag-users/',function(json){
window.photoTagData = json;
});
// отметки
$('.photoTag').photoTag({
externalAddTagLinks: {
bind: true,
selector: ".addTag"
},
requestTagsUrl: '/photo/existing-tags/',
deleteTagsUrl: '/photo/delete-tag/',
addTagUrl: '/photo/add-tag/',
parametersForNewTag: {
name: {
parameterKey: 'name',
isAutocomplete: true,
label: 'Введите имя:'
}
}
});
// ---------------------------------------
var $popupOuter = $('div.popup-gallery-outer', $popupGallery);
var $closePopup = $('a.pg-close', $popupGallery);
var $prevSlide = $('a.pgpc-prev', $popupGallery);
var $nextSlide = $('a.pgpc-next', $popupGallery);
function closeGallery() {
$popupGallery.fadeOut(300, function () {
$body.removeClass('no-scroll');
});
return false;
}
$closePopup.on('click', closeGallery);
$popupOuter.on('click', function (event) {
var targetObj = $(event.target);
if (targetObj.parents().filter('.popup-gallery').length < 1) {
closeGallery()
}
});
$prevSlide.on('click', function () {
return false;
});
$nextSlide.on('click', function () {
return false;
});
$body.addClass('no-scroll');
$popupGallery.fadeIn(300);
return false;
});
});
};
return that;
}());

@ -27,6 +27,8 @@ EXPO.profile = (function() {
// dataType: "json", // dataType: "json",
url: self.ajaxPath, url: self.ajaxPath,
data:dataToSend, data:dataToSend,
processData: false,
contentType: false,
success: function(data) { success: function(data) {
self.pullHandler(data); self.pullHandler(data);
$('#wait-ajax').fadeOut(); $('#wait-ajax').fadeOut();
@ -38,6 +40,13 @@ EXPO.profile = (function() {
pushData: function (data, formName) { pushData: function (data, formName) {
var handler = this.pushHandler, var handler = this.pushHandler,
formData = data; formData = data;
if(typeof formData != "string"){
this.formData =formData;
}else{
this.formData = JSON.parse('{"' + decodeURI(formData).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
}
this.formId = formName;
if(typeof handler == 'function'){ if(typeof handler == 'function'){
// if particular data change required // if particular data change required
handler(data); handler(data);
@ -46,11 +55,10 @@ EXPO.profile = (function() {
this.getajax(data); this.getajax(data);
$('#wait-ajax').show(); $('#wait-ajax').show();
} }
this.formData = JSON.parse('{"' + decodeURI(formData).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}'); console.log('formData type');
this.formId = formName; console.log(typeof formData);
console.log('pushData:');
console.log(data);
}, },
pullData: function (data) { pullData: function (data) {
@ -63,9 +71,7 @@ EXPO.profile = (function() {
message: " handler function for processing response after form submit not defined, please define it!" message: " handler function for processing response after form submit not defined, please define it!"
}; };
} }
console.log('pullData: ');
console.log(data);
}, },
// method to fulfill edited inputs with new content // method to fulfill edited inputs with new content
@ -101,13 +107,7 @@ EXPO.profile = (function() {
// please add functionality for new profile forms here // please add functionality for new profile forms here
// pushHandler is for ajax to server, pullHandler for ajax from it. Data is the response information from server // pushHandler is for ajax to server, pullHandler for ajax from it. Data is the response information from server
// name of each method is equal 'id' attribute of <form/> element on the page. // name of each method is equal 'id' attribute of <form/> element on the page.
Forms.avatar_form = function (path) {
this.pullHandler = function (data) {
console.log('avatar form not defined');
};
this.ajaxPath = path;
};
Forms.home_form = function (path) { Forms.home_form = function (path) {
var self = this; var self = this;
this.pullHandler = function (data) { this.pullHandler = function (data) {
@ -214,9 +214,7 @@ EXPO.profile = (function() {
$img, imgSrc, $input, inputValue; $img, imgSrc, $input, inputValue;
this.pullHandler = function (data) { this.pullHandler = function (data) {
if (data.success){ if (data.success){
console.log('self:');
console.log(self);
for (item in self.formData) { for (item in self.formData) {
$input = $('#id_'+item); $input = $('#id_'+item);
if($.trim(self.formData[item]) != '' && $input.length){ if($.trim(self.formData[item]) != '' && $input.length){
@ -247,26 +245,51 @@ EXPO.profile = (function() {
} }
$('.p-editable').removeClass('pe-current'); $('.p-editable').removeClass('pe-current');
// var vk = $.trim($('#id_vk').val()), vk_img = $('#vk-img').attr('src').replace('_hover',''),
// fb = $.trim($('#id_facebook').val()), fb_img = $('#fb-img').attr('src').replace('_hover',''),
// ln = $.trim($('#id_linkedin').val()), ln_img = $('#ln-img').attr('src').replace('_hover',''),
// tw = $.trim($('#id_twitter').val()), tw_img = $('#tw-img').attr('src').replace('_hover','');
// if($('#fb-link').length){
// $('#fb-link').attr('src', fb);
// }else{
// $('#fb-img').attr('src',fb_img);
// }
// $('#vk-link').attr('src', vk);
// $('#ln-link').attr('src', ln);
// $('#tw-link').attr('src', tw);
//
// $('.p-editable').removeClass('pe-current');
} }
}; };
this.ajaxPath = path; this.ajaxPath = path;
}; };
Forms.avatar_form = function (path) {
var self = this,
$input = $('#id_avatar'),
$editPhoto = $('#pic-edit-photo'),
$pickBlock = $('#pick-block'),
$form,
$avatar = $('.pic_block img');
this.pullHandler = function (data) {
if (data.success){
if($avatar.length){
$avatar.attr('src', data.url);
}else{
$pickBlock.removeClass('add_pic_block').addClass('pic_block');
$('.add-wrapper', $pickBlock).remove();
$('<img/>').attr('src', data.url).prependTo($pickBlock);
}
// $('#static-about-value').text($('#id_about').val());
$('.p-editable').removeClass('pe-current');
}
};
this.pushHandler = function(data){
if(typeof data != 'string'){
self.getajax(data);
$('#wait-ajax').show();
}else{
$form = $('#'+self.formId);
$form.off('submit');
$form.trigger('submit');
}
};
$input.on('change', function () {
$(this).parents('form').submit();
});
$editPhoto.on('click', function () {
$input.trigger('click');
});
// pick-block
this.ajaxPath = path;
}
$(function () { $(function () {
@ -400,7 +423,8 @@ EXPO.profile = (function() {
//forms init //forms init
$('.'+self.settings.updateFormClass).each(function () { $('.'+self.settings.updateFormClass).each(function () {
var formName = $(this).attr('id'), var formName = $(this).attr('id'),
path = $(this).attr('action'); path = $(this).attr('action'),
inputData;
//make and initialize form objects //make and initialize form objects
self.forms[formName] = Forms.factory(formName,path); self.forms[formName] = Forms.factory(formName,path);
@ -408,9 +432,15 @@ EXPO.profile = (function() {
// submit events handler // submit events handler
$(this).off('submit'); $(this).off('submit');
$(this).on('submit', function () { $(this).on('submit', function () {
var serialized = $(this).serialize(); //check if formData is supported
// each form post definitin function if ( window.FormData && ("upload" in ($.ajaxSettings.xhr())) ){
self.forms[formName].pushData(serialized, formName); inputData = new FormData(this);
self.forms[formName].pushData(inputData, formName);
} else {
inputData = $(this).serialize();
self.forms[formName].pushData(inputData, formName);
}
return false; return false;
}); });

Loading…
Cancel
Save