summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/views.py7
-rw-r--r--templates/packages/files-list.html6
2 files changed, 10 insertions, 3 deletions
diff --git a/packages/views.py b/packages/views.py
index 486fb94..7b8c2e6 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -290,11 +290,14 @@ def files(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
fileslist = PackageFile.objects.filter(pkg=pkg).order_by('directory', 'filename')
+ context = {
+ 'pkg': pkg,
+ 'files': fileslist,
+ }
template = 'packages/files.html'
if request.is_ajax():
template = 'packages/files-list.html'
- return direct_to_template(request, template,
- {'pkg':pkg, 'files':fileslist})
+ return direct_to_template(request, template, context)
def details_json(request, name, repo, arch):
pkg = get_object_or_404(Package,
diff --git a/templates/packages/files-list.html b/templates/packages/files-list.html
index bb89b66..95a85d2 100644
--- a/templates/packages/files-list.html
+++ b/templates/packages/files-list.html
@@ -2,12 +2,16 @@
<p class="message">Note: This file list was generated from a previous version
of the package; it may be out of date.</p>
{% endif %}
-{% if files.count %}
+{% if pkg.files_last_update %}
+{% if files|length %}
<ul>
{% for file in files %}
<li>{{ file.directory }}{{ file.filename|default:'' }}</li>
{% endfor %}
</ul>
{% else %}
+<p class="message">Package has no files.</p>
+{% endif %}
+{% else %}
<p class="message">No file list available.</p>
{% endif %}