summaryrefslogtreecommitdiffstats
path: root/bn_django/git_browse/urls.py
blob: 909bfcdc44ac55d36c658c0e8d49f305e98c9974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from django.conf.urls.defaults import *
from django.conf import settings

from models import *

try:
    GITBROWSE_BASE = settings.GITBROWSE_BASE.strip('/')
except AttributeError:
    GITBROWSE_BASE='/home'

try:
    ADMIN_URL = settings.ADMIN_URL
except AttributeError:
    ADMIN_URL='/admin'
if ADMIN_URL[-1] == '/':
    ADMIN_URL=ADMIN_URL[:-1]

#from models import Gallery, Photo, ADMIN_URL, STOCKPHOTO_URL

info_dict = { 'extra_context': { 'admin_url': ADMIN_URL,
                                 } }

urlpatterns = patterns('django.views.generic.list_detail',
	(r'^$', 'object_list',
		dict(info_dict, queryset=Repository.objects.all(),
		     allow_empty= True)),
#	(r'^(?P<object_id>\d+)/$', 'object_detail',
#		dict(info_dict, queryset=Gallery.objects.all())),
#	(r'^detail/(?P<object_id>\d+)/$', 'object_detail',
#		dict(info_dict, queryset=Photo.objects.all())),
)

urlpatterns += patterns('bn_django.git_browse.views',
    (r'^(?P<repo>[\w\-\_]*)/$', 'repo_info',), 
    (r'^(?P<repo>[\w\-\_]*)/tree/$', 'view_tree',), 
    (r'^(?P<repo>[\w\-\_]*)/branches/$', 'view_branches',), 
    (r'^(?P<repo>[\w\-\_]*)/history/$', 'view_history',), 
    (r'^(?P<repo>[\w\-\_]*)/log/$', 'view_log',), 
    (r'^(?P<repo>[\w\-\_]*)/obj/(?P<hash>[0-9a-z]{40})/$', 'view_obj',), 
    (r'^(?P<repo>[\w\-\_]*)/tree/(?P<hash>[0-9a-z]{40})/$', 'view_tree',), 
)