diff options
author | Valerie R Young <spectranaut@riseup.net> | 2016-07-19 18:29:01 -0400 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-07-24 11:46:03 -0400 |
commit | d5182ed952f11ff7452f9d3c420a5d42595e197a (patch) | |
tree | 63cfb440e080f9ae52b52bfc9a6a63092aaa70b8 | |
parent | d93ae1f0c54527fdf5f1fc26ac582e51b6dff965 (diff) | |
download | jenkins.debian.net-d5182ed952f11ff7452f9d3c420a5d42595e197a.tar.xz |
reproducible debian: add collapsible sections to pkgset navigation
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | bin/reproducible_common.py | 3 | ||||
-rwxr-xr-x | bin/reproducible_html_pkg_sets.py | 29 | ||||
-rw-r--r-- | bin/templates/pkgset_details.mustache | 21 | ||||
-rw-r--r-- | bin/templates/pkgset_navigation.mustache | 38 | ||||
-rw-r--r-- | userContent/reproducible/static/style.css | 8 |
5 files changed, 66 insertions, 33 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 7566e78d..1c2df8ea 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -83,11 +83,12 @@ DEBIAN_DASHBOARD_URI = '/debian/reproducible.html' JENKINS_URL = 'https://jenkins.debian.net' # global package set definitions +# META_PKGSET[pkgset_id] = (pkgset_name, pkgset_group) # csv file columns: (pkgset_id, pkgset_group, pkgset_name) META_PKGSET = {} with open(os.path.join(BIN_PATH, './meta_pkgset.csv'), newline='') as f: for line in csv.reader(f): - META_PKGSET[int(line[0])] = line[2] + META_PKGSET[int(line[0])] = (line[2], line[1]) parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group() diff --git a/bin/reproducible_html_pkg_sets.py b/bin/reproducible_html_pkg_sets.py index dbdca135..c38370af 100755 --- a/bin/reproducible_html_pkg_sets.py +++ b/bin/reproducible_html_pkg_sets.py @@ -17,6 +17,7 @@ import csv import time import sqlite3 import pystache +from collections import OrderedDict # Templates used for creating package pages renderer = pystache.Renderer() @@ -114,30 +115,34 @@ def update_stats(suite, arch, stats, pkgset_name): def create_pkgset_navigation(suite, arch, view=None): - context = { - 'package_sets': [], - 'suite': suite, - 'arch': arch, - } - + # Group the package sets by section + sections = OrderedDict() for index in range(1, len(META_PKGSET)+1): - pkgset_name = META_PKGSET[index] + pkgset_name = META_PKGSET[index][0] + pkgset_section = META_PKGSET[index][1] pkgset = { 'class': "active" if pkgset_name == view else "", 'pkgset_name': pkgset_name, } - thumb_file, thumb_href = stats_thumb_file_href(suite, arch, pkgset_name) # if the graph image doesn't exist, don't include it in the context if os.access(thumb_file, os.R_OK): pkgset['thumb'] = thumb_href - context['package_sets'].append(pkgset) + # add the package set to the appropriate section + sections.setdefault(pkgset_section, []).append(pkgset) + context = { + 'suite': suite, + 'arch': arch, + 'pkgset_page': True if view else False + } + context['package_set_sections'] = \ + [{'section': s, 'pkgsets': sections[s]} for s in sections] return renderer.render(pkgset_navigation_template, context) def create_index_page(suite, arch): - title = 'Package sets in %s/%s for Reproducible Builds' % (suite, arch) + title = 'Package sets in %s/%s' % (suite, arch) body = create_pkgset_navigation(suite, arch) destfile = os.path.join(DEBIAN_BASE, suite, arch, "index_pkg_sets.html") @@ -242,7 +247,7 @@ def create_pkgset_page_and_graphs(suite, arch, stats, pkgset_name): pkgset_context['status_details'].append(details_context) html_body += renderer.render(pkgset_details_template, pkgset_context) - title = 'Reproducible Builds %s package set for %s/%s for' % \ + title = '%s package set for %s/%s' % \ (pkgset_name, suite, arch) page = "pkg_set_" + pkgset_name + ".html" destfile = os.path.join(DEBIAN_BASE, suite, arch, page) @@ -298,7 +303,7 @@ for arch in ARCHS: continue create_index_page(suite, arch) for index in META_PKGSET: - pkgset_name = META_PKGSET[index] + pkgset_name = META_PKGSET[index][0] stats = gather_meta_stats(suite, arch, pkgset_name) if (stats): update_stats(suite, arch, stats, pkgset_name) diff --git a/bin/templates/pkgset_details.mustache b/bin/templates/pkgset_details.mustache index e767118b..d29576a2 100644 --- a/bin/templates/pkgset_details.mustache +++ b/bin/templates/pkgset_details.mustache @@ -1,17 +1,20 @@ <p> {{#png}} - <a href="{{png}}"><img src="{{png}}" class="overview" alt="package set {{pkgset_name}} in {{suite}}/{{arch}}"></a>" -{{/png}} - + <a href="{{png}}"> + <img src="{{png}}" class="overview" + title="Package set {{pkgset_name}} in {{suite}}/{{arch}}. (To switch suite and arch, see top left.)" + alt="package set {{pkgset_name}} in {{suite}}/{{arch}}"> + </a>" + {{/png}} <br /> - The package set '{{pkgset_name}}' in {{suite}}/{{arch}} consists of: - (see this package set on {{#other_archs}}<a href="{{link}}" title="See this packageset in unstable/{{arch}}">{{arch}}</a> -{{/other_archs}}) - + The package set <span class="highlight">{{pkgset_name}}</span> in + <span class="highlight">{{suite}}/{{arch}}</span> consists of: <br /> {{#status_details}} - {{{icon_html}}} {{status_count}} ({{status_percent}}%) packages {{description}}: {{{package_list_html}}} + {{{icon_html}}} {{status_count}} ({{status_percent}}%) packages + {{description}}: + {{{package_list_html}}} <br /> {{/status_details}} {{{pkg_symbol_legend_html}}} -</op> +</p> diff --git a/bin/templates/pkgset_navigation.mustache b/bin/templates/pkgset_navigation.mustache index 40d19c18..81ee3386 100644 --- a/bin/templates/pkgset_navigation.mustache +++ b/bin/templates/pkgset_navigation.mustache @@ -1,14 +1,30 @@ -<ul> - <li>Tracked package sets in {{suite}}/{{arch}}: </li> -<br/> -{{#package_sets}} +<ul><li> + <a href="/debian/{{suite}}/{{arch}}/index_pkg_sets.html" + title="To switch suite and arch, see top left"> + All tracked package sets for <b>{{suite}}/{{arch}}</b> + </a> +</li></ul> +{{#package_set_sections}} +<details {{^pkgset_page}}open{{/pkgset_page}}> + <summary>{{section}} package sets:</summary> + <ul class="pkgset-list"> + {{#pkgsets}} <li class="{{class}}"> - <a href="/debian/{{suite}}/{{arch}}/pkg_set_{{pkgset_name}}.html">{{pkgset_name}}</a> - {{#thumb}} - <a href="/debian/{{suite}}/{{arch}}/pkg_set_{{pkgset_name}}.html"> - <img src="{{thumb}}" class="setview" alt="Reproducibility status for packages un {{suite}}/{{arch}} from '{{pkg_name}}'" title="{{pkgset_name}}" name="{{pkgset_name}}"> - </a> - {{/thumb}} + <a href="/debian/{{suite}}/{{arch}}/pkg_set_{{pkgset_name}}.html"> + {{pkgset_name}} + </a> + {{#thumb}} + <a href="/debian/{{suite}}/{{arch}}/pkg_set_{{pkgset_name}}.html"> + <img src="{{thumb}}" class="setview" + alt="Reproducibility status for packages in {{suite}}/{{arch}} from '{{pkg_name}}'" + title="{{pkgset_name}}" name="{{pkgset_name}}"> + </a> + {{/thumb}} </li> -{{/package_sets}} + {{/pkgsets}} </ul> +</details> +{{/package_set_sections}} +{{#pkgset_page}} +<hr id="footer_separator" /> +{{/pkgset_page}} diff --git a/userContent/reproducible/static/style.css b/userContent/reproducible/static/style.css index 5637ee7d..bdc0e755 100644 --- a/userContent/reproducible/static/style.css +++ b/userContent/reproducible/static/style.css @@ -116,6 +116,10 @@ a.package:visited, a.noted:visited { background-color: #bfeaff; } +span.highlight { + color: #d70a53; + font-weight: bold; +} ul.new-menu { border-top: 1px solid #eee; @@ -133,6 +137,10 @@ ul.reproducible-links li a { padding: 0; } +ul.pkgset-list { + margin: 0.5em; +} + header { border-bottom: 1px solid #d70a53; } |