aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/git_wiki
diff options
context:
space:
mode:
authorbnewbold <bnewbold@manus.(none)>2007-03-13 22:51:10 -0700
committerbnewbold <bnewbold@manus.(none)>2007-03-13 22:51:10 -0700
commit0d98413be85e55dbb992f2be9614d44daf3e8e27 (patch)
tree146877b9c7d6f8c53fb0eae8963941b6cf4801e7 /bn_django/git_wiki
parent9065cb663a14ab263295694426071cd42b0bb4ae (diff)
downloadbnewnet-0d98413be85e55dbb992f2be9614d44daf3e8e27.tar.gz
bnewnet-0d98413be85e55dbb992f2be9614d44daf3e8e27.zip
got latex, raw, and download links working
Diffstat (limited to 'bn_django/git_wiki')
-rw-r--r--bn_django/git_wiki/models.py2
-rw-r--r--bn_django/git_wiki/templates/git_wiki/newitems_table18
-rw-r--r--bn_django/git_wiki/templates/git_wiki/tree_table11
-rw-r--r--bn_django/git_wiki/urls.py8
4 files changed, 28 insertions, 11 deletions
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 %}
<tr> <td class="filename">
{% ifequal i.type 'blob' %}
- <a href='/k/{{ i.slug }}/' class="item">
- {{i.path}}</a>
- </td><td type="links">
- <a href='/k/{{ i.slug }}/pdf/'>pdf</a>
- </td>
+ {% if i.isfig %}
+ <a href='/k/{{ i.slug }}' class="item">
+ {{i.path}}</a>
+ </td><td type="links">
+ <a href='/k/{{ i.slug }}'>download</a>
+ {% else %}
+ <a href='/k/{{ i.slug }}' class="item">
+ {{i.path}}</a>
+ </td><td type="links">
+ <a href='/k/{{ i.slug }}/pdf/'>pdf</a>&nbsp;
+ <a href='/k/{{ i.slug }}/latex/'>latex</a>&nbsp;
+ <a href='/k/{{ i.slug }}/raw/'>raw</a>
+ {% endif %}
{% else %} {% ifequal i.type 'tree' %}
<a href='/k/{{ i.slug }}/' class="tree">
{{i.path}}/</a>
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}}</td>
<td class="filename">
{% ifequal o.type 'blob' %}
- <a href='/k/{{ o.slug }}/' class="item">
- {{o.path}}</a>
- </td><td type="links">
{% if o.isfig %}
- <a href='/k/{{ o.slug }}'>download</a>
+ <a href='/k/{{ o.slug }}' class="item">
+ {{o.path}}</a>
+ </td><td type="links">
+ <a href='/k/{{ o.slug }}/download/'>download</a>
{% else %}
+ <a href='/k/{{ o.slug }}/' class="item">
+ {{o.path}}</a>
+ </td><td type="links">
<a href='/k/{{ o.slug }}/pdf/'>pdf</a>&nbsp;
<a href='/k/{{ o.slug }}/latex/'>latex</a>&nbsp;
<a href='/k/{{ o.slug }}/raw/'>raw</a>
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<hash>[0-9a-z]{40})/$', 'view_commit',),
(r'^(?P<reqslug>[\w\-\_\/]*)/log/$', 'tree',),
(r'^(?P<reqslug>[\w\-\_\/]*)/edit/$', 'tree',),
- (r'^(?P<reqslug>[\w\-\_\/]*)/pdf/$', 'tree',),
+ (r'^(?P<reqslug>[\w\-\_\/]*)/pdf/$', 'latexitem',),
(r'^(?P<reqslug>[\w\-\_\/]*)/raw/$', 'rawitem',),
(r'^(?P<reqslug>[\w\-\_\/]*)/latex/$', 'latexitem',),
(r'^(?P<reqslug>[\w\-\_\/]*\.png/?)$', 'figure',),
(r'^(?P<reqslug>[\w\-\_\/]*\.gif/?)$', 'figure',),
(r'^(?P<reqslug>[\w\-\_\/]*\.jpg/?)$', 'figure',),
(r'^(?P<reqslug>[\w\-\_\/]*\.jpeg/?)$', 'figure',),
+ (r'^(?P<reqslug>[\w\-\_\/]*\.svg/?)$', 'figure',),
+ (r'^(?P<reqslug>[\w\-\_\/]*\.png)/download/$', 'figure',{'download':True}),
+ (r'^(?P<reqslug>[\w\-\_\/]*\.gif)/download/$', 'figure',{'download':True}),
+ (r'^(?P<reqslug>[\w\-\_\/]*\.jpg)/download/$', 'figure',{'download':True}),
+ (r'^(?P<reqslug>[\w\-\_\/]*\.jpeg)/download/$','figure',{'download':True}),
+ (r'^(?P<reqslug>[\w\-\_\/]*\.svg)/download/$', 'figure',{'download':True}),
(r'^(?P<reqslug>[\w\-\_\/]*)$', 'tree',),
)