summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.css14
-rw-r--r--ui-shared.c51
2 files changed, 49 insertions, 16 deletions
diff --git a/cgit.css b/cgit.css
index cda437e..9c79c32 100644
--- a/cgit.css
+++ b/cgit.css
@@ -86,50 +86,60 @@ td#header, td#logo {
86 color: #666; 86 color: #666;
87 background-color: #ddd; 87 background-color: #ddd;
88 border-bottom: solid 1px #000; 88 border-bottom: solid 1px #000;
89} 89}
90 90
91td#header { 91td#header {
92 font-size: 150%; 92 font-size: 150%;
93 font-weight: bold; 93 font-weight: bold;
94 padding: 0.2em 0.5em; 94 padding: 0.2em 0.5em;
95 vertical-align: text-bottom; 95 vertical-align: text-bottom;
96} 96}
97 97
98td#header a {
99 color: #666;
100}
101
102td#header a:hoved {
103 text-decoration: underline;
104}
105
98td#logo { 106td#logo {
99 text-align: right; 107 text-align: right;
100 vertical-align: middle; 108 vertical-align: middle;
101 padding-right: 0.5em; 109 padding-right: 0.5em;
102} 110}
103 111
104td#crumb, td#search { 112td#crumb, td#search {
105 color: #ccc; 113 color: #ccc;
106 border-top: solid 3px #555; 114 border-top: solid 3px #555;
107 background-color: #666; 115 background-color: #666;
108 border-bottom: solid 1px #333; 116 border-bottom: solid 1px #333;
109 padding: 2px 1em; 117 padding: 2px 1em;
110} 118}
111 119
112td#crumb { 120td#crumb {
113 font-weight: bold; 121 font-weight: bold;
114} 122}
115 123
116td#crumb a { 124td#crumb a {
117 color: #ccc; 125 color: #ccc;
118 background-color: #666; 126 background-color: #666;
127 padding: 0em 0.5em 0em 0.5em;
119} 128}
120 129
121td#crumb a:hover { 130td#crumb a:hover {
122 color: #eee; 131 color: #666;
123 background-color: #666; 132 background-color: #ccc;
133 text-decoration: none;
124} 134}
125 135
126td#search { 136td#search {
127 text-align: right; 137 text-align: right;
128 vertical-align: middle; 138 vertical-align: middle;
129 padding-right: 0.5em; 139 padding-right: 0.5em;
130} 140}
131 141
132td#search form { 142td#search form {
133 margin: 0px; 143 margin: 0px;
134 padding: 0px; 144 padding: 0px;
135} 145}
diff --git a/ui-shared.c b/ui-shared.c
index 15d8254..383b8ac 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -102,38 +102,42 @@ static char *repolink(char *title, char *class, char *page, char *head,
102 html(" class='"); 102 html(" class='");
103 html_attr(class); 103 html_attr(class);
104 html("'"); 104 html("'");
105 } 105 }
106 html(" href='"); 106 html(" href='");
107 if (cgit_virtual_root) { 107 if (cgit_virtual_root) {
108 html_attr(cgit_virtual_root); 108 html_attr(cgit_virtual_root);
109 if (cgit_virtual_root[strlen(cgit_virtual_root) - 1] != '/') 109 if (cgit_virtual_root[strlen(cgit_virtual_root) - 1] != '/')
110 html("/"); 110 html("/");
111 html_attr(cgit_repo->url); 111 html_attr(cgit_repo->url);
112 if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/') 112 if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/')
113 html("/"); 113 html("/");
114 html(page); 114 if (page) {
115 html("/"); 115 html(page);
116 if (path) 116 html("/");
117 html_attr(path); 117 if (path)
118 html_attr(path);
119 }
118 } else { 120 } else {
119 html(cgit_script_name); 121 html(cgit_script_name);
120 html("?url="); 122 html("?url=");
121 html_attr(cgit_repo->url); 123 html_attr(cgit_repo->url);
122 if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/') 124 if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/')
123 html("/"); 125 html("/");
124 html(page); 126 if (page) {
125 html("/"); 127 html(page);
126 if (path) 128 html("/");
127 html_attr(path); 129 if (path)
130 html_attr(path);
131 }
128 delim = "&"; 132 delim = "&";
129 } 133 }
130 if (head && strcmp(head, cgit_repo->defbranch)) { 134 if (head && strcmp(head, cgit_repo->defbranch)) {
131 html(delim); 135 html(delim);
132 html("h="); 136 html("h=");
133 html_attr(head); 137 html_attr(head);
134 delim = "&"; 138 delim = "&";
135 } 139 }
136 return fmt("%s", delim); 140 return fmt("%s", delim);
137} 141}
138 142
139static void reporevlink(char *page, char *name, char *title, char *class, 143static void reporevlink(char *page, char *name, char *title, char *class,
@@ -270,37 +274,56 @@ void cgit_print_docstart(char *title, struct cacheitem *item)
270 html("<body>\n"); 274 html("<body>\n");
271} 275}
272 276
273void cgit_print_docend() 277void cgit_print_docend()
274{ 278{
275 html("</td></tr></table>"); 279 html("</td></tr></table>");
276 html("</body>\n</html>\n"); 280 html("</body>\n</html>\n");
277} 281}
278 282
279void cgit_print_pageheader(char *title, int show_search) 283void cgit_print_pageheader(char *title, int show_search)
280{ 284{
281 html("<table id='layout'>"); 285 html("<table id='layout'>");
282 html("<tr><td id='header'>"); 286 html("<tr><td id='header'><a href='");
283 html(cgit_root_title); 287 html_attr(cgit_rooturl());
284 html("</td><td id='logo'>"); 288 html("'>");
289 html_txt(cgit_root_title);
290 html("</a></td><td id='logo'>");
285 html("<a href='"); 291 html("<a href='");
286 html_attr(cgit_logo_link); 292 html_attr(cgit_logo_link);
287 htmlf("'><img src='%s' alt='logo'/></a>", cgit_logo); 293 htmlf("'><img src='%s' alt='logo'/></a>", cgit_logo);
288 html("</td></tr>"); 294 html("</td></tr>");
289 html("<tr><td id='crumb'>"); 295 html("<tr><td id='crumb'>");
290 htmlf("<a href='%s'>root</a>", cgit_rooturl());
291 if (cgit_query_repo) { 296 if (cgit_query_repo) {
292 htmlf(" : <a href='%s'>", cgit_repourl(cgit_repo->url));
293 html_txt(cgit_repo->name); 297 html_txt(cgit_repo->name);
294 htmlf("</a> : %s", title); 298 html(" (");
299 html_txt(cgit_query_head);
300 html(") : &nbsp;");
301 reporevlink(NULL, "summary", NULL, NULL, cgit_query_head,
302 NULL, NULL);
303 html(" ");
304 cgit_log_link("log", NULL, NULL, cgit_query_head,
305 cgit_query_sha1, cgit_query_path);
306 html(" ");
307 cgit_tree_link("files", NULL, NULL, cgit_query_head,
308 cgit_query_sha1, cgit_query_path);
309 html(" ");
310 cgit_commit_link("commit", NULL, NULL, cgit_query_head,
311 cgit_query_sha1);
312 html(" ");
313 cgit_diff_link("diff", NULL, NULL, cgit_query_head,
314 cgit_query_sha1, cgit_query_sha2,
315 cgit_query_path);
316 } else {
317 html_txt("Index of repositories");
295 } 318 }
296 html("</td>"); 319 html("</td>");
297 html("<td id='search'>"); 320 html("<td id='search'>");
298 if (show_search) { 321 if (show_search) {
299 html("<form method='get' action='"); 322 html("<form method='get' action='");
300 html_attr(cgit_currurl()); 323 html_attr(cgit_currurl());
301 html("'>"); 324 html("'>");
302 if (!cgit_virtual_root) { 325 if (!cgit_virtual_root) {
303 if (cgit_query_repo) 326 if (cgit_query_repo)
304 html_hidden("r", cgit_query_repo); 327 html_hidden("r", cgit_query_repo);
305 if (cgit_query_page) 328 if (cgit_query_page)
306 html_hidden("p", cgit_query_page); 329 html_hidden("p", cgit_query_page);