[Qa-jenkins-scm] [jenkins.debian.net] 04/08: reproducible debian: add template for default footer

Holger Levsen holger at layer-acht.org
Tue Jul 5 15:25:11 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 ee75142772ff7ad5a147bd4cc6aecdf6f0f13a1c
Author: Valerie R Young <spectranaut at riseup.net>
Date:   Sat Jun 25 06:47:18 2016 -0400

    reproducible debian: add template for default footer
    
    [ Mattia Rizzolo ]
    wrap and indent lines in default_page_footer.mustache
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_common.py                 | 29 +++++++++++------------------
 bin/reproducible_common.sh                 |  1 +
 bin/templates/default_page_footer.mustache | 16 ++++++++++++++++
 3 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 8738a50..c3ea23f 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -143,6 +143,9 @@ tab = '  '
 renderer = pystache.Renderer();
 status_icon_link_template = renderer.load_template(
     TEMPLATE_PATH + '/status_icon_link')
+default_page_footer_template = renderer.load_template(
+    TEMPLATE_PATH + '/default_page_footer')
+
 
 html_header = Template("""<!DOCTYPE html>
 <html>
@@ -165,23 +168,12 @@ else:
     JOB_FOOTER += JOB_NAME+'</a> which is configured via this '
     JOB_FOOTER += '<a href="https://anonscm.debian.org/git/qa/jenkins.debian.net.git/">git repo</a>.'
 
-html_footer = Template("""
-      <hr id="footer_separator" /><p style="font-size:0.9em;"><div id="page_footer">
-      %s
-      There is more information <a href="%s/userContent/about.html">about
-      jenkins.debian.net</a> and about
-      <a href="https://wiki.debian.org/ReproducibleBuilds"> reproducible builds
-      of Debian</a> available elsewhere.
-      <br /> Last update: $date.
-      Copyright 2014-2016 <a href="mailto:holger at layer-acht.org">Holger Levsen</a>
-      and <a href="https://jenkins.debian.net//userContent/thanks.html">many others</a>.
-      The code of <a href="https://anonscm.debian.org/git/qa/jenkins.debian.net.git/">jenkins.debian.net.git</a> is mostly
-      GPL-2 licensed. The weather icons are public domain and have been taken
-      from the <a href=http://tango.freedesktop.org/Tango_Icon_Library target=_blank>
-      Tango Icon Library</a>.
-     </p>
-  </div></body>
-</html>""" % (JOB_FOOTER, JENKINS_URL))
+def create_default_page_footer(date):
+    return renderer.render(default_page_footer_template, {
+            'date': date,
+            'job_footer': JOB_FOOTER,
+            'jenkins_url': JENKINS_URL,
+        })
 
 html_head_page = Template((tab*2).join(("""
 <header class="head">
@@ -391,7 +383,8 @@ def write_html_page(title, body, destfile, suite=defaultsuite, arch=defaultarch,
     if style_note:
         html += html_foot_page_style_note.substitute()
     if not noendpage:
-        html += html_footer.substitute(date=now)
+        html += create_default_page_footer(now)
+        html += '</body>\n</html>'
     else:
         html += '</body>\n</html>'
     try:
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 8b382c2..9a6b865 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -367,6 +367,7 @@ write_page_intro() {
 	fi
 }
 
+# See the python equivelent of this function: reproducible_common.py's create_default_page_footer
 write_page_footer() {
 	write_page "<hr id=\"footer_separator\" /><p style=\"font-size:0.9em;\"><div id=\"page_footer\">"
 	if [ -n "$JOB_URL" ] ; then
diff --git a/bin/templates/default_page_footer.mustache b/bin/templates/default_page_footer.mustache
new file mode 100644
index 0000000..1a8c46c
--- /dev/null
+++ b/bin/templates/default_page_footer.mustache
@@ -0,0 +1,16 @@
+<hr id="footer_separator" />
+<p style="font-size:0.9em;">
+  <div id="page_footer">
+    {{job_footer}}
+    There is more information
+    <a href="{{jenkins_url}}/userContent/about.html">about jenkins.debian.net</a>
+    and about <a href="https://wiki.debian.org/ReproducibleBuilds"> reproducible builds of Debian</a>
+    available elsewhere.
+    <br /> Last update: {{date}}
+    <br /> Copyright 2014-2016 <a href="mailto:holger at layer-acht.org">Holger Levsen</a>
+    and <a href="https://jenkins.debian.net//userContent/thanks.html">many others</a>.
+    The code of <a href="https://anonscm.debian.org/git/qa/jenkins.debian.net.git/">jenkins.debian.net.git</a>
+    is mostly GPL-2 licensed. The weather icons are public domain and have been taken from the
+    <a href=http://tango.freedesktop.org/Tango_Icon_Library target=_blank> Tango Icon Library</a>.
+  </div>
+</p>

-- 
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