From 173f8d8942cd3e41a3117e6b9c4da45f045ccb07 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Thu, 21 Jul 2022 15:40:38 +0200 Subject: give table rows a hover color, differentiate between logs and raw logs --- base.css | 6 ++++++ src/ui.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/base.css b/base.css index 0a3c994..400fecf 100644 --- a/base.css +++ b/base.css @@ -3,6 +3,7 @@ --content-even-color: #FFFFFF; --content-odd-color: #F5F5F5; + --content-hover-color: #DFDFDF; --content-in-progress-content: ''; --content-in-progress-color: orange; @@ -62,6 +63,7 @@ table { text-align: left; } + .content tbody tr:nth-child(even) { background-color: var(--content-even-color); } @@ -70,6 +72,10 @@ table { background-color: var(--content-odd-color); } +.content tbody tr:hover { + background-color: var(--content-hover-color); +} + .content a:hover { color: blue; } diff --git a/src/ui.c b/src/ui.c index 53ef358..027e5de 100644 --- a/src/ui.c +++ b/src/ui.c @@ -23,11 +23,29 @@ void print_html() { if (context.extra) { - printf(CONTENT_TYPE_FORMAT, TEXT_PLAIN); - printf("%s", current_build->log); + if (!strcmp(context.extra, "raw_log")) + { + printf(CONTENT_TYPE_FORMAT, TEXT_PLAIN); + printf("%s", current_build->log); + } + else if (!strcmp(context.extra, "log")) + { + printf(CONTENT_TYPE_FORMAT, TEXT_HTML); + print_head(); + printf( + "
%s
", + current_build->log + ); + } + else + { + printf(CONTENT_TYPE_FORMAT, TEXT_PLAIN); + printf("Invalid path"); + } + } else - { + { printf(CONTENT_TYPE_FORMAT, TEXT_HTML); printf(HTML_START); print_head(); @@ -45,7 +63,7 @@ void print_html() printf(CONTENT_TYPE_FORMAT, TEXT_HTML); printf(HTML_START); - print_head(); + print_head(); printf(HTML_END); } else @@ -54,7 +72,7 @@ void print_html() printf(HTML_START); print_head(); print_title(); - print_build_nav(); + print_build_nav(); print_build_trigger(); printf(HTML_END); } @@ -192,7 +210,7 @@ void print_build_info() "" "Log" "" - "Raw" + "Raw" "" "" "