summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2014-10-19 11:14:26 -0500
committerDan McGee <dan@archlinux.org>2014-10-19 11:14:26 -0500
commit9589a7eadeb05e82c2d63f6fe128316fdb6dcc8a (patch)
tree885425a13442c8c747fcf5c987330c96777c73d0
parente16ae46a2f1f84f0841f175fa14a8a858f3b3cd1 (diff)
Convert package files view to Jinja2release_2014-10-19
This is another one we spend a lot of time rendering, and packges like sage-mathematics with 80,000+ files can really make the Django template engine grind. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--templates/packages/files.html2
-rw-r--r--templates/packages/files_list.html.jinja (renamed from templates/packages/files_list.html)2
2 files changed, 2 insertions, 2 deletions
diff --git a/templates/packages/files.html b/templates/packages/files.html
index 3e718ed0..879fcbff 100644
--- a/templates/packages/files.html
+++ b/templates/packages/files.html
@@ -9,7 +9,7 @@
<p>Package has {{ files_count }} file{{ files_count|pluralize }} and {{ dir_count }} director{{ dir_count|pluralize:"y,ies" }}.</p>
<p><a href="{{ pkg.get_absolute_url }}">Back to Package</a></p>
<div id="metadata"><div id="pkgfilelist">
- {% include "packages/files_list.html" %}
+ {% include "packages/files_list.html.jinja" %}
</div></div>
</div>
diff --git a/templates/packages/files_list.html b/templates/packages/files_list.html.jinja
index 93a2c847..c8fc3b1a 100644
--- a/templates/packages/files_list.html
+++ b/templates/packages/files_list.html.jinja
@@ -6,7 +6,7 @@ of the package; it may be out of date.</p>
{% if files|length %}
<ul>
{% for file in files %}
-<li class="{% if file.is_directory %}d{% else %}f{% endif %}">{{ file.directory }}{{ file.filename|default:'' }}</li>{% endfor %}
+<li class="{% if file.is_directory %}d{% else %}f{% endif %}">{{ file.directory }}{{ file.filename|default('') }}</li>{% endfor %}
</ul>
{% else %}
<p class="message">Package has no files.</p>