You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2017/06/19 12:31:32 UTC

[48/50] [abbrv] sling-site git commit: Refactor table headers

Refactor table headers


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/40e6bed4
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/40e6bed4
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/40e6bed4

Branch: refs/heads/master
Commit: 40e6bed44a76a89b2ad714f3fa12196563d8bb26
Parents: 0d2542b
Author: Bertrand Delacretaz <bd...@apache.org>
Authored: Fri Jun 16 16:37:29 2017 -0400
Committer: Bertrand Delacretaz <bd...@apache.org>
Committed: Fri Jun 16 16:37:29 2017 -0400

----------------------------------------------------------------------
 templates/downloads.tpl | 47 ++++++++++++++------------------------------
 1 file changed, 15 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sling-site/blob/40e6bed4/templates/downloads.tpl
----------------------------------------------------------------------
diff --git a/templates/downloads.tpl b/templates/downloads.tpl
index e4483f8..89fa3e0 100644
--- a/templates/downloads.tpl
+++ b/templates/downloads.tpl
@@ -251,6 +251,17 @@ def downloadLink(label, artifact, version, suffix) {
 	yield ")"
 }
 
+def tableHead(String [] headers) {
+	thead() {
+		tr() {
+			headers.each { header ->
+				th(header)
+			}
+		}
+	}
+	
+}
+
  // ------------------------------------------------------------------------------------------------
 // Downloads page layout
 // ------------------------------------------------------------------------------------------------
@@ -268,14 +279,7 @@ layout 'layout/main.tpl', true,
 						
 						h2("Sling Application")
 						table(class:"table") {
-							thead() {
-								tr() {
-									th("Artifact")
-									th("Version")
-									th("Provides")
-									th("Package")
-								}
-							}
+							tableHead("Artifact", "Version", "Provides", "Package")
 							tbody() {
 								slingApplication.each { line -> 
 									tr() {
@@ -294,14 +298,7 @@ layout 'layout/main.tpl', true,
 						
 						h2("Sling IDE Tooling")
 						table(class:"table") {
-							thead() {
-								tr() {
-									th("Artifact")
-									th("Version")
-									th("Provides")
-									th("Update site")
-								}
-							}
+							tableHead("Artifact", "Version", "Provides", "Update Site")
 							tbody() {
 								slingIDETooling.each { line ->
 									tr() {
@@ -320,14 +317,7 @@ layout 'layout/main.tpl', true,
 						
 						h2("Sling Components")
 						table(class:"table") {
-							thead() {
-								tr() {
-									th("Artifact")
-									th("Version")
-									th("Binary")
-									th("Source")
-								}
-							}
+							tableHead("Artifact", "Version", "Binary", "Source")
 							tbody() {
 								bundles.each { line ->
 									tr() {
@@ -349,14 +339,7 @@ layout 'layout/main.tpl', true,
 						
 						h2("Maven Plugins")
 						table(class:"table") {
-							thead() {
-								tr() {
-									th("Artifact")
-									th("Version")
-									th("Binary")
-									th("Source")
-								}
-							}
+							tableHead("Artifact", "Version", "Binary", "Source")
 							tbody() {
 								mavenPlugins.each { line ->
 									tr() {