author | Lars 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) |
commit | 777faf7e509e1de2b795b2a326ff00c9bd799104 (patch) (unidiff) | |
tree | ccb440445caf46cbfa3d4bd21d743697f37a9876 | |
parent | 447025f62ccbbb6e038d42009368e28f3e162460 (diff) | |
download | cgit-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>
-rw-r--r-- | cgit.css | 10 | ||||
-rw-r--r-- | ui-log.c | 2 | ||||
-rw-r--r-- | ui-repolist.c | 2 | ||||
-rw-r--r-- | ui-summary.c | 4 | ||||
-rw-r--r-- | ui-tree.c | 2 | ||||
-rw-r--r-- | ui-view.c | 2 |
6 files changed, 9 insertions, 13 deletions
@@ -18,46 +18,42 @@ a { | |||
18 | text-decoration: none; | 18 | text-decoration: none; |
19 | } | 19 | } |
20 | 20 | ||
21 | a:hover { | 21 | a:hover { |
22 | text-decoration: underline; | 22 | text-decoration: underline; |
23 | } | 23 | } |
24 | 24 | ||
25 | table.list { | 25 | table.list { |
26 | border: solid 1px black; | 26 | border: none; |
27 | border-collapse: collapse; | 27 | border-collapse: collapse; |
28 | border: solid 1px #aaa; | ||
29 | } | 28 | } |
30 | table.list tr { | 29 | table.list tr { |
31 | background: white; | 30 | background: white; |
32 | } | 31 | } |
33 | table.list tr:hover { | 32 | table.list tr:hover { |
34 | background: #eeb; | 33 | background: #eee; |
35 | } | 34 | } |
36 | table.list tr.nohover:hover { | 35 | table.list tr.nohover:hover { |
37 | background: white; | 36 | background: white; |
38 | } | 37 | } |
39 | table.list th { | 38 | table.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 | } |
47 | table.list td { | 44 | table.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 | } |
51 | img { | 48 | img { |
52 | border: none; | 49 | border: none; |
53 | } | 50 | } |
54 | 51 | ||
55 | |||
56 | div#header { | 52 | div#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; |
@@ -51,17 +51,17 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) | |||
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); |
diff --git a/ui-repolist.c b/ui-repolist.c index 9f12b18..bd4af59 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -23,17 +23,17 @@ void cgit_print_repolist(struct cacheitem *item) | |||
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; |
diff --git a/ui-summary.c b/ui-summary.c index 1591632..04d4912 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -91,26 +91,26 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, | |||
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 | ||
97 | static void cgit_print_branches() | 97 | static 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 | ||
106 | static void cgit_print_tags() | 106 | static 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 | ||
115 | void cgit_print_summary() | 115 | void cgit_print_summary() |
116 | { | 116 | { |
@@ -64,16 +64,16 @@ void cgit_print_tree(const char *hex, char *path) | |||
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 | } |
@@ -29,14 +29,14 @@ void cgit_print_view(const char *hex) | |||
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 | } |