summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_packages.py
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-07-26 18:44:20 -0400
committerHolger Levsen <holger@layer-acht.org>2016-07-28 14:06:25 -0400
commit28e9066f2f5269c65a6936bebc3ba1e8cc0cfb2f (patch)
treedd569b74d8b931772601f1c9a30671a69893be47 /bin/reproducible_html_packages.py
parentf159c2dca7d3ef0ccccd55de9f1fda9e9047038c (diff)
downloadjenkins.debian.net-28e9066f2f5269c65a6936bebc3ba1e8cc0cfb2f.tar.xz
reproducible debian: breakout package page navigation into seperate template
Decoupling the mainbody and left navigation for package pages allows us to dry up some of the logic and css between package pages and all other pages that have a left navigation. Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_html_packages.py')
-rwxr-xr-xbin/reproducible_html_packages.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index e7a9d989..b058827f 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -18,6 +18,8 @@ apt_pkg.init_system()
renderer = pystache.Renderer();
package_page_template = renderer.load_template(
os.path.join(TEMPLATE_PATH, 'package_page'))
+package_navigation_template = renderer.load_template(
+ os.path.join(TEMPLATE_PATH, 'package_navigation'))
suitearch_section_template = renderer.load_template(
os.path.join(TEMPLATE_PATH, 'package_suitearch_section'))
suitearch_details_template = renderer.load_template(
@@ -296,7 +298,7 @@ def gen_packages_html(packages, no_clean=False):
history = '{}/{}.html'.format(HISTORY_URI, pkg)
project_links = renderer.render(project_links_template)
- html = renderer.render(package_page_template, {
+ navigation_html = renderer.render(package_navigation_template, {
'package': pkg,
'suite': suite,
'arch': arch,
@@ -306,18 +308,22 @@ def gen_packages_html(packages, no_clean=False):
'notify_maintainer': package.notify_maint,
'suitearch_section_html': suitearch_section_html,
'project_links_html': project_links,
- 'default_view': default_view,
'reproducible': reproducible,
'dashboard_url': DEBIAN_URL,
})
+ body_html = renderer.render(package_page_template, {
+ 'default_view': default_view,
+ })
+
destfile = RB_PKG_PATH + '/' + suite + '/' + arch + '/' + \
pkg + '.html'
desturl = REPRODUCIBLE_URL + RB_PKG_URI + '/' + suite + \
'/' + arch + '/' + pkg + '.html'
title = pkg + ' - reproducible builds result'
- write_html_page(title=title, body=html, destfile=destfile,
- no_header=True, noendpage=True)
+ write_html_page(title=title, body=body_html, destfile=destfile,
+ no_header=True, noendpage=True,
+ left_nav_html=navigation_html)
log.debug("Package page generated at " + desturl)
if not no_clean:
purge_old_pages() # housekeep is always good