[Qa-jenkins-scm] [jenkins.debian.net] 06/10: reproducible debian: breakout package page navigation into seperate template

Holger Levsen holger at layer-acht.org
Thu Jul 28 18:14:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 28e9066f2f5269c65a6936bebc3ba1e8cc0cfb2f
Author: Valerie R Young <spectranaut at riseup.net>
Date:   Tue Jul 26 18:44:20 2016 -0400

    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 at layer-acht.org>
---
 bin/reproducible_html_packages.py                  | 14 +++++--
 .../reproducible/basic_page.mustache               |  4 +-
 .../reproducible/package_navigation.mustache       | 44 +++++++++++++++++++++
 .../reproducible/package_page.mustache             | 46 ----------------------
 userContent/reproducible/static/style.css          |  1 -
 5 files changed, 56 insertions(+), 53 deletions(-)

diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index e7a9d98..b058827 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
diff --git a/mustache-templates/reproducible/basic_page.mustache b/mustache-templates/reproducible/basic_page.mustache
index f5fe038..5ba1f8d 100644
--- a/mustache-templates/reproducible/basic_page.mustache
+++ b/mustache-templates/reproducible/basic_page.mustache
@@ -16,11 +16,11 @@
       {{{navigation_html}}}
     </header>
     {{/navigation_html}}
-    {{#navigation_html}}<div class="mainbody">{{/navigation_html}}
+    <div {{#navigation_html}}class="mainbody"{{/navigation_html}}>
       {{#main_header}}
       <h2>{{main_header}}</h2>
       {{/main_header}}
       {{{main_html}}}
-    {{#navigation_html}}</div>{{/navigation_html}}
+    </div>
   </body>
 </html>
diff --git a/mustache-templates/reproducible/package_navigation.mustache b/mustache-templates/reproducible/package_navigation.mustache
new file mode 100644
index 0000000..0d579b7
--- /dev/null
+++ b/mustache-templates/reproducible/package_navigation.mustache
@@ -0,0 +1,44 @@
+<h2 class="package-name">{{package}}</h2>
+<ul class="menu">
+  <h4>Test Details
+    <a href="/debian/index_notify.html" target="_parent">
+      <span class="notification" title="Notifications for this package are enabled. Every reproducibility related status change will be emailed to the maintainers">{{notify_maintainer}}</span>
+    </a>
+  </h4>
+  {{#notes_uri}}
+  <li><a href="{{notes_uri}}" title="Additional commentary on this packages unreproduciblity" target="main">notes</a></li>
+  {{/notes_uri}}
+  {{^notes_uri}}
+  {{^reproducible}}
+  <li>No notes exist for this package. <a href="https://anonscm.debian.org/git/reproducible/notes.git/tree/README">Add some.</a></li>
+  {{/reproducible}}
+  {{#reproducible}}
+  <li>Good work! This package looks reproducible :)</li>
+  {{/reproducible}}
+  {{/notes_uri}}
+  <li>
+    <a href="{{history}}" target="main">test history</a>
+  </li>
+  <h4>Suite and Architecture</h4>
+  {{{suitearch_section_html}}}
+  <h4>General Package Details</h4>
+  <li>
+    <a href="https://tracker.debian.org/{{package}}" title="Go to: Debian Package Tracking Site">PTS</a>
+    <a href="https://bugs.debian.org/src:{{package}}" title="Go to: Debian Bug Tracking Site">BTS</a>
+  </li>
+  <li>
+    <a href="https://sources.debian.net/src/{{package}}/{{version}}/" title="Go to: the package source!">sources</a>
+    <ul class="children">
+      <li>
+        <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian">debian/</a></div>
+        <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian/changelog">debian/changelog</a></div>
+        <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian/control">debian/control</a></div>
+        <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian/rules">debian/rules</a></div>
+      </li>
+    </ul>
+  </li>
+</ul>
+<ul>
+  <li><a href="{{dashboard_url}}">Debian dashboard</a></li>
+</ul>
+{{{project_links_html}}}
diff --git a/mustache-templates/reproducible/package_page.mustache b/mustache-templates/reproducible/package_page.mustache
index 9a78300..38ca65f 100644
--- a/mustache-templates/reproducible/package_page.mustache
+++ b/mustache-templates/reproducible/package_page.mustache
@@ -1,49 +1,3 @@
-<header class="head">
-  <h2 class="package-name">{{package}}</h2>
-  <ul class="menu">
-    <h4>Test Details
-      <a href="/debian/index_notify.html" target="_parent">
-        <span class="notification" title="Notifications for this package are enabled. Every reproducibility related status change will be emailed to the maintainers">{{notify_maintainer}}</span>
-      </a>
-    </h4>
-    {{#notes_uri}}
-    <li><a href="{{notes_uri}}" title="Additional commentary on this packages unreproduciblity" target="main">notes</a></li>
-    {{/notes_uri}}
-    {{^notes_uri}}
-    {{^reproducible}}
-    <li>No notes exist for this package. <a href="https://anonscm.debian.org/git/reproducible/notes.git/tree/README">Add some.</a></li>
-    {{/reproducible}}
-    {{#reproducible}}
-    <li>Good work! This package looks reproducible :)</li>
-    {{/reproducible}}
-    {{/notes_uri}}
-    <li>
-      <a href="{{history}}" target="main">test history</a>
-    </li>
-    <h4>Suite and Architecture</h4>
-    {{{suitearch_section_html}}}
-    <h4>General Package Details</h4>
-    <li>
-      <a href="https://tracker.debian.org/{{package}}" title="Go to: Debian Package Tracking Site">PTS</a>
-      <a href="https://bugs.debian.org/src:{{package}}" title="Go to: Debian Bug Tracking Site">BTS</a>
-    </li>
-    <li>
-      <a href="https://sources.debian.net/src/{{package}}/{{version}}/" title="Go to: the package source!">sources</a>
-      <ul class="children">
-        <li>
-          <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian">debian/</a></div>
-          <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian/changelog">debian/changelog</a></div>
-          <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian/control">debian/control</a></div>
-          <div><a href="https://sources.debian.net/src/{{package}}/{{version}}/debian/rules">debian/rules</a></div>
-        </li>
-      </ul>
-    </li>
-  </ul>
-  <ul>
-    <li><a href="{{dashboard_url}}">Debian dashboard</a></li>
-  </ul>
-{{{project_links_html}}}
-</header>
 <iframe id="main" name="main" tabindex="1" src="{{default_view}}">
   <p>
     Your browser does not support iframes.
diff --git a/userContent/reproducible/static/style.css b/userContent/reproducible/static/style.css
index e45cbf5..0ef764e 100644
--- a/userContent/reproducible/static/style.css
+++ b/userContent/reproducible/static/style.css
@@ -459,7 +459,6 @@ span.dangerous { color: orange; }
 		overflow: auto;
 	}
 	iframe#main {
-		width: 80%;
 		float: right;
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list