[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible debian: mark active page in navigation (misses the .py part)

Holger Levsen holger at layer-acht.org
Sat May 14 17:26:32 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 7871b3fb126d13cacc4d0c91844f0e5846cb0357
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sat May 14 19:25:51 2016 +0200

    reproducible debian: mark active page in navigation (misses the .py part)
---
 bin/reproducible_common.sh                | 25 ++++++++++++++++++++-----
 bin/reproducible_html_dashboard.sh        |  4 ++--
 bin/reproducible_html_pkg_sets.sh         | 13 ++++++++++---
 userContent/reproducible/static/style.css |  6 ++++++
 4 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 57fb10b..695fef9 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -214,7 +214,9 @@ write_page_header() {
 	fi
 	write_page "<ul class=\"menu\">"
 	write_page "<li>$SUITE/$ARCH:<ul class=\"children\">"
+	local CLASS=""
 	for TARGET in $ALLVIEWS ; do
+		CLASS=""
 		if [ "$TARGET" = "pkg_sets" ] && [ "$SUITE" = "experimental" ] ; then
 			# no pkg_sets are tested in experimental
 			continue
@@ -246,20 +248,33 @@ write_page_header() {
 		elif [ "$TARGET" = "arch" ] ; then
 			write_page "<li>Architectures:<ul class=\"children\"><li>"
 			for i in ${ARCHS} ; do
-				write_page " <a href=\"/$SUITE/index_suite_${i}_stats.html\">$i</a>"
+				if [ "$1" = "suite_arch_stats" ] && [ "$i" = "$ARCH" ] ; then
+					CLASS=" class=\"active\""
+				fi
+				write_page " <a href=\"/$SUITE/index_suite_${i}_stats.html\"$CLASS>$i</a>"
+				CLASS=""
 			done
 			write_page "</li>"
 		elif [ "$TARGET" = "suite_stats" ] ; then
 			write_page "<li>Suites:<ul class=\"children\"><li>"
 			for i in $SUITES ; do
-				write_page " <a href=\"/$i/index_suite_${ARCH}_stats.html\">$i</a>"
+				if [ "$1" = "suite_arch_stats" ] && [ "$i" = "$SUITE" ] ; then
+					CLASS=" class=\"active\""
+				fi
+				write_page " <a href=\"/$i/index_suite_${ARCH}_stats.html\"$CLASS>$i</a>"
+				CLASS=""
 			done
 			write_page "</li>"
 		elif [ "$TARGET" = "dashboard" ] ; then
-			write_page "<li><a href=\"$BASEURL/index_${TARGET}.html\">${SPOKEN_TARGET}</a><ul class=\"children\">"
+			if [ "$1" = "dashboard" ] ; then
+				CLASS=" class=\"active\""
+			fi
+			write_page "<li><a href=\"$BASEURL/index_${TARGET}.html\"$CLASS>${SPOKEN_TARGET}</a><ul class=\"children\">"
 		else
-			# finally, write link
-			write_page "<li><a href=\"$BASEURL/index_${TARGET}.html\">${SPOKEN_TARGET}</a></li>"
+			if [ "$1" = "$TARGET" ] ; then
+				CLASS=" class=\"active\""
+			fi
+			write_page "<li><a href=\"$BASEURL/index_${TARGET}.html\"$CLASS>${SPOKEN_TARGET}</a></li>"
 		fi
 		# close unsorted lists (and package states loop)
 		if [ "$TARGET" = "all_abc" ] ; then
diff --git a/bin/reproducible_html_dashboard.sh b/bin/reproducible_html_dashboard.sh
index 6a7b01e..b0b0768 100755
--- a/bin/reproducible_html_dashboard.sh
+++ b/bin/reproducible_html_dashboard.sh
@@ -373,8 +373,8 @@ write_suite_arch_table() {
 # create suite stats page
 #
 create_suite_arch_stats_page() {
-	VIEW=suite_${ARCH}_stats
-	PAGE=index_${VIEW}.html
+	VIEW=suite_arch_stats
+	PAGE=index_suite_${ARCH}_stats.html
 	MAINLABEL[0]="Reproducibility status for packages in '$SUITE' for '$ARCH'"
 	MAINLABEL[2]="Age in days of oldest reproducible build result in '$SUITE' for '$ARCH'"
 	echo "$(date -u) - starting to write $PAGE page."
diff --git a/bin/reproducible_html_pkg_sets.sh b/bin/reproducible_html_pkg_sets.sh
index 1b246d6..8a24547 100755
--- a/bin/reproducible_html_pkg_sets.sh
+++ b/bin/reproducible_html_pkg_sets.sh
@@ -90,6 +90,8 @@ update_meta_pkg_stats() {
 #
 create_pkg_sets_navigation() {
 	local i
+	local view=$1
+	local CLASS=""
 	write_page "<ul><li>Tracked package sets in $SUITE/$ARCH: </li>"
 	write_page "<br />"
 	for i in $(seq 1 ${#META_PKGSET[@]}) ; do
@@ -98,11 +100,16 @@ create_pkg_sets_navigation() {
 				;;
 			*)	;;
 		esac
+		if [ "$i" = "$view" ] ; then
+			CLASS=" class=\"active\""
+		else
+			CLASS=""
+		fi
 		if [ -f $BASE/$SUITE/$ARCH/${TABLE[6]}_${META_PKGSET[$i]}.png ] ; then
 			THUMB="${TABLE[6]}_${META_PKGSET[$i]}-thumbnail.png"
 			LABEL="Reproducibility status for packages in $SUITE/$ARCH from '${META_PKGSET[$i]}'"
 			write_page "<li>"
-			write_page "<a href=\"/$SUITE/$ARCH/pkg_set_${META_PKGSET[$i]}.html\">${META_PKGSET[$i]}</a>"
+			write_page "<a href=\"/$SUITE/$ARCH/pkg_set_${META_PKGSET[$i]}.html\"$CLASS>${META_PKGSET[$i]}</a>"
 			write_page "<a href=\"/$SUITE/$ARCH/pkg_set_${META_PKGSET[$i]}.html\"><img src=\"/userContent/$SUITE/$ARCH/$THUMB\" class=\"setview\" alt=\"$LABEL\" title=\"${META_PKGSET[$i]}\" name=\"${META_PKGSET[$i]}\"></a>"
 			write_page "</li>"
 		fi
@@ -121,7 +128,7 @@ create_pkg_sets_pages() {
 	PAGE=index_${VIEW}.html
 	echo "$(date -u) - starting to write $PAGE page."
 	write_page_header $VIEW "Overview about reproducible builds of specific package sets in $SUITE/$ARCH"
-	create_pkg_sets_navigation
+	create_pkg_sets_navigation index
 	write_page_footer
 	publish_page $SUITE/$ARCH
 	#
@@ -132,7 +139,7 @@ create_pkg_sets_pages() {
 		PAGE="pkg_set_${META_PKGSET[$i]}.html"
 		echo "$(date -u) - starting to write $PAGE page."
 		write_page_header $VIEW "Overview about reproducible builds for the ${META_PKGSET[$i]} package set in $SUITE/$ARCH"
-		create_pkg_sets_navigation
+		create_pkg_sets_navigation $i
 		write_page "<hr />"
 		META_RESULT=true
 		gather_meta_stats $i
diff --git a/userContent/reproducible/static/style.css b/userContent/reproducible/static/style.css
index 4d882d1..e2e0f3b 100644
--- a/userContent/reproducible/static/style.css
+++ b/userContent/reproducible/static/style.css
@@ -116,6 +116,7 @@ ul.menu {
 	background-color: #bfeaff;
 }
 
+
 ul.reproducible-links {
 	margin-top: 1em;
 	border-top: 1px solid #eee;
@@ -165,6 +166,11 @@ ul li {
 	display: inline-block;
 }
 
+.active {
+	background-color: #bfeaff;
+}
+
+
 h1 {
 	font-size : 250%;
 	padding: 0;

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