-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) | |||
90 | show_search = 1; | 90 | show_search = 1; |
91 | |||
91 | cgit_print_docstart(title, item); | 92 | cgit_print_docstart(title, item); |
92 | cgit_print_pageheader(title, show_search); | 93 | |
94 | |||
93 | if (!cgit_query_page) { | 95 | if (!cgit_query_page) { |
96 | cgit_print_pageheader("summary", show_search); | ||
94 | cgit_print_summary(); | 97 | cgit_print_summary(); |
95 | } else if (!strcmp(cgit_query_page, "log")) { | 98 | cgit_print_docend(); |
99 | return; | ||
100 | } | ||
101 | |||
102 | cgit_print_pageheader(cgit_query_page, show_search); | ||
103 | |||
104 | if (!strcmp(cgit_query_page, "log")) { | ||
96 | cgit_print_log(cgit_query_head, cgit_query_ofs, 100, | 105 | cgit_print_log(cgit_query_head, cgit_query_ofs, 100, |
@@ -12,3 +12,9 @@ h2 { | |||
12 | font-weight: bold; | 12 | font-weight: bold; |
13 | margin-bottom: 0.5em; | 13 | margin-bottom: 0.25em; |
14 | } | ||
15 | |||
16 | h3 { | ||
17 | margin-top: 0em; | ||
18 | font-size: 100%; | ||
19 | font-weight: normal; | ||
14 | } | 20 | } |
@@ -28,2 +34,3 @@ table.list { | |||
28 | } | 34 | } |
35 | |||
29 | table.list tr { | 36 | table.list tr { |
@@ -31,2 +38,3 @@ table.list tr { | |||
31 | } | 38 | } |
39 | |||
32 | table.list tr:hover { | 40 | table.list tr:hover { |
@@ -34,2 +42,3 @@ table.list tr:hover { | |||
34 | } | 42 | } |
43 | |||
35 | table.list tr.nohover:hover { | 44 | table.list tr.nohover:hover { |
@@ -37,2 +46,3 @@ table.list tr.nohover:hover { | |||
37 | } | 46 | } |
47 | |||
38 | table.list th { | 48 | table.list th { |
@@ -43,2 +53,3 @@ table.list th { | |||
43 | } | 53 | } |
54 | |||
44 | table.list td { | 55 | table.list td { |
@@ -47,2 +58,3 @@ table.list td { | |||
47 | } | 58 | } |
59 | |||
48 | img { | 60 | img { |
@@ -50,25 +62,67 @@ img { | |||
50 | } | 62 | } |
63 | |||
51 | table#layout { | 64 | table#layout { |
52 | width: 100%; | 65 | width: 100%; |
53 | border-collapse: collapse; | 66 | border-collapse: separate; |
67 | border-spacing: 0px; | ||
54 | margin: 0px; | 68 | margin: 0px; |
55 | } | 69 | } |
56 | td#header { | 70 | |
71 | td#header, td#logo { | ||
72 | color: #666; | ||
57 | background-color: #ddd; | 73 | background-color: #ddd; |
58 | padding: 0.25em 0.25em 0.25em 0.5em; | 74 | border-bottom: solid 1px #000; |
75 | } | ||
76 | |||
77 | td#header { | ||
59 | font-size: 150%; | 78 | font-size: 150%; |
60 | font-weight: bold; | 79 | font-weight: bold; |
61 | border-bottom: solid 1px #aaa; | 80 | padding: 0.2em 0.5em; |
81 | vertical-align: text-bottom; | ||
82 | } | ||
83 | |||
84 | td#logo { | ||
85 | text-align: right; | ||
62 | vertical-align: middle; | 86 | vertical-align: middle; |
87 | padding-right: 0.5em; | ||
88 | } | ||
89 | |||
90 | td#crumb, td#search { | ||
91 | color: #ccc; | ||
92 | border-top: solid 3px #555; | ||
93 | background-color: #666; | ||
94 | border-bottom: solid 1px #333; | ||
95 | padding: 2px 1em; | ||
96 | } | ||
97 | |||
98 | td#crumb { | ||
99 | font-weight: bold; | ||
100 | } | ||
101 | |||
102 | td#crumb a { | ||
103 | color: #ccc; | ||
63 | } | 104 | } |
64 | td#header img#logo { | 105 | |
65 | float: right; | 106 | td#crumb a:hover { |
107 | color: #eee; | ||
66 | } | 108 | } |
67 | 109 | ||
68 | td#header input { | 110 | td#search { |
69 | float: right; | 111 | text-align: right; |
70 | margin: 0.25em 1em; | 112 | vertical-align: center; |
113 | padding-right: 0.5em; | ||
71 | } | 114 | } |
72 | td#header a { | 115 | |
73 | color: black; | 116 | td#search form { |
117 | margin: 0px; | ||
118 | padding: 0px; | ||
119 | } | ||
120 | |||
121 | td#search input { | ||
122 | font-size: 9pt; | ||
123 | padding: 0px; | ||
124 | width: 10em; | ||
125 | border: solid 1px #333; | ||
126 | color: #333; | ||
127 | background-color: #fff; | ||
74 | } | 128 | } |
@@ -88,2 +142,3 @@ div.error { | |||
88 | } | 142 | } |
143 | |||
89 | div.ls-blob, div.ls-dir { | 144 | div.ls-blob, div.ls-dir { |
@@ -91,2 +146,3 @@ div.ls-blob, div.ls-dir { | |||
91 | } | 146 | } |
147 | |||
92 | div.ls-dir a { | 148 | div.ls-dir a { |
@@ -94,2 +150,3 @@ div.ls-dir a { | |||
94 | } | 150 | } |
151 | |||
95 | th.filesize, td.filesize { | 152 | th.filesize, td.filesize { |
@@ -97,2 +154,3 @@ th.filesize, td.filesize { | |||
97 | } | 154 | } |
155 | |||
98 | td.filesize { | 156 | td.filesize { |
@@ -100,2 +158,3 @@ td.filesize { | |||
100 | } | 158 | } |
159 | |||
101 | td.filemode { | 160 | td.filemode { |
@@ -118,2 +177,3 @@ table.commit-info { | |||
118 | } | 177 | } |
178 | |||
119 | table.commit-info th { | 179 | table.commit-info th { |
@@ -123,2 +183,3 @@ table.commit-info th { | |||
123 | } | 183 | } |
184 | |||
124 | table.commit-info td { | 185 | table.commit-info td { |
@@ -127,2 +188,3 @@ table.commit-info td { | |||
127 | } | 188 | } |
189 | |||
128 | div.commit-subject { | 190 | div.commit-subject { |
@@ -133,2 +195,3 @@ div.commit-subject { | |||
133 | } | 195 | } |
196 | |||
134 | div.commit-msg { | 197 | div.commit-msg { |
@@ -137,2 +200,3 @@ div.commit-msg { | |||
137 | } | 200 | } |
201 | |||
138 | table.diffstat { | 202 | table.diffstat { |
@@ -141,2 +205,3 @@ table.diffstat { | |||
141 | } | 205 | } |
206 | |||
142 | table.diffstat th { | 207 | table.diffstat th { |
@@ -148,2 +213,3 @@ table.diffstat th { | |||
148 | } | 213 | } |
214 | |||
149 | table.diffstat td { | 215 | table.diffstat td { |
@@ -152,2 +218,3 @@ table.diffstat td { | |||
152 | } | 218 | } |
219 | |||
153 | table.diffstat td span.modechange { | 220 | table.diffstat td span.modechange { |
@@ -156,2 +223,3 @@ table.diffstat td span.modechange { | |||
156 | } | 223 | } |
224 | |||
157 | table.diffstat td.add a { | 225 | table.diffstat td.add a { |
@@ -159,2 +227,3 @@ table.diffstat td.add a { | |||
159 | } | 227 | } |
228 | |||
160 | table.diffstat td.del a { | 229 | table.diffstat td.del a { |
@@ -162,2 +231,3 @@ table.diffstat td.del a { | |||
162 | } | 231 | } |
232 | |||
163 | table.diffstat td.upd a { | 233 | table.diffstat td.upd a { |
@@ -165,4 +235,4 @@ table.diffstat td.upd a { | |||
165 | } | 235 | } |
236 | |||
166 | table.diffstat td.summary { | 237 | table.diffstat td.summary { |
167 | /* border-top: solid 1px black; */ | ||
168 | color: #888; | 238 | color: #888; |
@@ -193,2 +263,3 @@ table.diff td div.del { | |||
193 | } | 263 | } |
264 | |||
194 | .left { | 265 | .left { |
@@ -196,2 +267,3 @@ table.diff td div.del { | |||
196 | } | 267 | } |
268 | |||
197 | .right { | 269 | .right { |
@@ -126,3 +126,2 @@ void cgit_print_diff(const char *old_hex, const char *new_hex) | |||
126 | 126 | ||
127 | html("<h2>diff</h2>\n"); | ||
128 | html("<table class='diff'><tr><td>"); | 127 | html("<table class='diff'><tr><td>"); |
@@ -56,3 +56,2 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) | |||
56 | 56 | ||
57 | html("<h2>Log</h2>"); | ||
58 | html("<table class='list nowrap'>"); | 57 | 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) | |||
18 | 18 | ||
19 | html("<h2>Repositories</h2>\n"); | ||
20 | html("<table class='list nowrap'>"); | 19 | 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) | |||
42 | 42 | ||
43 | char *cgit_rooturl() | ||
44 | { | ||
45 | if (cgit_virtual_root) | ||
46 | return fmt("%s/", cgit_virtual_root); | ||
47 | else | ||
48 | return "./cgit.cgi"; | ||
49 | } | ||
50 | |||
43 | char *cgit_repourl(const char *reponame) | 51 | char *cgit_repourl(const char *reponame) |
@@ -115,6 +123,19 @@ void cgit_print_pageheader(char *title, int show_search) | |||
115 | { | 123 | { |
116 | html("<table id='layout'><tr><td id='header'>"); | 124 | html("<table id='layout'>"); |
117 | htmlf("<a href='%s'>", cgit_logo_link); | 125 | html("<tr><td id='header'>"); |
118 | htmlf("<img id='logo' src='%s'/>\n", cgit_logo); | 126 | html(cgit_root_title); |
119 | htmlf("</a>"); | 127 | html("</td><td id='logo'>"); |
128 | html("<a href='"); | ||
129 | html_attr(cgit_logo_link); | ||
130 | htmlf("'><img src='%s'/></a>", cgit_logo); | ||
131 | html("</td></tr>"); | ||
132 | html("<tr><td id='crumb'>"); | ||
133 | htmlf("<a href='%s'>root</a>", cgit_rooturl()); | ||
134 | if (cgit_query_repo) { | ||
135 | htmlf(" : <a href='%s'>", cgit_repourl(cgit_repo->url)); | ||
136 | html_txt(cgit_repo->name); | ||
137 | htmlf("</a> : %s", title); | ||
138 | } | ||
139 | html("</td>"); | ||
140 | html("<td id='search'>"); | ||
120 | if (show_search) { | 141 | if (show_search) { |
@@ -139,8 +160,4 @@ void cgit_print_pageheader(char *title, int show_search) | |||
139 | } | 160 | } |
140 | if (cgit_query_repo) | 161 | html("</td></tr>"); |
141 | htmlf("<a href='%s'>", cgit_repourl(cgit_query_repo)); | 162 | html("<tr><td id='content' colspan='2'>"); |
142 | html_txt(title); | ||
143 | if (cgit_query_repo) | ||
144 | html("</a>"); | ||
145 | html("</td></tr><tr><td id='content'>"); | ||
146 | } | 163 | } |
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() | |||
131 | html("<h2>"); | 131 | html("<h2>"); |
132 | html_txt("Repo summary page"); | 132 | html(cgit_repo->name); |
133 | html("</h2>"); | 133 | html("</h2><h3>"); |
134 | html(cgit_repo->desc); | ||
135 | html("</h3>"); | ||
134 | html("<table class='list nowrap'>"); | 136 | html("<table class='list nowrap'>"); |
@@ -68,3 +68,2 @@ void cgit_print_tree(const char *hex, char *path) | |||
68 | 68 | ||
69 | html("<h2>Tree content</h2>\n"); | ||
70 | html_txt(path); | 69 | html_txt(path); |
@@ -34,3 +34,2 @@ void cgit_print_view(const char *hex) | |||
34 | buf[size] = '\0'; | 34 | buf[size] = '\0'; |
35 | html("<h2>Object content</h2>\n"); | ||
36 | html("<table class='list'>\n"); | 35 | html("<table class='list'>\n"); |