2012-04-28 18:16:05 +02:00
|
|
|
from django.conf.urls.defaults import url, patterns, include
|
2012-06-03 09:43:49 +02:00
|
|
|
from django.contrib.auth.decorators import user_passes_test
|
|
|
|
|
2012-06-12 15:27:28 +02:00
|
|
|
from djcelery.views import apply as apply_task
|
2012-06-03 09:43:49 +02:00
|
|
|
from djeuscan.views import registered_tasks
|
|
|
|
|
2012-11-02 17:33:00 +01:00
|
|
|
from euscan_accounts.views import favourite_package, unfavourite_package, \
|
|
|
|
favourite_category, unfavourite_category, favourite_herd, \
|
|
|
|
unfavourite_herd, favourite_maintainer, unfavourite_maintainer, \
|
|
|
|
favourite_overlay, unfavourite_overlay, favourite_world, unfavourite_world
|
|
|
|
|
2012-05-13 14:09:22 +02:00
|
|
|
from djeuscan.feeds import PackageFeed, CategoryFeed, HerdFeed, \
|
2013-02-26 09:33:25 +01:00
|
|
|
MaintainerFeed, GlobalFeed, WorldScanFeed, StabilizationCandidatesFeed
|
2012-06-03 09:43:49 +02:00
|
|
|
|
|
|
|
admin_required = user_passes_test(lambda u: u.is_superuser)
|
|
|
|
|
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
package_patterns = patterns('djeuscan.views',
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^$', 'package', name="package"),
|
|
|
|
url(r'^feed/$', PackageFeed(), name='package_feed'),
|
2012-11-02 17:33:00 +01:00
|
|
|
url(r'^favourite/$', favourite_package, name="favourite_package"),
|
|
|
|
url(r'^unfavourite/$', unfavourite_package, name="unfavourite_package"),
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^refresh$', "refresh_package", name="refresh_package"),
|
|
|
|
url(r'^problem$', 'problem', name="problem"),
|
2012-11-26 15:38:27 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
files_patterns = patterns('djeuscan.views',
|
|
|
|
url(r'^(?P<overlay>[\w+][\w+.-]*)/(?P<cpv>.+).ebuild$',
|
|
|
|
"package_version_ebuild",
|
2012-11-08 15:21:02 +01:00
|
|
|
name="package_version_ebuild"),
|
2012-11-26 15:38:27 +01:00
|
|
|
url(r'^(?P<overlay>[\w+][\w+.-]*)/(?P<category>[\w+][\w+.-]*)/'
|
|
|
|
r'(?P<package>[\w+][\w+.-]*)/metadata.xml$',
|
|
|
|
"package_metadata",
|
|
|
|
name="package_metadata"),
|
2011-08-25 15:39:54 +02:00
|
|
|
)
|
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
categories_patterns = patterns('djeuscan.views',
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^(?:view/)?$', 'category', name="category"),
|
|
|
|
url(r'^feed/$', CategoryFeed(), name='category_feed'),
|
|
|
|
url(r'^charts/(?P<chart>[\w\-]+).png$', 'chart_category',
|
|
|
|
name="chart_category"),
|
2012-11-02 17:33:00 +01:00
|
|
|
url(r'^favourite/$', favourite_category, name="favourite_category"),
|
|
|
|
url(r'^unfavourite/$', unfavourite_category,
|
2012-11-01 16:25:32 +01:00
|
|
|
name="unfavourite_category"),
|
2011-08-25 15:39:54 +02:00
|
|
|
)
|
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
herds_patterns = patterns('djeuscan.views',
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^(?:view/)?$', 'herd', name="herd"),
|
|
|
|
url(r'^feed/$', HerdFeed(), name='herd_feed'),
|
|
|
|
url(r'^charts/(?P<chart>[\w\-]+).png$', 'chart_herd', name="chart_herd"),
|
2012-11-02 17:33:00 +01:00
|
|
|
url(r'^favourite/$', favourite_herd, name="favourite_herd"),
|
|
|
|
url(r'^unfavourite/$', unfavourite_herd, name="unfavourite_herd"),
|
2011-08-25 15:39:54 +02:00
|
|
|
)
|
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
maintainers_patterns = patterns('djeuscan.views',
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^(?:view/)?$', 'maintainer', name="maintainer"),
|
|
|
|
url(r'^feed/$', MaintainerFeed(), name='maintainer_feed'),
|
|
|
|
url(r'^charts/(?P<chart>[\w\-]+).png$', 'chart_maintainer',
|
|
|
|
name="chart_maintainer"),
|
2012-11-02 17:33:00 +01:00
|
|
|
url(r'^favourite/$', favourite_maintainer, name="favourite_maintainer"),
|
|
|
|
url(r'^unfavourite/$', unfavourite_maintainer,
|
2012-11-01 16:25:32 +01:00
|
|
|
name="unfavourite_maintainer"),
|
2011-08-25 15:39:54 +02:00
|
|
|
)
|
2011-04-13 08:50:24 +02:00
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
overlays_patterns = patterns('djeuscan.views',
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^(?:view/)?$', 'overlay', name="overlay"),
|
2012-11-02 17:33:00 +01:00
|
|
|
url(r'^favourite/$', favourite_overlay, name="favourite_overlay"),
|
|
|
|
url(r'^unfavourite/$', unfavourite_overlay, name="unfavourite_overlay"),
|
2011-11-23 18:03:07 +01:00
|
|
|
)
|
|
|
|
|
2012-06-08 14:21:11 +02:00
|
|
|
tasks_patterns = patterns('djeuscan.views',
|
2012-06-03 09:43:49 +02:00
|
|
|
url(r'^registered_tasks/$', admin_required(registered_tasks),
|
|
|
|
name="registered_tasks"),
|
2012-06-12 15:27:28 +02:00
|
|
|
url(r'^apply/(?P<task_name>.*)/$', admin_required(apply_task),
|
2012-06-03 09:43:49 +02:00
|
|
|
name="apply_task"),
|
|
|
|
)
|
|
|
|
|
2012-06-12 15:27:28 +02:00
|
|
|
|
2012-04-04 17:31:54 +02:00
|
|
|
urlpatterns = patterns('djeuscan.views',
|
2011-11-15 17:08:29 +01:00
|
|
|
# Global stuff
|
2012-05-06 20:03:49 +02:00
|
|
|
url(r'^api/', include('djeuscan.api.urls')),
|
2012-04-04 17:31:54 +02:00
|
|
|
|
2012-05-01 16:56:09 +02:00
|
|
|
url(r'^$', 'index', name="index"),
|
2011-08-25 15:39:54 +02:00
|
|
|
url(r'^feed/$', GlobalFeed(), name='global_feed'),
|
2013-02-26 09:33:25 +01:00
|
|
|
url(r'^feed/stabilization_candidates$', StabilizationCandidatesFeed(),
|
|
|
|
name='stabilization_candidates_feed'),
|
2012-05-06 20:03:49 +02:00
|
|
|
url(r'^about/$', 'about', name="about"),
|
|
|
|
url(r'^about/api$', 'api', name="api"),
|
2012-08-14 15:32:54 +02:00
|
|
|
url(r'^about/feeds$', 'feeds', name="feeds"),
|
2012-09-24 16:47:21 +02:00
|
|
|
url(r'^about/config$', 'config', name="config"),
|
2012-05-06 20:03:49 +02:00
|
|
|
url(r'^statistics/$', 'statistics', name="statistics"),
|
2012-11-26 23:39:34 +01:00
|
|
|
url(r'^statistics/handlers/(?P<handler>[^/]+)/$', 'statistics_handler',
|
2012-11-26 14:55:49 +01:00
|
|
|
name="statistics_handler"),
|
2012-05-06 20:03:49 +02:00
|
|
|
url(r'^statistics/charts/(?P<chart>[\w\-]+).png$', 'chart', name="chart"),
|
|
|
|
url(r'^world/$', 'world', name="world"),
|
|
|
|
url(r'^world/scan/$', 'world_scan', name="world_scan"),
|
2012-09-14 15:25:08 +02:00
|
|
|
url(r'^world/scan/feed$', WorldScanFeed(), name="world_scan_feed"),
|
2012-11-02 17:33:00 +01:00
|
|
|
url(r'^world/favourite/$', favourite_world, name="favourite_world"),
|
|
|
|
url(r'^world/unfavourite/$', unfavourite_world,
|
2012-08-10 17:45:43 +02:00
|
|
|
name="unfavourite_world"),
|
2011-11-15 17:08:29 +01:00
|
|
|
|
|
|
|
# Real data
|
2012-11-01 16:25:32 +01:00
|
|
|
url(r'^categories/$', 'categories', name="categories"),
|
|
|
|
url(r'^categories/(?P<category>[\w+][\w+.-]*)/',
|
|
|
|
include(categories_patterns)),
|
|
|
|
|
|
|
|
url(r'^herds/$', 'herds', name="herds"),
|
|
|
|
url(r'^herds/(?P<herd>[\@\{\}\w+.-]+)/', include(herds_patterns)),
|
|
|
|
|
|
|
|
url(r'^maintainers/$', 'maintainers', name="maintainers"),
|
|
|
|
url(r'^maintainers/(?P<maintainer_id>\d+)/',
|
|
|
|
include(maintainers_patterns)),
|
|
|
|
url(r'^maintainers/(?P<maintainer_email>[^/]+)/',
|
|
|
|
include(maintainers_patterns)),
|
|
|
|
|
|
|
|
url(r'^overlays/$', 'overlays', name="overlays"),
|
|
|
|
url(r'^overlays/(?P<overlay>[\w+][\w+.-]*)/', include(overlays_patterns)),
|
|
|
|
|
|
|
|
url(r'^package/(?P<category>[\w+][\w+.-]*)/(?P<package>[\w+][\w+.-]*)/',
|
|
|
|
include(package_patterns)),
|
2012-06-12 15:27:28 +02:00
|
|
|
|
2012-11-26 15:38:27 +01:00
|
|
|
url(r'^files/', include(files_patterns)),
|
|
|
|
|
2012-06-03 09:43:49 +02:00
|
|
|
url(r'^tasks/', include(tasks_patterns)),
|
2011-04-13 08:50:24 +02:00
|
|
|
)
|