From 4601bce38ed2c58999ae97cbddb95c056157b703 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 10 Dec 2019 10:47:51 +0900 Subject: css: use css at task page and some design update Signed-off-by: Kuninori Morimoto --- scripts/css | 34 ++++++++++++++++++++++++++++++++++ scripts/myhtml.py | 40 +++++++++++++++++++++++++++++++--------- wiki/css | 28 ---------------------------- 3 files changed, 65 insertions(+), 37 deletions(-) create mode 100644 scripts/css delete mode 100644 wiki/css diff --git a/scripts/css b/scripts/css new file mode 100644 index 0000000..a5f5e04 --- /dev/null +++ b/scripts/css @@ -0,0 +1,34 @@ +h1 { + color: #364e96; + border: solid 3px #364e96; + padding: 0.5em; + border-radius: 25px 0px 0px 25px; + background: linear-gradient(transparent 20%, #aaddff 80%); +} + +h2 { + background: linear-gradient(transparent 20%, #a7d6ff 80%); +} + +table { + border-collapse: collapse; + border: solid 1px gray; + background-color: #fff2d9; +} + +table th { + border: solid 1px gray; + background: linear-gradient(#ffdd99,#bbaa88); + padding: 1px 0; +} + +table td { + border: solid 1px gray; +} + +pre { + background: linear-gradient(#eeffee,#88dd66); + border: solid 3px gray; + padding: 10px 10px; + border-radius: 10px; +} diff --git a/scripts/myhtml.py b/scripts/myhtml.py index ae2c4dd..f7d5349 100755 --- a/scripts/myhtml.py +++ b/scripts/myhtml.py @@ -135,6 +135,14 @@ class periject_html(base.base): def upstream_url(self, id): return "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id={}".format(id) + #-------------------- + # print_css + #-------------------- + def print_css(self, dir): + html("link", {"rel":"stylesheet", + "type":"text/css", + "href":self.relpath("scripts/css", dir)}).print() + #-------------------- # index #-------------------- @@ -254,6 +262,7 @@ class periject_html(base.base): # ------- # # ------- + self.print_css(dir) with html("body"): self.__summary(dir, self.top() + "/" + dir, find.find([dir]).get()) @@ -326,6 +335,7 @@ class periject_html(base.base): #-------------------- def menu(self): + self.print_css("html") with html("body"): html("h1").print("Wiki") self.menu_wiki() @@ -377,8 +387,8 @@ class periject_html(base.base): text = text[:hit.start()] + link + text[hit.end():] - # textile - print("") + # textile + self.print_css("html/wiki") with html("body"): print(textile.textile(text)) @@ -386,6 +396,7 @@ class periject_html(base.base): # body #-------------------- def body(self): + self.print_css("html") with html("body"): html("div").print("select tasks from menu") @@ -497,7 +508,7 @@ class periject_html(base.base): commit = upstream[item] with html("tr"): - html("td").print(item) + html("th").print(item) html("td").print(html("a", {"href":self.upstream_url(commit), "target":"subbody"}).text(self.git_title(commit))) @@ -572,8 +583,11 @@ class periject_html(base.base): v = view.viewer([argv[0]]) v.set_data(argv[0]) + dir = os.path.dirname(argv[0].replace("projects", "html")) + + self.print_css(dir) with html("body"): - html("h1").print(v.get_data("title")) + html("h2").print(v.get_data("title")) self.task_head(v) self.task_commit(v) self.task_comment(v) @@ -584,9 +598,11 @@ class periject_html(base.base): def member(self, argv): mem = argv.pop(0) + dir = "{}/html".format(self.top()) + self.print_css(dir) with html("body"): - self.__summary(mem, "{}/html".format(self.top()), argv) + self.__summary(mem, dir, argv) #-------------------- # status @@ -594,9 +610,11 @@ class periject_html(base.base): def status(self, argv): argv.pop(0) + dir = "{}/html".format(self.top()) + self.print_css(dir) with html("body"): - self.__summary(None, "{}/html".format(self.top()), argv) + self.__summary(None, dir, argv) #-------------------- # team @@ -604,9 +622,11 @@ class periject_html(base.base): def team(self, argv): team = argv.pop(0) + dir = "{}/html".format(self.top()) + self.print_css(dir) with html("body"): - self.__summary(team, "{}/html".format(self.top()), argv) + self.__summary(team, dir, argv) #-------------------- # bsp @@ -620,8 +640,10 @@ class periject_html(base.base): cnt_all = 0 cnt_done= 0 tmp = 0 + + self.print_css("html") with html("body"): - html("h1").print("BSP patch list") + html("h2").print("BSP patch list") with html("table", {"border":"1"}): with html("tr"): @@ -641,7 +663,7 @@ class periject_html(base.base): with html("tr"): a.option({"href": self.relpath_y2h(file, "{}/html".format(self.top()))}) - html("td").print("{}
({})".format( + html("th").print("{}
({})".format( a.text(os.path.basename(file).replace(".yaml", "")), v.get_data("status"))) diff --git a/wiki/css b/wiki/css deleted file mode 100644 index e4f5cf0..0000000 --- a/wiki/css +++ /dev/null @@ -1,28 +0,0 @@ -h1 { - background-color: #bbffff; -} - -h2 { - background-color: #ddffff; -} - - -table { - border-collapse: collapse; - border: solid 1px gray; - background-color: #fff2d9; -} - -table th { - background-color: #ffdd99; - border: solid 1px gray; -} - -table td { - border: solid 1px gray; -} - -pre { - background-color: #e5ffe5; - border: solid 1px gray; -} \ No newline at end of file -- cgit v1.2.3