summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-02-27 10:31:55 -0600
committerDan McGee <dan@archlinux.org>2010-02-27 13:36:58 -0600
commit7e1e5a5e8a2f3231d0878612508aba06f4397024 (patch)
treea8524109a7681c29d5bbeabbc03b8e706876457f
parent1c073bea62ce854448d15bac05362ec8ecba763e (diff)
files: template reuse
Get rid of the copy/paste by including the sub-template. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--packages/views.py2
-rw-r--r--templates/packages/files-list.html (renamed from templates/packages/files-ajax.html)0
-rw-r--r--templates/packages/files.html9
3 files changed, 2 insertions, 9 deletions
diff --git a/packages/views.py b/packages/views.py
index e95d4a2b..8a2b4ec3 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -186,7 +186,7 @@ def files(request, name='', repo='', arch=''):
files = PackageFile.objects.filter(pkg=pkg).order_by('path')
template = 'packages/files.html'
if request.is_ajax():
- template = 'packages/files-ajax.html'
+ template = 'packages/files-list.html'
return render_to_response(template, RequestContext(request, {'pkg':pkg,'files':files}))
@permission_required('main.change_package')
diff --git a/templates/packages/files-ajax.html b/templates/packages/files-list.html
index 9b4c83ad..9b4c83ad 100644
--- a/templates/packages/files-ajax.html
+++ b/templates/packages/files-list.html
diff --git a/templates/packages/files.html b/templates/packages/files.html
index dc0c64b7..1d87246c 100644
--- a/templates/packages/files.html
+++ b/templates/packages/files.html
@@ -3,14 +3,7 @@
{% block content %}
<div class="box">
<h2 class="title">{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}</h2>
- <div class="listing">
- <h4>Files:</h4>
- <ul style="font-size:small;list-style:none">
- {% for file in files %}
- <li>{{ file.path }}</li>
- {% endfor %}
- </ul>
- </div>
+ {% include "packages/files-list.html" %}
</div>
{% endblock %}