1 # -*- coding: utf-8 -*-
2 # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.conf import settings
6 from django.conf.urls import url
7 from django.utils.translation import ugettext_lazy as _
8 from django.utils.translation import string_concat
9 from migdal import feeds, app_settings
10 from migdal.views import SearchPublishedView
11 from fnpdjango.utils.urls import i18n_patterns
14 for t in app_settings.TYPES:
17 url(string_concat(r'^', t.slug, r'/$'),
18 'migdal.views.entry_list', {'type_db': t.db},
19 name='migdal_entry_list_%s' % t.db),
20 url(string_concat(r'^', t.slug, r'/rss.xml$'),
21 feeds.EntriesFeed(), {'type_db': t.db},
22 name='migdal_entry_list_%s_feed' % t.db),
24 url(string_concat(r'^', t.slug, r'/(?P<slug>[^/]+)/$'),
25 'migdal.views.entry', {'type_db': t.db},
26 name='migdal_entry_%s' % t.db),
30 urlpatterns = i18n_patterns(
33 url(r'^$', 'migdal.views.main', name='migdal_main'),
34 url(r'^rss.xml$', feeds.EntriesFeed(), name='migdal_main_feed'),
36 url(string_concat(r'^', _('submit'), r'/$'), 'migdal.views.submit', name='migdal_submit'),
37 url(string_concat(r'^', _('submit'), r'/', _('thanks'), r'$'), 'migdal.views.submit_thanks',
38 name='migdal_submit_thanks'),
40 url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/$'),
41 'migdal.views.entry_list', name='migdal_category'),
42 url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/rss.xml$'),
43 feeds.EntriesFeed(), name='migdal_category_feed'),
44 url(string_concat(r'^', _('search')), SearchPublishedView(), name='search'),
50 if 'django.contrib.sitemaps' in settings.INSTALLED_APPS:
51 import django.contrib.sitemaps.views
52 from .sitemap import sitemaps
54 url(r'^sitemap\.xml$', django.contrib.sitemaps.views.sitemap, {