summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-06 23:34:29 -0600
committerDan McGee <dan@archlinux.org>2012-02-06 23:34:29 -0600
commit7977214c578ecde1dd6a0d99d60b83116ca3dfa9 (patch)
treedd037f7a783a392842add5880aa39af0ecd69164
parent33fe337d087126c6869b21791ff8e3ad6fe9e196 (diff)
Clean up details dependency display logic
This moves this lengthy conditional block of template into an include so it is a bit more manageable. This makes the fix for FS#28286, where provided optional dependencies were not displayed as expected. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--templates/packages/details.html48
-rw-r--r--templates/packages/details_depend.html15
2 files changed, 26 insertions, 37 deletions
diff --git a/templates/packages/details.html b/templates/packages/details.html
index 1e3a2944..f68aefa3 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -71,7 +71,7 @@
</div>
{% endif %}{% endwith %}
- </div><!-- #actionlist -->
+ </div>
{% cache 300 package-details-pkginfo pkg.id %}
<table id="pkginfo">
@@ -167,40 +167,19 @@
{% with pkg.get_depends as deps %}
<div id="pkgdeps" class="listing">
-
<h3 title="{{ pkg.pkgname }} has the following dependencies">
Dependencies ({{deps|length}})</h3>
-
- {% if deps %}
- <ul>
- {% for depend in deps %}
- {% ifequal depend.pkg None %}
- {% if depend.providers %}
- <li>{{ depend.dep.depname }} <span class="virtual-dep">({% multi_pkg_details depend.providers %})</span></li>
- {% else %}<li>{{ depend.dep.depname }} <span class="virtual-dep">(virtual)</span></li>
- {% endif %}
- {% else %}
- <li>{% pkg_details_link depend.pkg %}{{ depend.dep.depvcmp|default:"" }}
- {% if depend.pkg.repo.testing %}<span class="testing-dep">(testing)</span>{% endif %}
- {% if depend.dep.optional %}<span class="opt-dep">(optional)</span>{% endif %}
- {% if depend.dep.description %}- <span class="dep-desc">{{ depend.dep.description }}</span>{% endif %}
- </li>
- {% endifequal %}
- {% endfor %}
- </ul>
- {% endif %}
-
- </div><!-- #pkgdeps -->
+ {% if deps %}<ul>
+ {% for depend in deps %}{% include "packages/details_depend.html" %}{% endfor %}
+ </ul>{% endif %}
+ </div>
{% endwith %}
{% with pkg.get_requiredby as rqdby %}
<div id="pkgreqs" class="listing">
-
<h3 title="Packages that require {{ pkg.pkgname }}">
Required By ({{rqdby|length}})</h3>
-
- {% if rqdby %}
- <ul>
+ {% if rqdby %}<ul>
{% for req in rqdby %}
<li>{% pkg_details_link req.pkg %}
{% if req.depname != pkg.pkgname %}<span class="virtual-dep">(requires {{ req.depname }})</span>{% endif %}
@@ -208,29 +187,24 @@
{% if req.optional %}<span class="opt-dep">(optional)</span>{% endif %}
</li>
{% endfor %}
- </ul>
- {% endif %}
-
- </div><!-- #pkgreqs -->
+ </ul>{% endif %}
+ </div>
{% endwith %}
<div id="pkgfiles" class="listing">
-
<h3 title="Complete list of files contained within this package">
Package Contents</h3>
-
<div id="pkgfilelist">
<p><a id="filelink" href="files/"
title="Click to view the complete file list for {{ pkg.pkgname }}">
View the file list for {{ pkg.pkgname }}</a></p>
</div>
+ </div>
- </div><!-- #pkgfiles -->
-
- </div><!-- #metadata -->
+ </div>
{% endcache %}
-</div><!-- #pkgdetails -->
+</div>
{% load cdn %}{% jquery %}
<script type="text/javascript" src="{{ STATIC_URL }}archweb.js"></script>
diff --git a/templates/packages/details_depend.html b/templates/packages/details_depend.html
new file mode 100644
index 00000000..0226dd25
--- /dev/null
+++ b/templates/packages/details_depend.html
@@ -0,0 +1,15 @@
+{% load package_extras %}
+<li>
+{% ifequal depend.pkg None %}
+{% if depend.providers %}
+{{ depend.dep.depname }} <span class="virtual-dep">({% multi_pkg_details depend.providers %})</span>
+{% else %}
+{{ depend.dep.depname }} <span class="virtual-dep">(virtual)</span>
+{% endif %}
+{% else %}
+{% pkg_details_link depend.pkg %}{{ depend.dep.depvcmp|default:"" }}
+{% if depend.pkg.repo.testing %} <span class="testing-dep">(testing)</span>{% endif %}
+{% endifequal %}
+{% if depend.dep.optional %} <span class="opt-dep">(optional)</span>{% endif %}
+{% if depend.dep.description %}- <span class="dep-desc">{{ depend.dep.description }}</span>{% endif %}
+</li>