summaryrefslogtreecommitdiff
path: root/scripts/html_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/html_base.py')
-rw-r--r--scripts/html_base.py85
1 files changed, 85 insertions, 0 deletions
diff --git a/scripts/html_base.py b/scripts/html_base.py
index 9b265ae..562d90f 100644
--- a/scripts/html_base.py
+++ b/scripts/html_base.py
@@ -8,6 +8,7 @@
import os
import base
+import view
#====================================
#
# html
@@ -209,3 +210,87 @@ class myhtml(base.base):
cnt += self.__task_commit_posted(v, up, "lore")
return (done, cnt)
+
+ #--------------------
+ # summary
+ #--------------------
+ def __summary(self, status, dir, files):
+
+ if (not len(files)):
+ return
+
+ html("h3").print(html("a", {"target":"summary",
+ "href":self.relpath("html/{}.html".format(status), dir)}).text(status))
+
+ with html("table", {"border":"1"}):
+ with html("tr"):
+ html("th").print("file")
+ html("th").print("team")
+ html("th").print("assignee")
+ html("th").print("title")
+ files.sort()
+ for file in files:
+ v = view.viewer([file])
+ v.set_data(file)
+
+ subbody = html("a", {"target":"subbody"})
+ summary = html("a", {"target":"summary"})
+ with html("tr"):
+ subbody.option({"href":self.relpath_y2h(file, dir)})
+ html("td").print(subbody.text(os.path.basename(file).replace(".yaml", "")))
+
+ team = v.get_data("team")
+ summary.option({"href":self.relpath("html/{}.html".format(team), dir)})
+ html("td").print(summary.text(team))
+
+ assignee = v.get_data("assignee")
+ if (not len(assignee)):
+ assignee = "NoAssignee"
+ summary.option({"href":self.relpath("html/{}.html".format(assignee), dir)})
+ html("td").print(summary.text(assignee))
+
+ html("td").print(v.get_data("title"))
+
+ #--------------------
+ # summary
+ #--------------------
+ def summary(self, title, dir, files):
+ # -------
+ # summary
+ # -------
+ #
+ # -------
+ if (title):
+ html("h2").print(title)
+
+ new = []
+ active = []
+ blocked = []
+ paused = []
+ done = []
+ abandoned = []
+
+ for file in files:
+ v = view.viewer([file])
+ v.set_data(file)
+
+ status = v.get_data("status")
+ if (status == "New"):
+ new.append(file)
+ elif (status == "Active"):
+ active.append(file)
+ elif (status == "Blocked"):
+ blocked.append(file)
+ elif (status == "Paused"):
+ paused.append(file)
+ elif (status == "Done"):
+ done.append(file)
+ else:
+ abandoned.append(file)
+
+ self.__summary("New", dir, new)
+ self.__summary("Active", dir, active)
+ self.__summary("Blocked", dir, blocked)
+ self.__summary("Paused", dir, paused)
+ self.__summary("Done", dir, done)
+ self.__summary("Abandoned", dir, abandoned)