From c51ffa07fc46eeab001b1e71ebc0cee1d408aaea Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 4 Aug 2012 15:28:53 -0500 Subject: Adjust depends & required by templates to spew less whitespace Use the spaceless tag and structure the {% if %} blocks smartly so spaceless actually works and we aren't outputting one blank line per if statement. Signed-off-by: Dan McGee --- templates/packages/details_depend.html | 28 ++++++++++++---------------- templates/packages/details_requiredby.html | 17 ++++++++--------- 2 files changed, 20 insertions(+), 25 deletions(-) (limited to 'templates/packages') diff --git a/templates/packages/details_depend.html b/templates/packages/details_depend.html index a26d67b..420af93 100644 --- a/templates/packages/details_depend.html +++ b/templates/packages/details_depend.html @@ -1,18 +1,14 @@ -{% load package_extras %} -
  • +{% load package_extras %}{% spaceless %}
  • {% ifequal depend.pkg None %} -{% if depend.providers %} -{{ depend.dep.name }}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} ({% multi_pkg_details depend.providers %}) -{% else %} -{{ depend.dep.name }}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} (virtual) -{% endif %} -{% else %} +{% if depend.providers %}{{ depend.dep.name }}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} ({% multi_pkg_details depend.providers %}) +{% else %}{{ depend.dep.name }}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} (virtual) +{% endif %}{% else %} {% pkg_details_link depend.pkg %}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} -{% if depend.pkg.repo.testing %} (testing){% endif %} -{% if depend.pkg.repo.staging %} (staging){% endif %} -{% endifequal %} -{% if depend.dep.deptype == 'O' %} (optional){% endif %} -{% if depend.dep.deptype == 'M' %} (make){% endif %} -{% if depend.dep.deptype == 'C' %} (check){% endif %} -{% if depend.dep.description %}- {{ depend.dep.description }}{% endif %} -
  • +{% if depend.pkg.repo.testing %} (testing) +{% endif %}{% if depend.pkg.repo.staging %} (staging) +{% endif %}{% endifequal %} +{% if depend.dep.deptype == 'O' %} (optional) +{% endif %}{% if depend.dep.deptype == 'M' %} (make) +{% endif %}{% if depend.dep.deptype == 'C' %} (check) +{% endif %}{% if depend.dep.description %}- {{ depend.dep.description }} +{% endif %}{% endspaceless %} diff --git a/templates/packages/details_requiredby.html b/templates/packages/details_requiredby.html index 24f8bbb..f498bd5 100644 --- a/templates/packages/details_requiredby.html +++ b/templates/packages/details_requiredby.html @@ -1,9 +1,8 @@ -{% load package_extras %} -
  • {% pkg_details_link req.pkg %} -{% if req.name != pkg.pkgname %}(requires {{ req.name }}){% endif %} -{% if req.pkg.repo.testing %}(testing){% endif %} -{% if req.pkg.repo.staging %}(staging){% endif %} -{% if req.deptype == 'O' %}(optional){% endif %} -{% if req.deptype == 'M' %}(make){% endif %} -{% if req.deptype == 'C' %}(check){% endif %} -
  • +{% load package_extras %}{% spaceless %}
  • {% pkg_details_link req.pkg %} +{% if req.name != pkg.pkgname %}(requires {{ req.name }}) +{% endif %}{% if req.pkg.repo.testing %}(testing) +{% endif %}{% if req.pkg.repo.staging %}(staging) +{% endif %}{% if req.deptype == 'O' %}(optional) +{% endif %}{% if req.deptype == 'M' %}(make) +{% endif %}{% if req.deptype == 'C' %}(check) +{% endif %}
  • {% endspaceless %} -- cgit v1.2.3-24-g4f1b