about summary refs log tree commit diff stats
path: root/ui-log.c
diff options
context:
space:
mode:
authorEric Wong2019-01-01 11:44:52 +0000
committerJune McEnroe2022-02-13 11:55:26 -0500
commit1e9f26ffb7c0d7ef0d672a66e888f8703ce06028 (patch)
tree7616424051a5d1c811399a28c640f3c1f19d6598 /ui-log.c
parentUse <pre> for commit-msg (diff)
downloadcgit-1e9f26ffb7c0d7ef0d672a66e888f8703ce06028.tar.gz
cgit-1e9f26ffb7c0d7ef0d672a66e888f8703ce06028.zip
Improve decoration display for browsers without CSS
Text-based browsers without CSS support show all the decorations
bunched together without spacing.  Rely on a whitespace instead
of CSS support.
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui-log.c b/ui-log.c index 2939c01..773950c 100644 --- a/ui-log.c +++ b/ui-log.c
@@ -67,6 +67,7 @@ void show_commit_decorations(struct commit *commit)
67 while (deco) { 67 while (deco) {
68 struct object_id peeled; 68 struct object_id peeled;
69 int is_annotated = 0; 69 int is_annotated = 0;
70
70 strlcpy(buf, prettify_refname(deco->name), sizeof(buf)); 71 strlcpy(buf, prettify_refname(deco->name), sizeof(buf));
71 switch(deco->type) { 72 switch(deco->type) {
72 case DECORATION_NONE: 73 case DECORATION_NONE:
@@ -74,11 +75,13 @@ void show_commit_decorations(struct commit *commit)
74 * don't display anything. */ 75 * don't display anything. */
75 break; 76 break;
76 case DECORATION_REF_LOCAL: 77 case DECORATION_REF_LOCAL:
78 html(" ");
77 cgit_log_link(buf, NULL, "branch-deco", buf, NULL, 79 cgit_log_link(buf, NULL, "branch-deco", buf, NULL,
78 ctx.qry.vpath, 0, NULL, NULL, 80 ctx.qry.vpath, 0, NULL, NULL,
79 ctx.qry.showmsg, 0); 81 ctx.qry.showmsg, 0);
80 break; 82 break;
81 case DECORATION_REF_TAG: 83 case DECORATION_REF_TAG:
84 html(" ");
82 if (!peel_ref(deco->name, &peeled)) 85 if (!peel_ref(deco->name, &peeled))
83 is_annotated = !oidcmp(&commit->object.oid, &peeled); 86 is_annotated = !oidcmp(&commit->object.oid, &peeled);
84 cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf); 87 cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf);
@@ -86,12 +89,14 @@ void show_commit_decorations(struct commit *commit)
86 case DECORATION_REF_REMOTE: 89 case DECORATION_REF_REMOTE:
87 if (!ctx.repo->enable_remote_branches) 90 if (!ctx.repo->enable_remote_branches)
88 break; 91 break;
92 html(" ");
89 cgit_log_link(buf, NULL, "remote-deco", NULL, 93 cgit_log_link(buf, NULL, "remote-deco", NULL,
90 oid_to_hex(&commit->object.oid), 94 oid_to_hex(&commit->object.oid),
91 ctx.qry.vpath, 0, NULL, NULL, 95 ctx.qry.vpath, 0, NULL, NULL,
92 ctx.qry.showmsg, 0); 96 ctx.qry.showmsg, 0);
93 break; 97 break;
94 default: 98 default:
99 html(" ");
95 cgit_commit_link(buf, NULL, "deco", ctx.qry.head, 100 cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
96 oid_to_hex(&commit->object.oid), 101 oid_to_hex(&commit->object.oid),
97 ctx.qry.vpath); 102 ctx.qry.vpath);