about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLars Hjemli2007-02-17 13:46:18 +0100
committerLars Hjemli2007-02-21 00:24:36 +0100
commit66cacd053ba900c8eb3b7962027370c84a97f990 (patch)
tree9ccd8202204bf556a186ba1520a6c767756855bf
parentMake snapshot feature configurable (diff)
downloadcgit-66cacd053ba900c8eb3b7962027370c84a97f990.tar.gz
cgit-66cacd053ba900c8eb3b7962027370c84a97f990.zip
Layout update
-rw-r--r--cgit.c13
-rw-r--r--cgit.css98
-rw-r--r--ui-diff.c1
-rw-r--r--ui-log.c1
-rw-r--r--ui-repolist.c1
-rw-r--r--ui-shared.c37
-rw-r--r--ui-summary.c6
-rw-r--r--ui-tree.c1
-rw-r--r--ui-view.c1
9 files changed, 127 insertions, 32 deletions
diff --git a/cgit.c b/cgit.c index 7b7afba..fedf355 100644 --- a/cgit.c +++ b/cgit.c
@@ -88,11 +88,20 @@ static void cgit_print_repo_page(struct cacheitem *item)
88 88
89 if (cgit_query_page && !strcmp(cgit_query_page, "log")) 89 if (cgit_query_page && !strcmp(cgit_query_page, "log"))
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,
97 cgit_query_search); 106 cgit_query_search);
98 } else if (!strcmp(cgit_query_page, "tree")) { 107 } else if (!strcmp(cgit_query_page, "tree")) {
diff --git a/cgit.css b/cgit.css index 5c4b15b..640bbc9 100644 --- a/cgit.css +++ b/cgit.css
@@ -10,7 +10,13 @@ body {
10h2 { 10h2 {
11 font-size: 120%; 11 font-size: 120%;
12 font-weight: bold; 12 font-weight: bold;
13 margin-bottom: 0.5em; 13 margin-bottom: 0.25em;
14}
15
16h3 {
17 margin-top: 0em;
18 font-size: 100%;
19 font-weight: normal;
14} 20}
15 21
16a { 22a {
@@ -26,51 +32,99 @@ table.list {
26 border: none; 32 border: none;
27 border-collapse: collapse; 33 border-collapse: collapse;
28} 34}
35
29table.list tr { 36table.list tr {
30 background: white; 37 background: white;
31} 38}
39
32table.list tr:hover { 40table.list tr:hover {
33 background: #eee; 41 background: #eee;
34} 42}
43
35table.list tr.nohover:hover { 44table.list tr.nohover:hover {
36 background: white; 45 background: white;
37} 46}
47
38table.list th { 48table.list th {
39 font-weight: normal; 49 font-weight: normal;
40 border-bottom: solid 1px #777; 50 border-bottom: solid 1px #777;
41 padding: 0.1em 0.5em 0.1em 0.5em; 51 padding: 0.1em 0.5em 0.1em 0.5em;
42 vertical-align: baseline; 52 vertical-align: baseline;
43} 53}
54
44table.list td { 55table.list td {
45 border: none; 56 border: none;
46 padding: 0.1em 0.5em 0.1em 0.5em; 57 padding: 0.1em 0.5em 0.1em 0.5em;
47} 58}
59
48img { 60img {
49 border: none; 61 border: none;
50} 62}
63
51table#layout { 64table#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}
56td#header { 70
71td#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
77td#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
84td#logo {
85 text-align: right;
62 vertical-align: middle; 86 vertical-align: middle;
87 padding-right: 0.5em;
88}
89
90td#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
98td#crumb {
99 font-weight: bold;
100}
101
102td#crumb a {
103 color: #ccc;
63} 104}
64td#header img#logo { 105
65 float: right; 106td#crumb a:hover {
107 color: #eee;
66} 108}
67 109
68td#header input { 110td#search {
69 float: right; 111 text-align: right;
70 margin: 0.25em 1em; 112 vertical-align: center;
113 padding-right: 0.5em;
71} 114}
72td#header a { 115
73 color: black; 116td#search form {
117 margin: 0px;
118 padding: 0px;
119}
120
121td#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}
75 129
76td#content { 130td#content {
@@ -86,18 +140,23 @@ div.error {
86 font-weight: bold; 140 font-weight: bold;
87 margin: 1em 2em; 141 margin: 1em 2em;
88} 142}
143
89div.ls-blob, div.ls-dir { 144div.ls-blob, div.ls-dir {
90 font-family: monospace; 145 font-family: monospace;
91} 146}
147
92div.ls-dir a { 148div.ls-dir a {
93 font-weight: bold; 149 font-weight: bold;
94} 150}
151
95th.filesize, td.filesize { 152th.filesize, td.filesize {
96 text-align: right; 153 text-align: right;
97} 154}
155
98td.filesize { 156td.filesize {
99 font-family: monospace; 157 font-family: monospace;
100} 158}
159
101td.filemode { 160td.filemode {
102 font-family: monospace; 161 font-family: monospace;
103} 162}
@@ -116,29 +175,35 @@ table.commit-info {
116 border-collapse: collapse; 175 border-collapse: collapse;
117 margin-top: 1.5em; 176 margin-top: 1.5em;
118} 177}
178
119table.commit-info th { 179table.commit-info th {
120 text-align: left; 180 text-align: left;
121 font-weight: normal; 181 font-weight: normal;
122 padding: 0.1em 1em 0.1em 0.1em; 182 padding: 0.1em 1em 0.1em 0.1em;
123} 183}
184
124table.commit-info td { 185table.commit-info td {
125 font-weight: normal; 186 font-weight: normal;
126 padding: 0.1em 1em 0.1em 0.1em; 187 padding: 0.1em 1em 0.1em 0.1em;
127} 188}
189
128div.commit-subject { 190div.commit-subject {
129 font-weight: bold; 191 font-weight: bold;
130 font-size: 125%; 192 font-size: 125%;
131 margin: 1.5em 0em 0.5em 0em; 193 margin: 1.5em 0em 0.5em 0em;
132 padding: 0em; 194 padding: 0em;
133} 195}
196
134div.commit-msg { 197div.commit-msg {
135 white-space: pre; 198 white-space: pre;
136 font-family: monospace; 199 font-family: monospace;
137} 200}
201
138table.diffstat { 202table.diffstat {
139 border-collapse: collapse; 203 border-collapse: collapse;
140 margin-top: 1.5em; 204 margin-top: 1.5em;
141} 205}
206
142table.diffstat th { 207table.diffstat th {
143 font-weight: normal; 208 font-weight: normal;
144 text-align: left; 209 text-align: left;
@@ -146,25 +211,30 @@ table.diffstat th {
146 padding: 0.1em 1em 0.1em 0.1em; 211 padding: 0.1em 1em 0.1em 0.1em;
147 font-size: 100%; 212 font-size: 100%;
148} 213}
214
149table.diffstat td { 215table.diffstat td {
150 padding: 0.1em 1em 0.1em 0.1em; 216 padding: 0.1em 1em 0.1em 0.1em;
151 font-size: 100%; 217 font-size: 100%;
152} 218}
219
153table.diffstat td span.modechange { 220table.diffstat td span.modechange {
154 padding-left: 1em; 221 padding-left: 1em;
155 color: red; 222 color: red;
156} 223}
224
157table.diffstat td.add a { 225table.diffstat td.add a {
158 color: green; 226 color: green;
159} 227}
228
160table.diffstat td.del a { 229table.diffstat td.del a {
161 color: red; 230 color: red;
162} 231}
232
163table.diffstat td.upd a { 233table.diffstat td.upd a {
164 color: blue; 234 color: blue;
165} 235}
236
166table.diffstat td.summary { 237table.diffstat td.summary {
167 /* border-top: solid 1px black; */
168 color: #888; 238 color: #888;
169 padding-top: 0.5em; 239 padding-top: 0.5em;
170} 240}
@@ -191,9 +261,11 @@ table.diff td div.del {
191 font-family: courier; 261 font-family: courier;
192 font-size: 90%; 262 font-size: 90%;
193} 263}
264
194.left { 265.left {
195 text-align: left; 266 text-align: left;
196} 267}
268
197.right { 269.right {
198 text-align: right; 270 text-align: right;
199} 271}
diff --git a/ui-diff.c b/ui-diff.c index 0bd9ade..b6486f1 100644 --- a/ui-diff.c +++ b/ui-diff.c
@@ -124,7 +124,6 @@ void cgit_print_diff(const char *old_hex, const char *new_hex)
124 get_sha1(old_hex, sha1); 124 get_sha1(old_hex, sha1);
125 get_sha1(new_hex, sha2); 125 get_sha1(new_hex, sha2);
126 126
127 html("<h2>diff</h2>\n");
128 html("<table class='diff'><tr><td>"); 127 html("<table class='diff'><tr><td>");
129 run_diff(sha1, sha2); 128 run_diff(sha1, sha2);
130 html("</td></tr></table>"); 129 html("</td></tr></table>");
diff --git a/ui-log.c b/ui-log.c index 24d571d..159393a 100644 --- a/ui-log.c +++ b/ui-log.c
@@ -54,7 +54,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep)
54 } 54 }
55 prepare_revision_walk(&rev); 55 prepare_revision_walk(&rev);
56 56
57 html("<h2>Log</h2>");
58 html("<table class='list nowrap'>"); 57 html("<table class='list nowrap'>");
59 html("<tr class='nohover'><th class='left'>Date</th>" 58 html("<tr class='nohover'><th class='left'>Date</th>"
60 "<th class='left'>Message</th>" 59 "<th class='left'>Message</th>"
diff --git a/ui-repolist.c b/ui-repolist.c index 011ec95..2ce0d6a 100644 --- a/ui-repolist.c +++ b/ui-repolist.c
@@ -16,7 +16,6 @@ void cgit_print_repolist(struct cacheitem *item)
16 cgit_print_docstart(cgit_root_title, item); 16 cgit_print_docstart(cgit_root_title, item);
17 cgit_print_pageheader(cgit_root_title, 0); 17 cgit_print_pageheader(cgit_root_title, 0);
18 18
19 html("<h2>Repositories</h2>\n");
20 html("<table class='list nowrap'>"); 19 html("<table class='list nowrap'>");
21 html("<tr class='nohover'>" 20 html("<tr class='nohover'>"
22 "<th class='left'>Name</th>" 21 "<th class='left'>Name</th>"
diff --git a/ui-shared.c b/ui-shared.c index 172499c..bca50aa 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -40,6 +40,14 @@ void cgit_print_error(char *msg)
40 html("</div>\n"); 40 html("</div>\n");
41} 41}
42 42
43char *cgit_rooturl()
44{
45 if (cgit_virtual_root)
46 return fmt("%s/", cgit_virtual_root);
47 else
48 return "./cgit.cgi";
49}
50
43char *cgit_repourl(const char *reponame) 51char *cgit_repourl(const char *reponame)
44{ 52{
45 if (cgit_virtual_root) { 53 if (cgit_virtual_root) {
@@ -113,10 +121,23 @@ void cgit_print_docend()
113 121
114void cgit_print_pageheader(char *title, int show_search) 122void 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) {
121 html("<form method='get' href='"); 142 html("<form method='get' href='");
122 html_attr(cgit_currurl()); 143 html_attr(cgit_currurl());
@@ -137,12 +158,8 @@ void cgit_print_pageheader(char *title, int show_search)
137 html_attr(cgit_query_search); 158 html_attr(cgit_query_search);
138 html("'/></form>"); 159 html("'/></form>");
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}
147 164
148void cgit_print_snapshot_start(const char *mimetype, const char *filename, 165void cgit_print_snapshot_start(const char *mimetype, const char *filename,
diff --git a/ui-summary.c b/ui-summary.c index ff3ed4d..42f4300 100644 --- a/ui-summary.c +++ b/ui-summary.c
@@ -129,8 +129,10 @@ static void cgit_print_tags()
129void cgit_print_summary() 129void cgit_print_summary()
130{ 130{
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'>");
135 cgit_print_branches(); 137 cgit_print_branches();
136 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>"); 138 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
diff --git a/ui-tree.c b/ui-tree.c index 1d07e70..b00670e 100644 --- a/ui-tree.c +++ b/ui-tree.c
@@ -66,7 +66,6 @@ void cgit_print_tree(const char *hex, char *path)
66 return; 66 return;
67 } 67 }
68 68
69 html("<h2>Tree content</h2>\n");
70 html_txt(path); 69 html_txt(path);
71 html("<table class='list'>\n"); 70 html("<table class='list'>\n");
72 html("<tr class='nohover'>"); 71 html("<tr class='nohover'>");
diff --git a/ui-view.c b/ui-view.c index 07cd8be..85e223c 100644 --- a/ui-view.c +++ b/ui-view.c
@@ -32,7 +32,6 @@ void cgit_print_view(const char *hex)
32 } 32 }
33 33
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");
37 htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size); 36 htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size);
38 html("<tr><td class='blob'>\n"); 37 html("<tr><td class='blob'>\n");