-rw-r--r-- | cgit.c | 13 | ||||
-rw-r--r-- | cgit.css | 98 | ||||
-rw-r--r-- | ui-diff.c | 1 | ||||
-rw-r--r-- | ui-log.c | 1 | ||||
-rw-r--r-- | ui-repolist.c | 1 | ||||
-rw-r--r-- | ui-shared.c | 37 | ||||
-rw-r--r-- | ui-summary.c | 6 | ||||
-rw-r--r-- | ui-tree.c | 1 | ||||
-rw-r--r-- | ui-view.c | 1 |
9 files changed, 127 insertions, 32 deletions
@@ -90,7 +90,16 @@ static void cgit_print_repo_page(struct cacheitem *item) show_search = 1; + cgit_print_docstart(title, item); - cgit_print_pageheader(title, show_search); + + if (!cgit_query_page) { + cgit_print_pageheader("summary", show_search); cgit_print_summary(); - } else if (!strcmp(cgit_query_page, "log")) { + cgit_print_docend(); + return; + } + + cgit_print_pageheader(cgit_query_page, show_search); + + if (!strcmp(cgit_query_page, "log")) { cgit_print_log(cgit_query_head, cgit_query_ofs, 100, @@ -12,3 +12,9 @@ h2 { font-weight: bold; - margin-bottom: 0.5em; + margin-bottom: 0.25em; +} + +h3 { + margin-top: 0em; + font-size: 100%; + font-weight: normal; } @@ -28,2 +34,3 @@ table.list { } + table.list tr { @@ -31,2 +38,3 @@ table.list tr { } + table.list tr:hover { @@ -34,2 +42,3 @@ table.list tr:hover { } + table.list tr.nohover:hover { @@ -37,2 +46,3 @@ table.list tr.nohover:hover { } + table.list th { @@ -43,2 +53,3 @@ table.list th { } + table.list td { @@ -47,2 +58,3 @@ table.list td { } + img { @@ -50,25 +62,67 @@ img { } + table#layout { width: 100%; - border-collapse: collapse; + border-collapse: separate; + border-spacing: 0px; margin: 0px; } -td#header { + +td#header, td#logo { + color: #666; background-color: #ddd; - padding: 0.25em 0.25em 0.25em 0.5em; + border-bottom: solid 1px #000; +} + +td#header { font-size: 150%; font-weight: bold; - border-bottom: solid 1px #aaa; + padding: 0.2em 0.5em; + vertical-align: text-bottom; +} + +td#logo { + text-align: right; vertical-align: middle; + padding-right: 0.5em; +} + +td#crumb, td#search { + color: #ccc; + border-top: solid 3px #555; + background-color: #666; + border-bottom: solid 1px #333; + padding: 2px 1em; +} + +td#crumb { + font-weight: bold; +} + +td#crumb a { + color: #ccc; } -td#header img#logo { - float: right; + +td#crumb a:hover { + color: #eee; } -td#header input { - float: right; - margin: 0.25em 1em; +td#search { + text-align: right; + vertical-align: center; + padding-right: 0.5em; } -td#header a { - color: black; + +td#search form { + margin: 0px; + padding: 0px; +} + +td#search input { + font-size: 9pt; + padding: 0px; + width: 10em; + border: solid 1px #333; + color: #333; + background-color: #fff; } @@ -88,2 +142,3 @@ div.error { } + div.ls-blob, div.ls-dir { @@ -91,2 +146,3 @@ div.ls-blob, div.ls-dir { } + div.ls-dir a { @@ -94,2 +150,3 @@ div.ls-dir a { } + th.filesize, td.filesize { @@ -97,2 +154,3 @@ th.filesize, td.filesize { } + td.filesize { @@ -100,2 +158,3 @@ td.filesize { } + td.filemode { @@ -118,2 +177,3 @@ table.commit-info { } + table.commit-info th { @@ -123,2 +183,3 @@ table.commit-info th { } + table.commit-info td { @@ -127,2 +188,3 @@ table.commit-info td { } + div.commit-subject { @@ -133,2 +195,3 @@ div.commit-subject { } + div.commit-msg { @@ -137,2 +200,3 @@ div.commit-msg { } + table.diffstat { @@ -141,2 +205,3 @@ table.diffstat { } + table.diffstat th { @@ -148,2 +213,3 @@ table.diffstat th { } + table.diffstat td { @@ -152,2 +218,3 @@ table.diffstat td { } + table.diffstat td span.modechange { @@ -156,2 +223,3 @@ table.diffstat td span.modechange { } + table.diffstat td.add a { @@ -159,2 +227,3 @@ table.diffstat td.add a { } + table.diffstat td.del a { @@ -162,2 +231,3 @@ table.diffstat td.del a { } + table.diffstat td.upd a { @@ -165,4 +235,4 @@ table.diffstat td.upd a { } + table.diffstat td.summary { - /* border-top: solid 1px black; */ color: #888; @@ -193,2 +263,3 @@ table.diff td div.del { } + .left { @@ -196,2 +267,3 @@ table.diff td div.del { } + .right { @@ -126,3 +126,2 @@ void cgit_print_diff(const char *old_hex, const char *new_hex) - html("<h2>diff</h2>\n"); html("<table class='diff'><tr><td>"); @@ -56,3 +56,2 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) - html("<h2>Log</h2>"); html("<table class='list nowrap'>"); diff --git a/ui-repolist.c b/ui-repolist.c index 011ec95..2ce0d6a 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -18,3 +18,2 @@ void cgit_print_repolist(struct cacheitem *item) - html("<h2>Repositories</h2>\n"); html("<table class='list nowrap'>"); diff --git a/ui-shared.c b/ui-shared.c index 172499c..bca50aa 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -42,2 +42,10 @@ void cgit_print_error(char *msg) +char *cgit_rooturl() +{ + if (cgit_virtual_root) + return fmt("%s/", cgit_virtual_root); + else + return "./cgit.cgi"; +} + char *cgit_repourl(const char *reponame) @@ -115,6 +123,19 @@ void cgit_print_pageheader(char *title, int show_search) { - html("<table id='layout'><tr><td id='header'>"); - htmlf("<a href='%s'>", cgit_logo_link); - htmlf("<img id='logo' src='%s'/>\n", cgit_logo); - htmlf("</a>"); + html("<table id='layout'>"); + html("<tr><td id='header'>"); + html(cgit_root_title); + html("</td><td id='logo'>"); + html("<a href='"); + html_attr(cgit_logo_link); + htmlf("'><img src='%s'/></a>", cgit_logo); + html("</td></tr>"); + html("<tr><td id='crumb'>"); + htmlf("<a href='%s'>root</a>", cgit_rooturl()); + if (cgit_query_repo) { + htmlf(" : <a href='%s'>", cgit_repourl(cgit_repo->url)); + html_txt(cgit_repo->name); + htmlf("</a> : %s", title); + } + html("</td>"); + html("<td id='search'>"); if (show_search) { @@ -139,8 +160,4 @@ void cgit_print_pageheader(char *title, int show_search) } - if (cgit_query_repo) - htmlf("<a href='%s'>", cgit_repourl(cgit_query_repo)); - html_txt(title); - if (cgit_query_repo) - html("</a>"); - html("</td></tr><tr><td id='content'>"); + html("</td></tr>"); + html("<tr><td id='content' colspan='2'>"); } diff --git a/ui-summary.c b/ui-summary.c index ff3ed4d..42f4300 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -131,4 +131,6 @@ void cgit_print_summary() html("<h2>"); - html_txt("Repo summary page"); - html("</h2>"); + html(cgit_repo->name); + html("</h2><h3>"); + html(cgit_repo->desc); + html("</h3>"); html("<table class='list nowrap'>"); @@ -68,3 +68,2 @@ void cgit_print_tree(const char *hex, char *path) - html("<h2>Tree content</h2>\n"); html_txt(path); @@ -34,3 +34,2 @@ void cgit_print_view(const char *hex) buf[size] = '\0'; - html("<h2>Object content</h2>\n"); html("<table class='list'>\n"); |