From 1625cd31c334b017688a8c30631ddad60fafd8f4 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 18 May 2012 19:57:40 -0500 Subject: Link to provides/conflicts/replacements if we can in details template Use the newly implemented get_best_satisfier() method that is in the abstract base class for all of these types. Signed-off-by: Dan McGee --- templates/packages/details.html | 12 ++++++------ templates/packages/details_relatedto.html | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 templates/packages/details_relatedto.html diff --git a/templates/packages/details.html b/templates/packages/details.html index 4cb6032e..358ab525 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -120,22 +120,22 @@ {% endif %}{% endwith %} - {% with pkg.provides.all as provides %}{% if provides %} + {% with pkg.provides.all as all_related %}{% if all_related %} Provides: - {{ provides|join:", " }} + {% include "packages/details_relatedto.html" %} {% endif %}{% endwith %} - {% with pkg.conflicts.all as conflicts %}{% if conflicts %} + {% with pkg.conflicts.all as all_related %}{% if all_related %} Conflicts: - {{ conflicts|join:", " }} + {% include "packages/details_relatedto.html" %} {% endif %}{% endwith %} - {% with pkg.replaces.all as replaces %}{% if replaces %} + {% with pkg.replaces.all as all_related %}{% if all_related %} Replaces: - {{ replaces|join:", " }} + {% include "packages/details_relatedto.html" %} {% endif %}{% endwith %} diff --git a/templates/packages/details_relatedto.html b/templates/packages/details_relatedto.html new file mode 100644 index 00000000..1ffe2884 --- /dev/null +++ b/templates/packages/details_relatedto.html @@ -0,0 +1,10 @@ +{% load package_extras %} +{% for related in all_related %} +{% with related.get_best_satisfier as best_satisfier %} +{% ifequal best_satisfier None %} +{{ related.name }}{{ related.comparison|default:"" }}{{ related.version|default:"" }}{% if not forloop.last %}, {% endif %} +{% else %} +{% pkg_details_link best_satisfier %}{{ related.comparison|default:"" }}{{related.version|default:"" }}{% if not forloop.last %}, {% endif %} +{% endifequal %} +{% endwith %} +{% endfor %} -- cgit v1.2.3-55-g3dc8