From 0d98413be85e55dbb992f2be9614d44daf3e8e27 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 13 Mar 2007 22:51:10 -0700 Subject: got latex, raw, and download links working --- bn_django/git_wiki/models.py | 2 +- bn_django/git_wiki/templates/git_wiki/newitems_table | 18 +++++++++++++----- bn_django/git_wiki/templates/git_wiki/tree_table | 11 +++++++---- bn_django/git_wiki/urls.py | 8 +++++++- 4 files changed, 28 insertions(+), 11 deletions(-) (limited to 'bn_django/git_wiki') diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py index f320984..3023500 100644 --- a/bn_django/git_wiki/models.py +++ b/bn_django/git_wiki/models.py @@ -222,7 +222,7 @@ def reposcan(): def newest_items(): num = Item.objects.count() - min = num-7 + min = num-6 if min < 0: min = 0 return Item.objects.all()[min:num] diff --git a/bn_django/git_wiki/templates/git_wiki/newitems_table b/bn_django/git_wiki/templates/git_wiki/newitems_table index d86c538..e072a10 100644 --- a/bn_django/git_wiki/templates/git_wiki/newitems_table +++ b/bn_django/git_wiki/templates/git_wiki/newitems_table @@ -3,11 +3,19 @@ {% for i in newitems reversed %} {% ifequal i.type 'blob' %} - - {{i.path}} - - pdf - + {% if i.isfig %} + + {{i.path}} + + download + {% else %} + + {{i.path}} + + pdf  + latex  + raw + {% endif %} {% else %} {% ifequal i.type 'tree' %} {{i.path}}/ diff --git a/bn_django/git_wiki/templates/git_wiki/tree_table b/bn_django/git_wiki/templates/git_wiki/tree_table index c1f9a82..2f638ef 100644 --- a/bn_django/git_wiki/templates/git_wiki/tree_table +++ b/bn_django/git_wiki/templates/git_wiki/tree_table @@ -5,12 +5,15 @@ {{o.type}} {% ifequal o.type 'blob' %} - - {{o.path}} - {% if o.isfig %} - download + + {{o.path}} + + download {% else %} + + {{o.path}} + pdf  latex  raw diff --git a/bn_django/git_wiki/urls.py b/bn_django/git_wiki/urls.py index 2570f05..3489941 100644 --- a/bn_django/git_wiki/urls.py +++ b/bn_django/git_wiki/urls.py @@ -18,12 +18,18 @@ urlpatterns = patterns('bn_django.git_wiki.views', (r'^commit/(?P[0-9a-z]{40})/$', 'view_commit',), (r'^(?P[\w\-\_\/]*)/log/$', 'tree',), (r'^(?P[\w\-\_\/]*)/edit/$', 'tree',), - (r'^(?P[\w\-\_\/]*)/pdf/$', 'tree',), + (r'^(?P[\w\-\_\/]*)/pdf/$', 'latexitem',), (r'^(?P[\w\-\_\/]*)/raw/$', 'rawitem',), (r'^(?P[\w\-\_\/]*)/latex/$', 'latexitem',), (r'^(?P[\w\-\_\/]*\.png/?)$', 'figure',), (r'^(?P[\w\-\_\/]*\.gif/?)$', 'figure',), (r'^(?P[\w\-\_\/]*\.jpg/?)$', 'figure',), (r'^(?P[\w\-\_\/]*\.jpeg/?)$', 'figure',), + (r'^(?P[\w\-\_\/]*\.svg/?)$', 'figure',), + (r'^(?P[\w\-\_\/]*\.png)/download/$', 'figure',{'download':True}), + (r'^(?P[\w\-\_\/]*\.gif)/download/$', 'figure',{'download':True}), + (r'^(?P[\w\-\_\/]*\.jpg)/download/$', 'figure',{'download':True}), + (r'^(?P[\w\-\_\/]*\.jpeg)/download/$','figure',{'download':True}), + (r'^(?P[\w\-\_\/]*\.svg)/download/$', 'figure',{'download':True}), (r'^(?P[\w\-\_\/]*)$', 'tree',), ) -- cgit v1.2.3