очистил city от лишнего кода

remotes/origin/HEAD
Slava Kyrachevsky 9 years ago
parent e75c406714
commit a6540aded2
  1. 8
      apps/city/admin.py
  2. 3
      apps/city/urls.py
  3. 11
      apps/city/views.py
  4. 150
      templates/client/city/city.html

@ -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/')

@ -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<slug>.*)', CityView.as_view()),
)

@ -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')
return HttpResponse('not ajax')

@ -1,150 +0,0 @@
{% extends 'base_catalog.html' %}
{% load static %}
{% load i18n %}
{% block bread_scrumbs %}
<div class="bread-crumbs">
<a href="/">{% trans 'Главная страница' %}</a>
<strong>{{ object.name }}</strong>
</div>
{% 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 %}
<div class="m-article">
<div class="item-wrap place clearfix">
<aside>
<div class="i-pict">
{% include 'client/includes/show_logo.html' with obj=object %}
</div>
</aside>
<div class="i-info">
<header>
<h1 class="i-title">{{ object.name }}</h1>
</header>
<table class="country_table">
<tr>
<td>
<ul>
{% if object.population %}
<li><strong>{% trans 'Население' %}:</strong><span>{{ object.population }} {% trans 'человек' %}</span></li>
{% endif %}
{% if object.code_IATA %}
<li>Код IATA:<span>{{ object.code_IATA.code }}</span></li>
{% endif %}
{% if object.phone_code %}
<li>{% trans 'Телефонный код' %}:<span>+{{ object.phone_code }}</span></li>
{% endif %}
{% if object.transport %}
<li><i>{% trans 'Транспорт' %}:</i><span>{{ object.transport }}</span></li>
{% endif %}
</ul>
</td>
</tr>
</table>
<div class="i-address map-opened country_map">
<div class="i-map">
<!-- позиция для карты задается в атрибуте data-coords -->
<div class="map-canvas" id="map-canvas" data-coords="{{ object.latitude|stringformat:'f' }},{{ object.longitude|stringformat:'f' }}" ></div>
<div class="close-map"><a class="toggle-map" href="#">{% trans 'Скрыть карту' %}</a></div>
</div>
<header>
<div class="show-map show-map_1"><a class="toggle-map" href="#">{% trans 'Раскрыть карту' %}</a></div>
</header>
</div>
</div>
</div>
<table class="map_info_block">
{% if object.famous_places %}
<tr>
<th>{% trans 'Должны посетить' %}:</th>
<td class="width_1">
{{ object.famous_places }}
</td>
</tr>
{% endif %}
{% if object.shoping %}
<tr>
<th>{% trans 'Шоппинг' %}:</th>
<td class="width_1">
{{ object.shoping }}
</td>
</tr>
{% endif %}
</table>
{% if object.description %}
<hr />
<div class="i-services country_content">
<h2 class="sect-title">{% trans "Описание" %}</h2>
<div class="i-descr">
{{ object.description }}
</div>
</div>
{% endif %}
{% if object.get_photos %}
<div class="i-photo-slides i-photo-slides_1">
<h2 class="sect-title">{% trans "Фотогалерея" %}</h2>
<div id="ps-photo-gallery" class="ps-photo-gallery swiper-container">
<ul class="swiper-wrapper">
<li class="swiper-slide"><img src="img/_del-temp/place-photo-1.jpg" alt="" /></li>
<li class="swiper-slide"><img src="img/_del-temp/event-photo-1.jpg" alt="" /></li>
</ul>
<div class="re-controls">
<a class="prev" href="#">&lt;</a>
<a class="next" href="#">&gt;</a>
</div>
</div>
</div>
{% endif %}
</div>
{% if object.get_events %}
<br>
<div class="i-events-list">
<div class="sect-title blog_link">
<a href="#" title="">{% trans 'События в' %} {{ object.name }}</a><a class="button more" href="{{ object.events_catalog }}">{% trans 'Все события' %}</a>
</div>
{% include 'includes/exposition/exposition_list.html' with object_list=object.get_events %}
</div>
{% endif %}
{% if object.get_places %}
<br>
<div class="i-events-list">
<div class="sect-title blog_link">
<a href="#" title="">{% trans 'Места в' %} {{ object.name }}</a><a class="button more" href="{{ object.places_catalog }}">{% trans 'Все места' %}</a>
</div>
{% include 'includes/place/place_list.html' with object_list=object.get_places %}
</div>
{% endif %}
{% if object.get_organisers %}
<br>
<div class="i-events-list">
<div class="sect-title blog_link">
<a href="#" title="">{% trans 'Организаторы в' %} {{ object.name }}</a><a class="button more" href="#">{% trans 'Все организаторы' %} </a>
</div>
{% include 'includes/organiser/organiser_list.html' with object_list=object.get_organisers %}
</div>
{% endif %}
{% endblock %}
Loading…
Cancel
Save