diff themes/bulma/theme.js @ 30:43333d18e4b8

scid: document theme
author David Demelier <markand@malikania.fr>
date Thu, 04 Aug 2022 14:54:43 +0200
parents 695637f1d8a7
children 081e1c258e64
line wrap: on
line diff
--- a/themes/bulma/theme.js	Thu Aug 04 14:13:58 2022 +0200
+++ b/themes/bulma/theme.js	Thu Aug 04 14:54:43 2022 +0200
@@ -1,28 +1,40 @@
-function updateProject(project)
-{
-	for (var j = 0; j < project.jobs.length; ++j) {
-		if (project.jobs[j].status === "success")
-			project.jobs[j].classname = "is-success";
-		else
-			project.jobs[j].classname = "is-danger";
-	}
-}
+/*
+ * theme.js -- scid bulma theme
+ *
+ * Copyright (c) 2021 David Demelier <markand@malikania.fr>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
 
 function onPageIndex(rdr, data)
 {
 	Scid.render(rdr, "header.mustache", {
-		title: "index page"
+		title: "sci -- index page"
 	});
 
 	/*
 	 * Add is-danger/is-success for every job depending on their success
 	 * status, this is required to show the appropriate tag.
 	 */
-	for (var i = 0; i < data.projects.length; ++i)
-		updateProject(data.projects[i]);
+	for (var i = 0; i < data.projects.length; ++i) {
+		for (var j = 0; j < data.projects[i].jobs.length; ++j) {
+			if (data.projects[i].jobs[j].status === "success")
+				data.projects[i].jobs[j].classname = "is-success";
+			else
+				data.projects[i].jobs[j].classname = "is-danger";
+		}
+	}
 
-	Scid.print("RENDERING THIS");
-	Scid.print(JSON.stringify(data));
 	Scid.render(rdr, "index.mustache", data);
 	Scid.render(rdr, "footer.mustache");
 }