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
6 from django.utils.translation import ugettext_lazy as _
7 from django.utils.translation import string_concat
8 from migdal import feeds, settings
9 from migdal.helpers import i18n_patterns
12 for t in settings.TYPES:
15 url(string_concat(r'^', t.slug, r'/$'),
16 'migdal.views.entry_list', {'type_db': t.db},
17 name='migdal_entry_list_%s' % t.db),
18 url(string_concat(r'^', t.slug, r'/rss.xml$'),
19 feeds.EntriesFeed(), {'type_db': t.db},
20 name='migdal_entry_list_%s_feed' % t.db),
22 url(string_concat(r'^', t.slug, r'/(?P<slug>[^/]+)/$'),
23 'migdal.views.entry', {'type_db': t.db},
24 name='migdal_entry_%s' % t.db),
27 urlpatterns = i18n_patterns('',
29 url(r'^$', 'migdal.views.entry_list', name='migdal_main'),
30 url(r'^rss.xml$', feeds.EntriesFeed(), name='migdal_main_feed'),
32 url(string_concat(r'^', _('submit'), r'/$'), 'migdal.views.submit', name='migdal_submit'),
33 url(string_concat(r'^', _('submit'), r'/', _('thanks'), r'$'), 'migdal.views.submit_thanks', name='migdal_submit_thanks'),
35 url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/$'),
36 'migdal.views.entry_list', name='migdal_category'),
37 url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/rss.xml$'),
38 feeds.EntriesFeed(), name='migdal_category_feed'),