From d657beb8211fdfe146019a22198694dfc194d3ad Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Wed, 3 Aug 2016 16:07:45 -0400 Subject: reproducible debian: remove suite or arch nav when not relevent for page Signed-off-by: Holger Levsen --- bin/reproducible_common.py | 59 +++++++++++----------- .../reproducible/main_navigation.mustache | 4 ++ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index a149c85e..eeb4ffb6 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -260,38 +260,33 @@ def gen_suite_arch_nav_context(suite, arch, suite_arch_nav_template=None, no_arch=None): # if a template is not passed in to navigate between suite and archs the # current page, we use the "default" suite/arch summary view. - # OR if there is not suite equivalent for this page, use the default - # for suite links. default_nav_template = '/debian/{{suite}}/index_suite_{{arch}}_stats.html' - uri_template = suite_arch_nav_template - if not uri_template or no_suite: - uri_template = default_nav_template + if not suite_arch_nav_template: + suite_arch_nav_template = default_nav_template + suite_list = [] - for s in SUITES: - include_suite = True - if s == 'experimental' and ignore_experimental: - include_suite = False - suite_list.append({ - 's': s, - 'class': 'current' if s == suite and not no_suite else '', - 'uri': renderer.render(uri_template, - {'suite': s, 'arch': arch}) - if include_suite else '', - }) + if not no_suite: + for s in SUITES: + include_suite = True + if s == 'experimental' and ignore_experimental: + include_suite = False + suite_list.append({ + 's': s, + 'class': 'current' if s == suite else '', + 'uri': renderer.render(suite_arch_nav_template, + {'suite': s, 'arch': arch}) + if include_suite else '', + }) - # if there is no arch equivalents for this page, use the default - # for arch links. - uri_template = suite_arch_nav_template - if not uri_template or no_arch: - uri_template = default_nav_template arch_list = [] - for a in ARCHS: - arch_list.append({ - 'a': a, - 'class': 'current' if a == arch and not no_arch else '', - 'uri': renderer.render(uri_template, - {'suite': suite, 'arch': a}), - }) + if not no_arch: + for a in ARCHS: + arch_list.append({ + 'a': a, + 'class': 'current' if a == arch else '', + 'uri': renderer.render(suite_arch_nav_template, + {'suite': suite, 'arch': a}), + }) return (suite_list, arch_list) # See bash equivelent: reproducible_common.sh's "write_page_header()" @@ -305,8 +300,12 @@ def create_main_navigation(suite=defaultsuite, arch=defaultarch, 'suite': suite, 'arch': arch, 'project_links_html': renderer.render(project_links_template), - 'suite_list': suite_list, - 'arch_list': arch_list, + 'suite_nav': { + 'suite_list': suite_list + } if len(suite_list) else '', + 'arch_nav': { + 'arch_list': arch_list + } if len(arch_list) else '', 'debian_uri': DEBIAN_DASHBOARD_URI, 'cross_suite_arch_nav': True if suite_arch_nav_template else False, } diff --git a/mustache-templates/reproducible/main_navigation.mustache b/mustache-templates/reproducible/main_navigation.mustache index 594f2e95..25fe8d8f 100644 --- a/mustache-templates/reproducible/main_navigation.mustache +++ b/mustache-templates/reproducible/main_navigation.mustache @@ -6,6 +6,7 @@ {{#cross_suite_arch_nav}}

Change suite/architecture

{{/cross_suite_arch_nav}} + {{#arch_nav}}
  • Tested architectures:
      @@ -21,6 +22,8 @@
  • + {{/arch_nav}} + {{#suite_nav}}
  • Tested suites:
    • @@ -35,6 +38,7 @@
  • + {{/suite_nav}}

    Test results statistics

  • Results for -- cgit v1.2.3-54-g00ecf