diff options
author | Dan McGee <dan@archlinux.org> | 2010-01-31 23:43:48 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-01-31 23:43:48 +0100 |
commit | 48ee2c28a20e8808f282dfbd62b7909a2a89b105 (patch) | |
tree | 353fdbab6d4b73918259b4a7817aa75de511c472 /templates/packages | |
parent | 382d36f4bfb5855bbe6154324229d1e2de447f62 (diff) | |
download | archweb-48ee2c28a20e8808f282dfbd62b7909a2a89b105.tar.gz archweb-48ee2c28a20e8808f282dfbd62b7909a2a89b105.tar.xz |
Touch up the depends and requiredby display in package details
This started out as a validation fix for the W3 validator: we had some <ul/>
elements that ended up on that page with no inner <li/> elements, so it was
invalid markup. I then realized we don't need to call the methods multiple
times so use the 'with' template tag.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/packages')
-rw-r--r-- | templates/packages/details.html | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/templates/packages/details.html b/templates/packages/details.html index 3729255..ca0bf49 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -60,10 +60,12 @@ <table width="100%"> <tr> <td valign="top" width="50%"> + {% with pkg.get_depends as deps %} <div class="listing"> - <h4>Dependencies ({{pkg.get_depends|length}}):</h4> + <h4>Dependencies ({{deps|length}}):</h4> + {% if deps %} <ul style="font-size:small;list-style:none"> - {% for depend in pkg.get_depends %} + {% for depend in deps %} {% ifequal depend.pkg None %} <li>{{ depend.dep.depname }} (virtual)</li> {% else %} @@ -71,17 +73,23 @@ {% endifequal %} {% endfor %} </ul> + {% endif %} </div> + {% endwith %} </td> <td valign="top"> + {% with pkg.get_requiredby as rqdby %} <div class="listing"> - <h4>Required By ({{pkg.get_requiredby|length}}):</h4> + <h4>Required By ({{rqdby|length}}):</h4> + {% if rqdby %} <ul style="font-size:small;list-style:none"> - {% for req in pkg.get_requiredby %} + {% for req in rqdby %} <li><a href="{{req.get_absolute_url}}">{{ req.pkgname }}{% ifequal req.repo.name "Testing" %} (testing){% endifequal %}{% ifequal req.repo.name "Unstable" %} (unstable){% endifequal %}</a></li> {% endfor %} </ul> + {% endif %} </div> + {% endwith %} </td> </tr> </table> |