clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1090581 - /incubator/clerezza/site/trunk/src/main/scala/HeadedPageRenderlet.scala
Date Sat, 09 Apr 2011 12:52:26 GMT
Author: reto
Date: Sat Apr  9 12:52:25 2011
New Revision: 1090581

URL: http://svn.apache.org/viewvc?rev=1090581&view=rev
Log:
CLEREZZA-491: setting css-class to selected page

Modified:
    incubator/clerezza/site/trunk/src/main/scala/HeadedPageRenderlet.scala

Modified: incubator/clerezza/site/trunk/src/main/scala/HeadedPageRenderlet.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/site/trunk/src/main/scala/HeadedPageRenderlet.scala?rev=1090581&r1=1090580&r2=1090581&view=diff
==============================================================================
--- incubator/clerezza/site/trunk/src/main/scala/HeadedPageRenderlet.scala (original)
+++ incubator/clerezza/site/trunk/src/main/scala/HeadedPageRenderlet.scala Sat Apr  9 12:52:25
2011
@@ -22,13 +22,19 @@ class HeadedPageRenderlet extends SRende
 
 	override def renderedPage(arguments: XmlResult.Arguments) = {
 		new XmlResult(arguments) {
+			def menuLink(href: String, label: String) =
+			if ((res*).endsWith(href) || (res*).endsWith(href+"index")) {
+				 <a href={href} class="active">{label}</a>
+			} else {
+				 <a href={href}>{label}</a>
+			}
 			override def content = {
 				<html xmlns="http://www.w3.org/1999/xhtml">
 					<head>
 						<link type="text/css" href="/style/style.css" rel="stylesheet" />
 						{(res/DISCOBITS.contains).find(e => ((e/DISCOBITS.pos*) == "0")) match {
 								case Some(e) => <title>{render(e/DISCOBITS.holds, "naked")}</title>
-								case None => <title>An incomplite titled content {res/DISCOBITS.contains*}</title>
+								case None => <title>An incomplete titled content {res/DISCOBITS.contains*}</title>
 							}
 						}
 					</head>
@@ -45,18 +51,18 @@ class HeadedPageRenderlet extends SRende
 								<li class="top-nav-entry"><div class="title">Documentation</div>
 
 									<ul class="nav-entries">
-										<li><a href="/getting-started/">Getting Started</a></li>
-										<li><a href="/architecture/">The Apache Clerezza Stack</a></li>
+										<li>{menuLink("/getting-started/","Getting Started")}</li>
+										<li>{menuLink("/architecture/","The Apache Clerezza Stack")}</li>
 										<li><a href="http://incubator.apache.org/clerezza/mvn-site" target="_blank">API
docs</a></li>
-										<li><a href="/faq/">FAQ</a></li>
+										<li>{menuLink("/faq/","FAQ")}</li>
 									</ul>
 								</li>
 
 								<li class="top-nav-entry"><div class="title">Project Infos</div>
 									<ul  class="nav-entries">
-										<li><a href="/downloads/">Downloads</a></li>
+										<li>{menuLink("/downloads/","Downloads")}</li>
 										<li><a href="http://www.apache.org/licenses/" target="_blank">License</a></li>
-										<li><a href="/mailinglists/">Mailing lists</a></li>
+										<li>{menuLink("/mailinglists/","Mailing lists")}</li>
 										<li><a href="http://issues.apache.org/jira/browse/CLEREZZA" target="_blank">Issue
Tracker</a></li>
 
 										<li><a href="http://svn.apache.org/viewvc/incubator/clerezza/trunk/" target="_blank">Source
Repository</a></li>



Mime
View raw message