diff options
author | Valerie R Young <spectranaut@riseup.net> | 2016-08-03 16:07:45 -0400 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-08-03 22:10:23 +0200 |
commit | d657beb8211fdfe146019a22198694dfc194d3ad (patch) | |
tree | 3339e3aac01e1556bd3b4a30235bd584a7853c21 | |
parent | fa3ed47dd9da01e3e37b20457946d7e06e11ccb4 (diff) | |
download | jenkins.debian.net-d657beb8211fdfe146019a22198694dfc194d3ad.tar.xz |
reproducible debian: remove suite or arch nav when not relevent for page
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | bin/reproducible_common.py | 59 | ||||
-rw-r--r-- | mustache-templates/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}} <h4>Change suite/architecture</h4> {{/cross_suite_arch_nav}} + {{#arch_nav}} <li> Tested architectures: <ul class="children"> @@ -21,6 +22,8 @@ </li> </ul> </li> + {{/arch_nav}} + {{#suite_nav}} <li>Tested suites: <ul class="children"> <li> @@ -35,6 +38,7 @@ </li> </ul> </li> + {{/suite_nav}} <h4>Test results statistics</h4> <li {{#suite_arch_stats}}class='active'{{/suite_arch_stats}}> Results for |