Hello world,

Attached is a couple of small additions to koji's web code to allow customising 
the headers/footer a little more (headers are good to customise for linking 
back to the main site or secondary koji instances; footers are good to 
customise for web analytics :)

The approach I'm using is just to allow the admin to add a couple of files with 
custom HTML that get automatically included when they're present -- it's a bit 
kludgy, but from what I can tell overriding the header/footer Cheetah templates 
more directly would require some fairly in depth changes to the way koji does 
templating.

Any thoughts on whether this is plausible to go in koji proper, or if there's a 
better way to do it? :)

Cheers,
aj (a newbie in Red Hat release engineering, and even newbie-er in Fedora :)

-- 
Anthony Towns <[email protected]>
From 8549e5f579fb0f5c262e0deec1b559eac9b94d46 Mon Sep 17 00:00:00 2001
From: Anthony Towns <[email protected]>
Date: Tue, 15 Mar 2011 13:50:39 +1000
Subject: [PATCH] import additional local nav/footer code

---
 www/kojiweb/includes/footer.chtml |    6 ++++++
 www/kojiweb/includes/header.chtml |    5 +++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/www/kojiweb/includes/footer.chtml b/www/kojiweb/includes/footer.chtml
index c82a643..4ed3b85 100644
--- a/www/kojiweb/includes/footer.chtml
+++ b/www/kojiweb/includes/footer.chtml
@@ -5,6 +5,12 @@
           <a href="https://fedorahosted.org/koji/";><img src="/koji-static/images/powered-by-koji.png" alt="Powered By Koji" id="PoweredByKojiLogo"/></a>
         </p>
 
+#set $localfooterpath="/usr/share/koji-web/local/extra-footer.html"
+#if os.path.exists($localfooterpath)
+#set $localfooter="".join(open($localfooterpath).readlines())
+$localfooter
+#end if
+
       </div>
     </div>
 
diff --git a/www/kojiweb/includes/header.chtml b/www/kojiweb/includes/header.chtml
index 42948e2..a320483 100644
--- a/www/kojiweb/includes/header.chtml
+++ b/www/kojiweb/includes/header.chtml
@@ -46,6 +46,11 @@
         <!-- HEADER -->
         <div id="header">
           <img src="/koji-static/images/koji.png" alt="Koji Logo" id="kojiLogo"/>
+#set $localnavpath="/usr/share/koji-web/local/extra-nav.html"
+#if os.path.exists($localnavpath)
+#set $localnav="".join(open($localnavpath).readlines())
+$localnav
+#end if
           <form action="search" id="headerSearch">
             <input type="hidden" name="match" value="glob"/>
             <select name="type">
-- 
1.7.4

--
buildsys mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/buildsys

Reply via email to