summaryrefslogtreecommitdiffabout
authorLars Hjemli <larsh@slaptop.hjemli.net>2007-01-27 23:39:26 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-01-27 23:52:41 (UTC)
commit777faf7e509e1de2b795b2a326ff00c9bd799104 (patch) (unidiff)
treeccb440445caf46cbfa3d4bd21d743697f37a9876
parent447025f62ccbbb6e038d42009368e28f3e162460 (diff)
downloadcgit-777faf7e509e1de2b795b2a326ff00c9bd799104.zip
cgit-777faf7e509e1de2b795b2a326ff00c9bd799104.tar.gz
cgit-777faf7e509e1de2b795b2a326ff00c9bd799104.tar.bz2
Cleanup table listings
Make the output for <table class='list'> a bit nicer Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.css10
-rw-r--r--ui-log.c2
-rw-r--r--ui-repolist.c2
-rw-r--r--ui-summary.c4
-rw-r--r--ui-tree.c2
-rw-r--r--ui-view.c2
6 files changed, 9 insertions, 13 deletions
diff --git a/cgit.css b/cgit.css
index d94b1b7..d2c0d0b 100644
--- a/cgit.css
+++ b/cgit.css
@@ -1,103 +1,99 @@
1body { 1body {
2 font-family: arial; 2 font-family: arial;
3 font-size: normal; 3 font-size: normal;
4 background: white; 4 background: white;
5 padding: 0em; 5 padding: 0em;
6 margin: 0.5em 1em; 6 margin: 0.5em 1em;
7} 7}
8 8
9 9
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.5em;
14} 14}
15 15
16a { 16a {
17 color: blue; 17 color: blue;
18 text-decoration: none; 18 text-decoration: none;
19} 19}
20 20
21a:hover { 21a:hover {
22 text-decoration: underline; 22 text-decoration: underline;
23} 23}
24 24
25table.list { 25table.list {
26 border: solid 1px black; 26 border: none;
27 border-collapse: collapse; 27 border-collapse: collapse;
28 border: solid 1px #aaa;
29} 28}
30table.list tr { 29table.list tr {
31 background: white; 30 background: white;
32} 31}
33table.list tr:hover { 32table.list tr:hover {
34 background: #eeb; 33 background: #eee;
35} 34}
36table.list tr.nohover:hover { 35table.list tr.nohover:hover {
37 background: white; 36 background: white;
38} 37}
39table.list th { 38table.list th {
40 font-weight: normal; 39 font-weight: normal;
41 background: #ddd; 40 border-bottom: solid 1px #777;
42 border-top: solid 1px #aaa;
43 border-bottom: solid 1px #aaa;
44 padding: 0.1em 0.5em 0.1em 0.5em; 41 padding: 0.1em 0.5em 0.1em 0.5em;
45 vertical-align: baseline; 42 vertical-align: baseline;
46} 43}
47table.list td { 44table.list td {
48 border: none; 45 border: none;
49 padding: 0.1em 0.5em 0.1em 0.5em; 46 padding: 0.1em 0.5em 0.1em 0.5em;
50} 47}
51img { 48img {
52 border: none; 49 border: none;
53} 50}
54 51
55
56div#header { 52div#header {
57 background-color: #ddd; 53 background-color: #ddd;
58 padding: 0.25em 0.25em 0.25em 0.5em; 54 padding: 0.25em 0.25em 0.25em 0.5em;
59 font-size: 150%; 55 font-size: 150%;
60 font-weight: bold; 56 font-weight: bold;
61 border: solid 1px #aaa; 57 border: solid 1px #aaa;
62 vertical-align: middle; 58 vertical-align: middle;
63 margin-bottom: 2em; 59 margin-bottom: 2em;
64} 60}
65div#header img#logo { 61div#header img#logo {
66 float: right; 62 float: right;
67} 63}
68 64
69div#header input { 65div#header input {
70 float: right; 66 float: right;
71 margin: 0.25em 1em; 67 margin: 0.25em 1em;
72} 68}
73div#header a { 69div#header a {
74 color: black; 70 color: black;
75} 71}
76 72
77div#content { 73div#content {
78 margin: 0.5em 0.5em; 74 margin: 0.5em 0.5em;
79} 75}
80 76
81div#blob { 77div#blob {
82 border: solid 1px black; 78 border: solid 1px black;
83} 79}
84 80
85div.error { 81div.error {
86 color: red; 82 color: red;
87 font-weight: bold; 83 font-weight: bold;
88 margin: 1em 2em; 84 margin: 1em 2em;
89} 85}
90div.ls-blob, div.ls-dir { 86div.ls-blob, div.ls-dir {
91 font-family: monospace; 87 font-family: monospace;
92} 88}
93div.ls-dir a { 89div.ls-dir a {
94 font-weight: bold; 90 font-weight: bold;
95} 91}
96th.filesize, td.filesize { 92th.filesize, td.filesize {
97 text-align: right; 93 text-align: right;
98} 94}
99td.filesize { 95td.filesize {
100 font-family: monospace; 96 font-family: monospace;
101} 97}
102td.filemode { 98td.filemode {
103 font-family: monospace; 99 font-family: monospace;
diff --git a/ui-log.c b/ui-log.c
index c353b2a..725f49b 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -11,88 +11,88 @@
11void print_commit(struct commit *commit) 11void print_commit(struct commit *commit)
12{ 12{
13 char buf[32]; 13 char buf[32];
14 struct commitinfo *info; 14 struct commitinfo *info;
15 struct tm *time; 15 struct tm *time;
16 16
17 info = cgit_parse_commit(commit); 17 info = cgit_parse_commit(commit);
18 time = gmtime(&commit->date); 18 time = gmtime(&commit->date);
19 html("<tr><td>"); 19 html("<tr><td>");
20 strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", time); 20 strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", time);
21 html_txt(buf); 21 html_txt(buf);
22 html("</td><td>"); 22 html("</td><td>");
23 char *qry = fmt("id=%s", sha1_to_hex(commit->object.sha1)); 23 char *qry = fmt("id=%s", sha1_to_hex(commit->object.sha1));
24 char *url = cgit_pageurl(cgit_query_repo, "commit", qry); 24 char *url = cgit_pageurl(cgit_query_repo, "commit", qry);
25 html_link_open(url, NULL, NULL); 25 html_link_open(url, NULL, NULL);
26 html_ntxt(80, info->subject); 26 html_ntxt(80, info->subject);
27 html_link_close(); 27 html_link_close();
28 html("</td><td>"); 28 html("</td><td>");
29 html_txt(info->author); 29 html_txt(info->author);
30 html("</td></tr>\n"); 30 html("</td></tr>\n");
31 cgit_free_commitinfo(info); 31 cgit_free_commitinfo(info);
32} 32}
33 33
34 34
35void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) 35void cgit_print_log(const char *tip, int ofs, int cnt, char *grep)
36{ 36{
37 struct rev_info rev; 37 struct rev_info rev;
38 struct commit *commit; 38 struct commit *commit;
39 const char *argv[3] = {NULL, tip, NULL}; 39 const char *argv[3] = {NULL, tip, NULL};
40 int argc = 2; 40 int argc = 2;
41 int i; 41 int i;
42 42
43 if (grep) 43 if (grep)
44 argv[argc++] = fmt("--grep=%s", grep); 44 argv[argc++] = fmt("--grep=%s", grep);
45 init_revisions(&rev, NULL); 45 init_revisions(&rev, NULL);
46 rev.abbrev = DEFAULT_ABBREV; 46 rev.abbrev = DEFAULT_ABBREV;
47 rev.commit_format = CMIT_FMT_DEFAULT; 47 rev.commit_format = CMIT_FMT_DEFAULT;
48 rev.verbose_header = 1; 48 rev.verbose_header = 1;
49 rev.show_root_diff = 0; 49 rev.show_root_diff = 0;
50 setup_revisions(argc, argv, &rev, NULL); 50 setup_revisions(argc, argv, &rev, NULL);
51 if (rev.grep_filter) { 51 if (rev.grep_filter) {
52 rev.grep_filter->regflags |= REG_ICASE; 52 rev.grep_filter->regflags |= REG_ICASE;
53 compile_grep_patterns(rev.grep_filter); 53 compile_grep_patterns(rev.grep_filter);
54 } 54 }
55 prepare_revision_walk(&rev); 55 prepare_revision_walk(&rev);
56 56
57 html("<h2>Log</h2>"); 57 html("<h2>Log</h2>");
58 html("<table class='list nowrap'>"); 58 html("<table class='list nowrap'>");
59 html("<tr><th class='left'>Date</th>" 59 html("<tr class='nohover'><th class='left'>Date</th>"
60 "<th class='left'>Message</th>" 60 "<th class='left'>Message</th>"
61 "<th class='left'>Author</th></tr>\n"); 61 "<th class='left'>Author</th></tr>\n");
62 62
63 if (ofs<0) 63 if (ofs<0)
64 ofs = 0; 64 ofs = 0;
65 65
66 for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { 66 for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) {
67 free(commit->buffer); 67 free(commit->buffer);
68 commit->buffer = NULL; 68 commit->buffer = NULL;
69 free_commit_list(commit->parents); 69 free_commit_list(commit->parents);
70 commit->parents = NULL; 70 commit->parents = NULL;
71 } 71 }
72 72
73 for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { 73 for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) {
74 print_commit(commit); 74 print_commit(commit);
75 free(commit->buffer); 75 free(commit->buffer);
76 commit->buffer = NULL; 76 commit->buffer = NULL;
77 free_commit_list(commit->parents); 77 free_commit_list(commit->parents);
78 commit->parents = NULL; 78 commit->parents = NULL;
79 } 79 }
80 html("</table>\n"); 80 html("</table>\n");
81 81
82 html("<div class='pager'>"); 82 html("<div class='pager'>");
83 if (ofs > 0) { 83 if (ofs > 0) {
84 html("&nbsp;<a href='"); 84 html("&nbsp;<a href='");
85 html(cgit_pageurl(cgit_query_repo, cgit_query_page, 85 html(cgit_pageurl(cgit_query_repo, cgit_query_page,
86 fmt("h=%s&ofs=%d", tip, ofs-cnt))); 86 fmt("h=%s&ofs=%d", tip, ofs-cnt)));
87 html("'>[prev]</a>&nbsp;"); 87 html("'>[prev]</a>&nbsp;");
88 } 88 }
89 89
90 if ((commit = get_revision(&rev)) != NULL) { 90 if ((commit = get_revision(&rev)) != NULL) {
91 html("&nbsp;<a href='"); 91 html("&nbsp;<a href='");
92 html(cgit_pageurl(cgit_query_repo, "log", 92 html(cgit_pageurl(cgit_query_repo, "log",
93 fmt("h=%s&ofs=%d", tip, ofs+cnt))); 93 fmt("h=%s&ofs=%d", tip, ofs+cnt)));
94 html("'>[next]</a>&nbsp;"); 94 html("'>[next]</a>&nbsp;");
95 } 95 }
96 html("</div>"); 96 html("</div>");
97} 97}
98 98
diff --git a/ui-repolist.c b/ui-repolist.c
index 9f12b18..bd4af59 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -1,63 +1,63 @@
1/* ui-repolist.c: functions for generating the repolist page 1/* ui-repolist.c: functions for generating the repolist page
2 * 2 *
3 * Copyright (C) 2006 Lars Hjemli 3 * Copyright (C) 2006 Lars Hjemli
4 * 4 *
5 * Licensed under GNU General Public License v2 5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text) 6 * (see COPYING for full license text)
7 */ 7 */
8 8
9#include "cgit.h" 9#include "cgit.h"
10 10
11void cgit_print_repolist(struct cacheitem *item) 11void cgit_print_repolist(struct cacheitem *item)
12{ 12{
13 DIR *d; 13 DIR *d;
14 struct dirent *de; 14 struct dirent *de;
15 struct stat st; 15 struct stat st;
16 char *name; 16 char *name;
17 17
18 chdir(cgit_root); 18 chdir(cgit_root);
19 cgit_print_docstart(cgit_root_title, item); 19 cgit_print_docstart(cgit_root_title, item);
20 cgit_print_pageheader(cgit_root_title, 0); 20 cgit_print_pageheader(cgit_root_title, 0);
21 21
22 if (!(d = opendir("."))) { 22 if (!(d = opendir("."))) {
23 cgit_print_error(fmt("Unable to scan repository directory: %s", 23 cgit_print_error(fmt("Unable to scan repository directory: %s",
24 strerror(errno))); 24 strerror(errno)));
25 cgit_print_docend(); 25 cgit_print_docend();
26 return; 26 return;
27 } 27 }
28 28
29 html("<h2>Repositories</h2>\n"); 29 html("<h2>Repositories</h2>\n");
30 html("<table class='list nowrap'>"); 30 html("<table class='list nowrap'>");
31 html("<tr>" 31 html("<tr class='nohover'>"
32 "<th class='left'>Name</th>" 32 "<th class='left'>Name</th>"
33 "<th class='left'>Description</th>" 33 "<th class='left'>Description</th>"
34 "<th class='left'>Owner</th></tr>\n"); 34 "<th class='left'>Owner</th></tr>\n");
35 while ((de = readdir(d)) != NULL) { 35 while ((de = readdir(d)) != NULL) {
36 if (de->d_name[0] == '.') 36 if (de->d_name[0] == '.')
37 continue; 37 continue;
38 if (stat(de->d_name, &st) < 0) 38 if (stat(de->d_name, &st) < 0)
39 continue; 39 continue;
40 if (!S_ISDIR(st.st_mode)) 40 if (!S_ISDIR(st.st_mode))
41 continue; 41 continue;
42 42
43 cgit_repo_name = cgit_repo_desc = cgit_repo_owner = NULL; 43 cgit_repo_name = cgit_repo_desc = cgit_repo_owner = NULL;
44 name = fmt("%s/info/cgit", de->d_name); 44 name = fmt("%s/info/cgit", de->d_name);
45 if (cgit_read_config(name, cgit_repo_config_cb)) 45 if (cgit_read_config(name, cgit_repo_config_cb))
46 continue; 46 continue;
47 47
48 html("<tr><td>"); 48 html("<tr><td>");
49 html_link_open(cgit_repourl(de->d_name), NULL, NULL); 49 html_link_open(cgit_repourl(de->d_name), NULL, NULL);
50 html_txt(cgit_repo_name); 50 html_txt(cgit_repo_name);
51 html_link_close(); 51 html_link_close();
52 html("</td><td>"); 52 html("</td><td>");
53 html_txt(cgit_repo_desc); 53 html_txt(cgit_repo_desc);
54 html("</td><td>"); 54 html("</td><td>");
55 html_txt(cgit_repo_owner); 55 html_txt(cgit_repo_owner);
56 html("</td></tr>\n"); 56 html("</td></tr>\n");
57 } 57 }
58 closedir(d); 58 closedir(d);
59 html("</table>"); 59 html("</table>");
60 cgit_print_docend(); 60 cgit_print_docend();
61} 61}
62 62
63 63
diff --git a/ui-summary.c b/ui-summary.c
index 1591632..04d4912 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -51,75 +51,75 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1,
51 int flags, void *cb_data) 51 int flags, void *cb_data)
52{ 52{
53 struct tag *tag; 53 struct tag *tag;
54 struct taginfo *info; 54 struct taginfo *info;
55 char buf[256], *page, *url; 55 char buf[256], *page, *url;
56 56
57 strncpy(buf, refname, sizeof(buf)); 57 strncpy(buf, refname, sizeof(buf));
58 tag = lookup_tag(sha1); 58 tag = lookup_tag(sha1);
59 if (tag && !parse_tag(tag) && (info = cgit_parse_tag(tag))){ 59 if (tag && !parse_tag(tag) && (info = cgit_parse_tag(tag))){
60 html("<tr><td>"); 60 html("<tr><td>");
61 url = cgit_pageurl(cgit_query_repo, "view", 61 url = cgit_pageurl(cgit_query_repo, "view",
62 fmt("id=%s", sha1_to_hex(sha1))); 62 fmt("id=%s", sha1_to_hex(sha1)));
63 html_link_open(url, NULL, NULL); 63 html_link_open(url, NULL, NULL);
64 html_txt(buf); 64 html_txt(buf);
65 html_link_close(); 65 html_link_close();
66 html("</td><td>"); 66 html("</td><td>");
67 if (info->tagger_date > 0) 67 if (info->tagger_date > 0)
68 cgit_print_date(info->tagger_date); 68 cgit_print_date(info->tagger_date);
69 html("</td><td>"); 69 html("</td><td>");
70 if (info->tagger) 70 if (info->tagger)
71 html(info->tagger); 71 html(info->tagger);
72 html("</td><td>"); 72 html("</td><td>");
73 if (tag->tagged->type == OBJ_COMMIT) 73 if (tag->tagged->type == OBJ_COMMIT)
74 page = "commit"; 74 page = "commit";
75 else if (tag->tagged->type == OBJ_TREE) 75 else if (tag->tagged->type == OBJ_TREE)
76 page = "tree"; 76 page = "tree";
77 else 77 else
78 page = "view"; 78 page = "view";
79 79
80 url = cgit_pageurl(cgit_query_repo, page, 80 url = cgit_pageurl(cgit_query_repo, page,
81 fmt("id=%s", sha1_to_hex(tag->tagged->sha1))); 81 fmt("id=%s", sha1_to_hex(tag->tagged->sha1)));
82 html_link_open(url, NULL, NULL); 82 html_link_open(url, NULL, NULL);
83 htmlf("%s %s", type_names[tag->tagged->type], 83 htmlf("%s %s", type_names[tag->tagged->type],
84 sha1_to_hex(tag->tagged->sha1)); 84 sha1_to_hex(tag->tagged->sha1));
85 html_link_close(); 85 html_link_close();
86 html("</td></tr>\n"); 86 html("</td></tr>\n");
87 } else { 87 } else {
88 html("<tr><td>"); 88 html("<tr><td>");
89 html_txt(buf); 89 html_txt(buf);
90 html("</td><td colspan='3'>"); 90 html("</td><td colspan='3'>");
91 htmlf("*** bad ref %s ***", sha1_to_hex(sha1)); 91 htmlf("*** bad ref %s ***", sha1_to_hex(sha1));
92 html("</td></tr>\n"); 92 html("</td></tr>\n");
93 } 93 }
94 return 0; 94 return 0;
95} 95}
96 96
97static void cgit_print_branches() 97static void cgit_print_branches()
98{ 98{
99 html("<tr><th class='left'>Branch</th>" 99 html("<tr class='nohover'><th class='left'>Branch</th>"
100 "<th class='left'>Updated</th>" 100 "<th class='left'>Updated</th>"
101 "<th class='left'>Author</th>" 101 "<th class='left'>Author</th>"
102 "<th class='left'>Head commit</th></tr>\n"); 102 "<th class='left'>Head commit</th></tr>\n");
103 for_each_branch_ref(cgit_print_branch_cb, NULL); 103 for_each_branch_ref(cgit_print_branch_cb, NULL);
104} 104}
105 105
106static void cgit_print_tags() 106static void cgit_print_tags()
107{ 107{
108 html("<tr><th class='left'>Tag</th>" 108 html("<tr class='nohover'><th class='left'>Tag</th>"
109 "<th class='left'>Created</th>" 109 "<th class='left'>Created</th>"
110 "<th class='left'>Author</th>" 110 "<th class='left'>Author</th>"
111 "<th class='left'>Reference</th></tr>\n"); 111 "<th class='left'>Reference</th></tr>\n");
112 for_each_tag_ref(cgit_print_tag_cb, NULL); 112 for_each_tag_ref(cgit_print_tag_cb, NULL);
113} 113}
114 114
115void cgit_print_summary() 115void cgit_print_summary()
116{ 116{
117 html("<h2>"); 117 html("<h2>");
118 html_txt("Repo summary page"); 118 html_txt("Repo summary page");
119 html("</h2>"); 119 html("</h2>");
120 html("<table class='list nowrap'>"); 120 html("<table class='list nowrap'>");
121 cgit_print_branches(); 121 cgit_print_branches();
122 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>"); 122 html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
123 cgit_print_tags(); 123 cgit_print_tags();
124 html("</table>"); 124 html("</table>");
125} 125}
diff --git a/ui-tree.c b/ui-tree.c
index ed9f05e..1d07e70 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -24,56 +24,56 @@ static int print_entry(const unsigned char *sha1, const char *base,
24 } 24 }
25 name = xstrdup(pathname); 25 name = xstrdup(pathname);
26 html("<tr><td class='filemode'>"); 26 html("<tr><td class='filemode'>");
27 html_filemode(mode); 27 html_filemode(mode);
28 html("</td><td>"); 28 html("</td><td>");
29 if (S_ISDIR(mode)) { 29 if (S_ISDIR(mode)) {
30 html("<div class='ls-dir'><a href='"); 30 html("<div class='ls-dir'><a href='");
31 html_attr(cgit_pageurl(cgit_query_repo, "tree", 31 html_attr(cgit_pageurl(cgit_query_repo, "tree",
32 fmt("id=%s&path=%s%s/", 32 fmt("id=%s&path=%s%s/",
33 sha1_to_hex(sha1), 33 sha1_to_hex(sha1),
34 cgit_query_path ? cgit_query_path : "", 34 cgit_query_path ? cgit_query_path : "",
35 pathname))); 35 pathname)));
36 } else { 36 } else {
37 html("<div class='ls-blob'><a href='"); 37 html("<div class='ls-blob'><a href='");
38 html_attr(cgit_pageurl(cgit_query_repo, "view", 38 html_attr(cgit_pageurl(cgit_query_repo, "view",
39 fmt("id=%s&path=%s%s", sha1_to_hex(sha1), 39 fmt("id=%s&path=%s%s", sha1_to_hex(sha1),
40 cgit_query_path ? cgit_query_path : "", 40 cgit_query_path ? cgit_query_path : "",
41 pathname))); 41 pathname)));
42 } 42 }
43 html("'>"); 43 html("'>");
44 html_txt(name); 44 html_txt(name);
45 if (S_ISDIR(mode)) 45 if (S_ISDIR(mode))
46 html("/"); 46 html("/");
47 html("</a></div></td>"); 47 html("</a></div></td>");
48 htmlf("<td class='filesize'>%li</td>", size); 48 htmlf("<td class='filesize'>%li</td>", size);
49 html("</tr>\n"); 49 html("</tr>\n");
50 free(name); 50 free(name);
51 return 0; 51 return 0;
52} 52}
53 53
54void cgit_print_tree(const char *hex, char *path) 54void cgit_print_tree(const char *hex, char *path)
55{ 55{
56 struct tree *tree; 56 struct tree *tree;
57 unsigned char sha1[20]; 57 unsigned char sha1[20];
58 58
59 if (get_sha1_hex(hex, sha1)) { 59 if (get_sha1_hex(hex, sha1)) {
60 cgit_print_error(fmt("Invalid object id: %s", hex)); 60 cgit_print_error(fmt("Invalid object id: %s", hex));
61 return; 61 return;
62 } 62 }
63 tree = parse_tree_indirect(sha1); 63 tree = parse_tree_indirect(sha1);
64 if (!tree) { 64 if (!tree) {
65 cgit_print_error(fmt("Not a tree object: %s", hex)); 65 cgit_print_error(fmt("Not a tree object: %s", hex));
66 return; 66 return;
67 } 67 }
68 68
69 html("<h2>Tree content</h2>\n"); 69 html("<h2>Tree content</h2>\n");
70 html_txt(path); 70 html_txt(path);
71 html("<table class='list'>\n"); 71 html("<table class='list'>\n");
72 html("<tr>"); 72 html("<tr class='nohover'>");
73 html("<th class='left'>Mode</th>"); 73 html("<th class='left'>Mode</th>");
74 html("<th class='left'>Name</th>"); 74 html("<th class='left'>Name</th>");
75 html("<th class='right'>Size</th>"); 75 html("<th class='right'>Size</th>");
76 html("</tr>\n"); 76 html("</tr>\n");
77 read_tree_recursive(tree, "", 0, 1, NULL, print_entry); 77 read_tree_recursive(tree, "", 0, 1, NULL, print_entry);
78 html("</table>\n"); 78 html("</table>\n");
79} 79}
diff --git a/ui-view.c b/ui-view.c
index b75ce9a..07cd8be 100644
--- a/ui-view.c
+++ b/ui-view.c
@@ -1,42 +1,42 @@
1/* ui-view.c: functions to output _any_ object, given it's sha1 1/* ui-view.c: functions to output _any_ object, given it's sha1
2 * 2 *
3 * Copyright (C) 2006 Lars Hjemli 3 * Copyright (C) 2006 Lars Hjemli
4 * 4 *
5 * Licensed under GNU General Public License v2 5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text) 6 * (see COPYING for full license text)
7 */ 7 */
8 8
9#include "cgit.h" 9#include "cgit.h"
10 10
11void cgit_print_view(const char *hex) 11void cgit_print_view(const char *hex)
12{ 12{
13 unsigned char sha1[20]; 13 unsigned char sha1[20];
14 char type[20]; 14 char type[20];
15 unsigned char *buf; 15 unsigned char *buf;
16 unsigned long size; 16 unsigned long size;
17 17
18 if (get_sha1_hex(hex, sha1)){ 18 if (get_sha1_hex(hex, sha1)){
19 cgit_print_error(fmt("Bad hex value: %s", hex)); 19 cgit_print_error(fmt("Bad hex value: %s", hex));
20 return; 20 return;
21 } 21 }
22 22
23 if (sha1_object_info(sha1, type, &size)){ 23 if (sha1_object_info(sha1, type, &size)){
24 cgit_print_error("Bad object name"); 24 cgit_print_error("Bad object name");
25 return; 25 return;
26 } 26 }
27 27
28 buf = read_sha1_file(sha1, type, &size); 28 buf = read_sha1_file(sha1, type, &size);
29 if (!buf) { 29 if (!buf) {
30 cgit_print_error("Error reading object"); 30 cgit_print_error("Error reading object");
31 return; 31 return;
32 } 32 }
33 33
34 buf[size] = '\0'; 34 buf[size] = '\0';
35 html("<h2>Object content</h2>\n"); 35 html("<h2>Object content</h2>\n");
36 html("<table class='list'>\n"); 36 html("<table class='list'>\n");
37 htmlf("<tr><th>%s %s, %li bytes</th></tr>\n", type, hex, size); 37 htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size);
38 html("<tr><td class='blob'>\n"); 38 html("<tr><td class='blob'>\n");
39 html_txt(buf); 39 html_txt(buf);
40 html("\n</td></tr>\n"); 40 html("\n</td></tr>\n");
41 html("</table>\n"); 41 html("</table>\n");
42} 42}