From a6540aded2e53ffc1898b4d753d6cffc86f1332f Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Fri, 3 Feb 2017 12:39:25 +0200 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=B8=D0=BB=20ci?= =?UTF-8?q?ty=20=D0=BE=D1=82=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/city/admin.py | 8 +- apps/city/urls.py | 3 - apps/city/views.py | 11 +-- templates/client/city/city.html | 150 -------------------------------- 4 files changed, 2 insertions(+), 170 deletions(-) delete mode 100644 templates/client/city/city.html diff --git a/apps/city/admin.py b/apps/city/admin.py index 34a05fc7..fc5edef7 100644 --- a/apps/city/admin.py +++ b/apps/city/admin.py @@ -21,13 +21,6 @@ from functions.admin_views import AdminListView from functions.http import JsonResponse -def city_all(request): - """ - return list of all cities with pagination - """ - return objects_list(request, City, 'city_all.html') - - def city_add(request): """ Return form of city and post it on the server. @@ -35,6 +28,7 @@ def city_add(request): """ return add_object_with_file(request, CityForm, 'city_add.html', '/admin/city/all') + def city_delete(request, url): return delete_object(request, City, CityDeleteForm, url, '/admin/city/all/') diff --git a/apps/city/urls.py b/apps/city/urls.py index 2496e422..12aa719d 100644 --- a/apps/city/urls.py +++ b/apps/city/urls.py @@ -1,9 +1,6 @@ # -*- coding: utf-8 -*- from django.conf.urls import patterns, url -from views import CityView urlpatterns = patterns('', url(r'get-city/', 'city.views.get_city'), - # commented for good times - #url(r'(?P.*)', CityView.as_view()), ) diff --git a/apps/city/views.py b/apps/city/views.py index 0cf49417..9143c18c 100644 --- a/apps/city/views.py +++ b/apps/city/views.py @@ -7,15 +7,6 @@ from models import City from settings.views import get_by_lang -class CityView(DetailView): - """ - this view is not used yet - """ - model = City - slug_field = 'url' - template_name = 'client/city/city.html' - - def get_city(request): """ returns filtered cities in current language in json format @@ -39,4 +30,4 @@ def get_city(request): return HttpResponse(json.dumps(result, indent=4), content_type='application/json') else: - return HttpResponse('not ajax') \ No newline at end of file + return HttpResponse('not ajax') diff --git a/templates/client/city/city.html b/templates/client/city/city.html deleted file mode 100644 index ca5797a7..00000000 --- a/templates/client/city/city.html +++ /dev/null @@ -1,150 +0,0 @@ -{% extends 'base_catalog.html' %} -{% load static %} -{% load i18n %} - -{% block bread_scrumbs %} - -{% endblock %} - -{% block page_title %} -{% endblock %} - -{% if object.get_events %} - {% block head_scripts %} - {% include "client/includes/banners/tops_head_js.html" %} - {% endblock head_scripts %} -{% endif %} - -{% block content_list %} -
-
- - -
-
-

{{ object.name }}

-
- - - - - -
-
    - {% if object.population %} -
  • {% trans 'Население' %}:{{ object.population }} {% trans 'человек' %}
  • - {% endif %} - - {% if object.code_IATA %} -
  • Код IATA:{{ object.code_IATA.code }}
  • - {% endif %} - - {% if object.phone_code %} -
  • {% trans 'Телефонный код' %}:+{{ object.phone_code }}
  • - {% endif %} - {% if object.transport %} -
  • {% trans 'Транспорт' %}:{{ object.transport }}
  • - {% endif %} -
-
- - - -
-
- - {% if object.famous_places %} - - - - - {% endif %} - {% if object.shoping %} - - - - - {% endif %} -
{% trans 'Должны посетить' %}: - {{ object.famous_places }} -
{% trans 'Шоппинг' %}: - {{ object.shoping }} -
- - {% if object.description %} -
-
-

{% trans "Описание" %}

-
- {{ object.description }} -
-
- {% endif %} - - {% if object.get_photos %} -
-

{% trans "Фотогалерея" %}

- -
- {% endif %} -
- -{% if object.get_events %} -
-
- - {% include 'includes/exposition/exposition_list.html' with object_list=object.get_events %} -
-{% endif %} - -{% if object.get_places %} -
-
- - {% include 'includes/place/place_list.html' with object_list=object.get_places %} -
-{% endif %} - -{% if object.get_organisers %} -
-
- - {% include 'includes/organiser/organiser_list.html' with object_list=object.get_organisers %} -
-{% endif %} - -{% endblock %}