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.urls import patterns, include, url, handler404
6 from django.utils.translation import ugettext_lazy as _
7 from django.utils.translation import string_concat
8 from migdal import feeds, app_settings
9 from migdal.views import SearchPublishedView
10 from fnpdjango.utils.urls import i18n_patterns
13 for t in app_settings.TYPES:
16 url(string_concat(r'^', t.slug, r'/$'),
17 'migdal.views.entry_list', {'type_db': t.db},
18 name='migdal_entry_list_%s' % t.db),
19 url(string_concat(r'^', t.slug, r'/rss.xml$'),
20 feeds.EntriesFeed(), {'type_db': t.db},
21 name='migdal_entry_list_%s_feed' % t.db),
23 url(string_concat(r'^', t.slug, r'/(?P<slug>[^/]+)/$'),
24 'migdal.views.entry', {'type_db': t.db},
25 name='migdal_entry_%s' % t.db),
29 urlpatterns = i18n_patterns('',
31 url(r'^$', 'migdal.views.main', name='migdal_main'),
32 url(r'^rss.xml$', feeds.EntriesFeed(), name='migdal_main_feed'),
34 url(string_concat(r'^', _('submit'), r'/$'), 'migdal.views.submit', name='migdal_submit'),
35 url(string_concat(r'^', _('submit'), r'/', _('thanks'), r'$'), 'migdal.views.submit_thanks', name='migdal_submit_thanks'),
37 url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/$'),
38 'migdal.views.entry_list', name='migdal_category'),
39 url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/rss.xml$'),
40 feeds.EntriesFeed(), name='migdal_category_feed'),
41 url(string_concat(r'^', _('search')), SearchPublishedView(), name='search'),