parent
80c88f6357
commit
ed095384dc
8 changed files with 189 additions and 29 deletions
@ -1,18 +1,30 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.conf.urls import patterns, include, url |
||||
from views import PlaceDetail, PlaceList, PlaceCityCatalog, PlaceCountryCatalog, PlacePhoto |
||||
|
||||
from django.conf.urls import include, patterns, url |
||||
|
||||
from .views import ( |
||||
PlaceCityCatalog, |
||||
PlaceCountryCatalog, |
||||
PlaceDetail, |
||||
PlaceList, |
||||
PlacePhoto, |
||||
PlaceByCountry, |
||||
PlaceByCity, |
||||
) |
||||
|
||||
urlpatterns = patterns('', |
||||
url(r'country/(?P<slug>.*)/page/(?P<page>\d+)/$', PlaceCountryCatalog.as_view(), {'meta_id': 49}), |
||||
url(r'country/(?P<slug>.*)/$', PlaceCountryCatalog.as_view(), {'meta_id': 49}), |
||||
|
||||
url(r'city/(?P<slug>.*)/page/(?P<page>\d+)/$', PlaceCityCatalog.as_view(), {'meta_id': 48}), |
||||
url(r'city/(?P<slug>.*)/$', PlaceCityCatalog.as_view(), {'meta_id': 48}), |
||||
url(r'(?P<slug>.*)/photo/page/(?P<page>\d+)/$', PlacePhoto.as_view(), {'meta_id': 91}), |
||||
url(r'(?P<slug>.*)/photo/$', PlacePhoto.as_view(), {'meta_id': 91}), |
||||
url(r'page/(?P<page>\d+)/$', PlaceList.as_view(), {'meta_id': 46}), |
||||
url(r'(?P<slug>.*)/$', PlaceDetail.as_view(), {'meta_id': 47}), |
||||
url(r'$', PlaceList.as_view(), {'meta_id':46}), |
||||
url(r'^country/$', PlaceByCountry.as_view(), {'meta_id': 49}), |
||||
url(r'^country/(?P<slug>.*)/page/(?P<page>\d+)/$', PlaceCountryCatalog.as_view(), {'meta_id': 49}), |
||||
url(r'^country/(?P<slug>.*)/$', PlaceCountryCatalog.as_view(), {'meta_id': 49}), |
||||
|
||||
url(r'^city/$', PlaceByCity.as_view(), {'meta_id': 48}), |
||||
url(r'^city/(?P<slug>.*)/page/(?P<page>\d+)/$', PlaceCityCatalog.as_view(), {'meta_id': 48}), |
||||
url(r'^city/(?P<slug>.*)/$', PlaceCityCatalog.as_view(), {'meta_id': 48}), |
||||
|
||||
url(r'^(?P<slug>.*)/photo/page/(?P<page>\d+)/$', PlacePhoto.as_view(), {'meta_id': 91}), |
||||
url(r'^(?P<slug>.*)/photo/$', PlacePhoto.as_view(), {'meta_id': 91}), |
||||
|
||||
url(r'^page/(?P<page>\d+)/$', PlaceList.as_view(), {'meta_id': 46}), |
||||
url(r'^(?P<slug>.*)/$', PlaceDetail.as_view(), {'meta_id': 47}), |
||||
url(r'^$', PlaceList.as_view(), {'meta_id':46}), |
||||
) |
||||
|
||||
@ -0,0 +1,13 @@ |
||||
{% load i18n %} |
||||
<div class="mps-sect"> |
||||
<header>{% trans 'Места' %}</header> |
||||
<nav> |
||||
<ul> |
||||
<li><a href="/places/country/">{% trans 'По странам' %}</a></li> |
||||
<li><a href="/places/city/">{% trans 'По городам' %}</a></li> |
||||
<li><a href="/places/city/moscow/">{% trans 'Конференции в Москве' %}</a></li> |
||||
<li><a href="/places/city/saint-petersburg/">{% trans 'Конференции в Петербурге' %}</a></li> |
||||
<li><a href="/places/country/russia/">{% trans 'Конференции в России' %}</a></li> |
||||
</ul> |
||||
</nav> |
||||
</div> |
||||
@ -0,0 +1,44 @@ |
||||
{% extends 'base_catalog.html' %} |
||||
{% load static %} |
||||
{% load i18n %} |
||||
{% load template_filters %} |
||||
|
||||
{% block style %} |
||||
<link rel="stylesheet" href="{% static 'client/css/pages/exposition_by.css' %}"> |
||||
{% endblock %} |
||||
|
||||
|
||||
{% block bread_scrumbs %} |
||||
<div class="bread-crumbs"> |
||||
<a href="/">{% trans 'Главная страница' %}</a> |
||||
<a href="{{ place_catalog }}">{% trans 'Места' %}</a> |
||||
<strong>{{ title1 }}</strong> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block page_title %} |
||||
<div class="page-title"> |
||||
<h1>{{ title2 }}:</h1> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block content_list %} |
||||
{% with objects=object_list %} |
||||
{% for obj in objects %} |
||||
{% set cur_word = obj.name %} |
||||
{% if cur_word|slice:":1"|lower != prev_word|slice:":1"|lower and forloop.counter != 1 %} |
||||
</ul> |
||||
{% endif %} |
||||
{% if cur_word|slice:":1"|lower != prev_word|slice:":1"|lower %} |
||||
<ul class="leter-list"> |
||||
<div class="leter"><font size="5">{{ cur_word|slice:":1"|upper }}</font></div> |
||||
{% endif %} |
||||
<li> |
||||
<a href="{{ place_catalog }}{{ catalog }}{{ obj.url }}/">{{ obj.name }} ({{ obj.place_count }})</a> |
||||
</li> |
||||
{% set prev_word = obj.name %} |
||||
{% endfor %} |
||||
{% endwith %} |
||||
|
||||
{% endblock %} |
||||
|
||||
Loading…
Reference in new issue