diff --git a/apps/conference/models.py b/apps/conference/models.py index b606f05f..65088d3a 100644 --- a/apps/conference/models.py +++ b/apps/conference/models.py @@ -96,7 +96,6 @@ class Conference(TranslatableModel, EventMixin, ExpoMixin): is_published = models.BooleanField(default=0, db_index=True) files = generic.GenericRelation('file.FileModel', content_type_field='content_type', object_id_field='object_id') - note = generic.GenericRelation('note.Note', content_type_field='content_type', object_id_field='object_id') # statistic foundation_year = models.PositiveIntegerField(verbose_name=_(u'Год основания'), blank=True, null=True) visitors = models.PositiveIntegerField(verbose_name=_(u'Посетитеил'), blank=True, null=True) @@ -188,19 +187,6 @@ class Conference(TranslatableModel, EventMixin, ExpoMixin): 'events:event_visit', args=['conference', self.id] ) - def get_note_url(self): - return reverse_lazy( - 'conference_add_note', - args=[self.url] - ) - - def get_note_by_user(self, user_id): - note = self.note.filter(user__id=user_id) - try: - return note.get().text - except: - return '' - def tags(self): return self.tag.language().all() diff --git a/apps/conference/tests/test_models.py b/apps/conference/tests/test_models.py index 8a144fbd..b1cd5448 100644 --- a/apps/conference/tests/test_models.py +++ b/apps/conference/tests/test_models.py @@ -5,7 +5,6 @@ from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse, NoReverseMatch from django.test import TestCase from expobanner.models import Paid, Banner -from note.models import Note from service.models import Service from stats_collector.models import ObjectStats from theme.models import Tag, Theme @@ -112,27 +111,6 @@ class ConferenceTest(TestCase): ) ) - def test_method_get_note_url(self): - self.assertEqual( - self.conference.get_note_url(), - reverse('conference_add_note', args=[self.conference.url]) - ) - - def test_method_get_note_by_user(self): - user = User.objects.all()[0] - - self.assertEqual(self.conference.get_note_by_user(user.id), '') - - text = 'Great' - ct = ContentType.objects.get_for_model(self.conference) - object_id = self.conference.id - Note.objects.create( - content_type=ct, object_id=object_id, - user=user, text=text - ) - - self.assertEqual(self.conference.get_note_by_user(user.id), text) - def test_method_tags(self): self.assertFalse(self.conference.tags()) diff --git a/apps/conference/urls.py b/apps/conference/urls.py index b8d08e79..398fe24e 100644 --- a/apps/conference/urls.py +++ b/apps/conference/urls.py @@ -21,13 +21,6 @@ from .views import ( ) urlpatterns = patterns('', - - - url( - r'^conference/add-note/(?P[^/]*)/$', - 'conference.views.add_note', - name='conference_add_note' - ), url(r'^conference-add-calendar/(?P\d+)/$', 'conference.views.conference_add_calendar', name='conference_add_calendar' diff --git a/apps/conference/views.py b/apps/conference/views.py index 0d188951..113c966b 100644 --- a/apps/conference/views.py +++ b/apps/conference/views.py @@ -30,7 +30,6 @@ from city.models import City from country.models import Country from meta.views import MetadataMixin from models import Conference -from note.models import Note from service.models import Service from service.order_forms import AdvertiseForm from service.views import order_forms, get_userlog_data @@ -589,39 +588,6 @@ def conference_add_calendar(request, id): # return HttpResponse(json.dumps(args), content_type='application/json') -def add_note(request, slug): - args = {'success': False} - - if request.user.is_authenticated(): - - if request.GET: - text = request.GET['note_text'] - try: - conf = Conference.objects.get(url=slug) - except Conference.DoesNotExist: - raise Http404 - - ct = ContentType.objects.get_for_model(conf) - object_id = conf.id - user = User.objects.get(id=request.user.id) - if Note.objects.filter(user=user, content_type=ct, object_id=object_id).exists(): - Note.objects.filter(user=user, content_type=ct, object_id=object_id).update(text=text) - else: - Note.objects.create(content_type=ct, object_id=object_id, user=user, text=text) - - user.calendar.conferences.add(conf) - - - args['success'] = True - args['text'] = text - - else: - args['not_authorized'] = True - args['success'] = True - - return HttpResponse(json.dumps(args), content_type='application/json') - - def send_to_organiser(request, slug): exposition = get_object_or_404(Conference, url=slug) mail_send = 'evm@expomap.ru' diff --git a/apps/exposition/models.py b/apps/exposition/models.py index e646cf15..85f07fa1 100644 --- a/apps/exposition/models.py +++ b/apps/exposition/models.py @@ -115,7 +115,6 @@ class Exposition(TranslatableModel, EventMixin, ExpoMixin): ) files = generic.GenericRelation('file.FileModel', content_type_field='content_type', object_id_field='object_id') - note = generic.GenericRelation('note.Note', content_type_field='content_type', object_id_field='object_id') #about periodic = models.FloatField(verbose_name=_(u'Переодичность'), blank=True, null=True) @@ -203,13 +202,6 @@ class Exposition(TranslatableModel, EventMixin, ExpoMixin): tags = ' '.join([' '.join(tag.get_all_names()) for tag in self.tag.all()]) return names + ' ' + titles + ' ' + themes + ' ' + tags - def get_note_by_user(self, user_id): - note = self.note.filter(user__id=user_id) - try: - return note.get().text - except: - return '' - def upload_photo_url(self): return '/admin/exposition/upload-photo/%s/' % self.id @@ -240,9 +232,6 @@ class Exposition(TranslatableModel, EventMixin, ExpoMixin): def get_visit_url(self): return '/exposition-visit/%s/'%self.id - def get_note_url(self): - return '/expo/add-note/%s/'%self.url - def get_timetables_days(self): tables = list(self.business_program.all()) days = [] diff --git a/apps/exposition/urls.py b/apps/exposition/urls.py index 85d3516b..a4e905f2 100644 --- a/apps/exposition/urls.py +++ b/apps/exposition/urls.py @@ -24,7 +24,6 @@ from .views import ( ) urlpatterns = patterns('', - url(r'^expo/add-note/(?P.*)/$', 'exposition.views.add_note'), url(r'^exposition-add-calendar/(?P\d+)/$', 'exposition.views.exposition_add_calendar'), # url(r'^exposition-visit/(?P\d+)/$', 'exposition.views.exposition_visit'), # search diff --git a/apps/exposition/views.py b/apps/exposition/views.py index d83dde46..3863b4ab 100644 --- a/apps/exposition/views.py +++ b/apps/exposition/views.py @@ -29,7 +29,6 @@ from functions.views_help import get_side_items from meta.views import MetadataMixin from models import Exposition -from note.models import Note from service.models import Service from service.order_forms import AdvertiseForm from service.views import order_forms, get_userlog_data @@ -648,38 +647,6 @@ class ExpoPhotoView(MetadataMixin, ListView): return context -def add_note(request, slug): - args = {'success': False} - - if request.user.is_authenticated(): - - if request.GET: - text = request.GET['note_text'] - try: - e = Exposition.objects.get(url=slug) - except Exposition.DoesNotExist: - raise Http404 - - ct = ContentType.objects.get_for_model(e) - object_id = e.id - user = User.objects.get(id=request.user.id) - if Note.objects.filter(user=user, content_type=ct, object_id=object_id).exists(): - Note.objects.filter(user=user, content_type=ct, object_id=object_id).update(text=text) - else: - Note.objects.create(content_type=ct, object_id=object_id, user=user, text=text) - - user.calendar.expositions.add(e) - - - args['success'] = True - args['text'] = text - - else: - args['not_authorized'] = True - args['success'] = True - - return HttpResponse(json.dumps(args), content_type='application/json') - def send_to_organiser(request, slug): exposition = get_object_or_404(Exposition, url=slug) mail_send = 'evm@expomap.ru' diff --git a/apps/note/__init__.py b/apps/note/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/note/models.py b/apps/note/models.py deleted file mode 100644 index 53341335..00000000 --- a/apps/note/models.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.db import models -from django.contrib.contenttypes.models import ContentType -from django.contrib.contenttypes import generic - - -class Note(models.Model): - content_type = models.ForeignKey(ContentType, null=True) - object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk") - user = models.ForeignKey('accounts.User') - text = models.TextField(verbose_name='Note') - - diff --git a/apps/note/tests.py b/apps/note/tests.py deleted file mode 100644 index 501deb77..00000000 --- a/apps/note/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/apps/note/views.py b/apps/note/views.py deleted file mode 100644 index 60f00ef0..00000000 --- a/apps/note/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/apps/settings/templatetags/template_filters.py b/apps/settings/templatetags/template_filters.py index f01feb40..f26d464b 100644 --- a/apps/settings/templatetags/template_filters.py +++ b/apps/settings/templatetags/template_filters.py @@ -237,13 +237,6 @@ def without_page(value): result = '/'.join(l[:l.index('page')])+'/' return result -@register.filter -def note_by_user(obj, user): - - if obj and user.is_authenticated(): - - return obj.get_note_by_user(user.id) - return '' @register.filter def isdigit(value): @@ -360,4 +353,4 @@ def str_to_int(value): try: return int(value) except ValueError: - return value \ No newline at end of file + return value diff --git a/proj/settings.py b/proj/settings.py index 50da10c4..0dc218ca 100644 --- a/proj/settings.py +++ b/proj/settings.py @@ -363,7 +363,6 @@ INSTALLED_APPS = ( 'file', 'import_xls', 'news', - 'note', 'organiser', 'place_conference', 'place_exposition', diff --git a/proj/urls.py b/proj/urls.py index 2268747e..6bf25153 100644 --- a/proj/urls.py +++ b/proj/urls.py @@ -9,6 +9,7 @@ from core.simple_index_view import ( from django.conf import settings from django.conf.urls import include, patterns, url from django.conf.urls.static import static +from django.contrib import admin from django.contrib.sitemaps import views from django.views.generic.base import TemplateView @@ -68,6 +69,7 @@ urlpatterns += solid_i18n_patterns('', url(r'^rss/', include('core.urls')), url(r'^sitemap-(?P
.+)\.xml$', views.sitemap, {'sitemaps': sitemaps}), url(r'^admin/', include('proj.admin_urls')), + url(r'^djadmin/', include(admin.site.urls)), url(r'^sitemap\.xml$', views.index, {'sitemaps': sitemaps}), url(r'^sitemap-(?P
.+)\.xml$', views.sitemap, {'sitemaps': sitemaps}), diff --git a/static/client/html-cut/paid_exposition.html b/static/client/html-cut/paid_exposition.html index 2e3dd41b..b45542b8 100644 --- a/static/client/html-cut/paid_exposition.html +++ b/static/client/html-cut/paid_exposition.html @@ -1877,18 +1877,6 @@ В расписание -
- - заметка -
-
- -
-
- -
- - diff --git a/static/client/html-cut/subscribe.html b/static/client/html-cut/subscribe.html index b94f2857..21377387 100644 --- a/static/client/html-cut/subscribe.html +++ b/static/client/html-cut/subscribe.html @@ -442,14 +442,6 @@ Я планирую посетить В расписание -
- заметка -
-
- -
-
-
diff --git a/templates/client/includes/conference/conference_list.html b/templates/client/includes/conference/conference_list.html index 75a19570..3e9f841f 100644 --- a/templates/client/includes/conference/conference_list.html +++ b/templates/client/includes/conference/conference_list.html @@ -77,17 +77,6 @@ {% include 'client/includes/exposition/services.html' with obj=obj %} {% include 'client/includes/calendar_button.html' with obj=obj%} -
- {% with note=obj|note_by_user:request.user %} - {% trans 'заметка' %} -
-
- -
-
- {% endwith %} -
- {% if request.user.is_admin %}
{% trans 'изменить' %} diff --git a/templates/client/includes/conference/conference_object.html b/templates/client/includes/conference/conference_object.html index 5d54c3d1..5501a65f 100644 --- a/templates/client/includes/conference/conference_object.html +++ b/templates/client/includes/conference/conference_object.html @@ -79,16 +79,6 @@ {% include 'client/includes/visit_button.html' %} {% endwith %} {% include 'client/includes/calendar_button.html' with obj=object %} -
- {% with note=object|note_by_user:request.user %} - {% trans 'заметка' %} -
-
- -
-
- {% endwith %} -
{% if request.user.is_admin %} {% trans 'изменить' %} {% endif %} diff --git a/templates/client/includes/conference/conference_paid.html b/templates/client/includes/conference/conference_paid.html index 6ddc64da..323e8a9b 100644 --- a/templates/client/includes/conference/conference_paid.html +++ b/templates/client/includes/conference/conference_paid.html @@ -87,16 +87,6 @@ {% include 'client/includes/visit_button.html' %} {% endwith %} {% include 'client/includes/calendar_button.html' with obj=object %} -
- {% with note=object|note_by_user:request.user %} - {% trans 'заметка' %} -
-
- -
-
- {% endwith %} -
{% if request.user.is_admin %} {% trans 'изменить' %} {% endif %} diff --git a/templates/client/includes/conference/conference_partner.html b/templates/client/includes/conference/conference_partner.html index 695d3da7..f9ffadab 100644 --- a/templates/client/includes/conference/conference_partner.html +++ b/templates/client/includes/conference/conference_partner.html @@ -102,17 +102,6 @@ {% include 'client/includes/calendar_button.html' with obj=object %} -
- {% with note=object|note_by_user:request.user %} - {% trans 'заметка' %} -
-
- -
-
- {% endwith %} -
- {% if request.user.is_admin %} {% trans 'изменить' %} {% endif %} @@ -121,8 +110,6 @@ {% trans 'фото' %} {% endif %}
- -
diff --git a/templates/client/includes/event_steps.html b/templates/client/includes/event_steps.html index fe6f0a80..6e6d41b1 100644 --- a/templates/client/includes/event_steps.html +++ b/templates/client/includes/event_steps.html @@ -34,38 +34,32 @@ {% else %} {# Непроплаченая конференция #}
-
{% if event.catalog == '/expo/' %}{% trans 'Участвовать в выставке' %}{% else %}{% trans 'Посетить конференцию' %}{% endif %}
-
+ +
  • +
    {% trans 'Устраните языковые барьеры' %}
    + {% trans "ПЕРЕВОДЧИК" %} +
  • + {% endif %} diff --git a/templates/client/includes/events/filter_result.html b/templates/client/includes/events/filter_result.html index 03f852ce..25e0da76 100644 --- a/templates/client/includes/events/filter_result.html +++ b/templates/client/includes/events/filter_result.html @@ -82,18 +82,6 @@
    {% include 'client/includes/exposition/services.html' with obj=result.object %} {% include 'client/includes/calendar_button.html' with obj=result.object %} -
    - - {% with note=result.object|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} - -
    {% include 'client/buttons/booking_button.html' with object=result.object %} diff --git a/templates/client/includes/exposition/expo_list_paid.html b/templates/client/includes/exposition/expo_list_paid.html index 8933ea3f..28bc1e82 100644 --- a/templates/client/includes/exposition/expo_list_paid.html +++ b/templates/client/includes/exposition/expo_list_paid.html @@ -56,16 +56,6 @@
    {% include 'client/includes/exposition/services.html' with obj=obj %} {% include 'client/includes/calendar_button.html' with obj=obj%} -
    - {% with note=obj|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} -
    {% if request.user.is_admin %}
    {% trans 'изменить' %} diff --git a/templates/client/includes/exposition/expo_paid.html b/templates/client/includes/exposition/expo_paid.html index 2892e60b..143a4961 100644 --- a/templates/client/includes/exposition/expo_paid.html +++ b/templates/client/includes/exposition/expo_paid.html @@ -91,16 +91,6 @@ {% include 'client/includes/visit_button.html' %} {% endwith %} {% include 'client/includes/calendar_button.html' with obj=object %} -
    - {% with note=object|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} -
    {% if request.user.is_admin %} {% trans 'изменить' %} {% endif %} diff --git a/templates/client/includes/exposition/expo_top.html b/templates/client/includes/exposition/expo_top.html index 3e14cc7f..cac97d0a 100644 --- a/templates/client/includes/exposition/expo_top.html +++ b/templates/client/includes/exposition/expo_top.html @@ -61,16 +61,6 @@
    {% include 'client/includes/exposition/services.html' with obj=obj %} {% include 'client/includes/calendar_button.html' with obj=obj%} -
    - {% with note=obj|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} -
    {% if request.user.is_admin %}
    {% trans 'изменить' %} diff --git a/templates/client/includes/exposition/exposition_list.html b/templates/client/includes/exposition/exposition_list.html index 5a9f6c0f..ef68e4e6 100644 --- a/templates/client/includes/exposition/exposition_list.html +++ b/templates/client/includes/exposition/exposition_list.html @@ -79,17 +79,6 @@
    {% include 'client/includes/exposition/services.html' with obj=obj %} {% include 'client/includes/calendar_button.html' with obj=obj%} -
    - {% with note=obj|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} -
    - {% if request.user.is_admin %}
    {% trans 'изменить' %} diff --git a/templates/client/includes/exposition/exposition_object.html b/templates/client/includes/exposition/exposition_object.html index 898e627e..f16de5ad 100644 --- a/templates/client/includes/exposition/exposition_object.html +++ b/templates/client/includes/exposition/exposition_object.html @@ -104,17 +104,6 @@ {% endwith %} {% include 'client/includes/calendar_button.html' with obj=object %} - -
    - {% with note=object|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} -
    {% if request.user.is_admin %} {% trans 'изменить' %} {% endif %} diff --git a/templates/client/includes/exposition/search_result.html b/templates/client/includes/exposition/search_result.html index 0a276170..e5eb44ec 100644 --- a/templates/client/includes/exposition/search_result.html +++ b/templates/client/includes/exposition/search_result.html @@ -67,18 +67,6 @@
    {% include 'client/includes/exposition/services.html' with obj=result.object %} {% include 'client/includes/calendar_button.html' with obj=result.object %} -
    - - {% with note=result.object|note_by_user:request.user %} - {% trans 'заметка' %} -
    -
    - -
    -
    - {% endwith %} - -
    {% include 'client/buttons/booking_button.html' with object=result.object %} diff --git a/templates/client/includes/exposition/services.html b/templates/client/includes/exposition/services.html index a1ee6244..ec8a50a9 100644 --- a/templates/client/includes/exposition/services.html +++ b/templates/client/includes/exposition/services.html @@ -1,6 +1,8 @@ {% load i18n %} -
    +{% trans 'подробнее' %} +{# Временно комментируем https://trello.com/c/ioPIxPlS/91-%D1%83%D0%BB%D1%83%D1%87%D1%88%D0%B5%D0%BD%D0%B8%D0%B5-%D0%BF%D1%80%D0%B8%D0%BE%D1%80%D0%B8%D1%82%D0%B5%D1%82-8-%D1%83%D0%B1%D1%80%D0%B0%D1%82%D1%8C-%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B8-%D0%BD%D0%B0-%D1%83%D1%81%D0%BB%D1%83%D0%B3%D0%B8-%D0%B8%D0%B7-%D1%80%D1%83%D0%B1%D1%80%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D1%80%D0%BE%D0%B2-%D0%B8%D0%B7-%D0%BC%D0%B5%D0%BD%D1%8E-%D1%81%D0%BE-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86-%D0%B2%D1%8B%D1%81%D1%82%D0%B0%D0%B2%D0%BE%D0%BA-%D0%B8-%D1%81%D0%BE-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86-%D0%BA%D0%BE%D0%BD%D1%84%D0%B5%D1%80%D0%B5%D0%BD%D1%86%D0%B8%D0%B9 #} +{% comment %}
    {% trans 'услуги' %}
      @@ -22,4 +24,4 @@ {% endif %}
    -
    +
    {% endcomment %} diff --git a/templates/client/includes/services.html b/templates/client/includes/services.html index 59a270db..ca56f4dd 100644 --- a/templates/client/includes/services.html +++ b/templates/client/includes/services.html @@ -1,12 +1,10 @@ {% load i18n %} diff --git a/templates/client/index.html b/templates/client/index.html index 2a8f2519..04a172fc 100644 --- a/templates/client/index.html +++ b/templates/client/index.html @@ -58,14 +58,6 @@