about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-01 08:57:24 +0000
committerEric Wong <e@80x24.org>2019-04-22 02:34:37 +0000
commitd47734a426c6a1c5bb53eb715582f689daa5ca06 (patch)
tree1f76bd6a287810d6f1bd99deaaac2478f21e475f
parent20a33d1b5e97093d923ea73b953a732f1ac9bae0 (diff)
downloadcgit-d47734a426c6a1c5bb53eb715582f689daa5ca06.tar.gz
ui-log: 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.
-rw-r--r--cgit.css1
-rw-r--r--ui-log.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/cgit.css b/cgit.css
index 9f70d14..6fcd984 100644
--- a/cgit.css
+++ b/cgit.css
@@ -708,7 +708,6 @@ div#cgit div.commit-subject a.tag-deco,
 div#cgit div.commit-subject a.tag-annotated-deco,
 div#cgit div.commit-subject a.remote-deco,
 div#cgit div.commit-subject a.deco {
-        margin-left: 1em;
         font-size: 75%;
 }
 
diff --git a/ui-log.c b/ui-log.c
index 3bcb657..10dc286 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -67,6 +67,7 @@ void show_commit_decorations(struct commit *commit)
         while (deco) {
                 struct object_id peeled;
                 int is_annotated = 0;
+
                 strlcpy(buf, prettify_refname(deco->name), sizeof(buf));
                 switch(deco->type) {
                 case DECORATION_NONE:
@@ -74,11 +75,13 @@ void show_commit_decorations(struct commit *commit)
                          * don't display anything. */
                         break;
                 case DECORATION_REF_LOCAL:
+                        html(" ");
                         cgit_log_link(buf, NULL, "branch-deco", buf, NULL,
                                 ctx.qry.vpath, 0, NULL, NULL,
                                 ctx.qry.showmsg, 0);
                         break;
                 case DECORATION_REF_TAG:
+                        html(" ");
                         if (!peel_ref(deco->name, &peeled))
                                 is_annotated = !oidcmp(&commit->object.oid, &peeled);
                         cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf);
@@ -86,12 +89,14 @@ void show_commit_decorations(struct commit *commit)
                 case DECORATION_REF_REMOTE:
                         if (!ctx.repo->enable_remote_branches)
                                 break;
+                        html(" ");
                         cgit_log_link(buf, NULL, "remote-deco", NULL,
                                 oid_to_hex(&commit->object.oid),
                                 ctx.qry.vpath, 0, NULL, NULL,
                                 ctx.qry.showmsg, 0);
                         break;
                 default:
+                        html(" ");
                         cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
                                         oid_to_hex(&commit->object.oid),
                                         ctx.qry.vpath);