diff options
author | Eric Wong | 2019-01-01 11:44:52 +0000 |
---|---|---|
committer | June McEnroe | 2022-02-13 11:55:26 -0500 |
commit | 1e9f26ffb7c0d7ef0d672a66e888f8703ce06028 (patch) | |
tree | 7616424051a5d1c811399a28c640f3c1f19d6598 | |
parent | Use <pre> for commit-msg (diff) | |
download | cgit-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.
-rw-r--r-- | cgit.css | 6 | ||||
-rw-r--r-- | ui-log.c | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/cgit.css b/cgit.css index 67e1ed3..b88db61 100644 --- a/cgit.css +++ b/cgit.css | |||
@@ -666,7 +666,6 @@ div#cgit div.footer a:hover { | |||
666 | 666 | ||
667 | div#cgit a.branch-deco { | 667 | div#cgit a.branch-deco { |
668 | color: #000; | 668 | color: #000; |
669 | margin: 0px 0.5em; | ||
670 | padding: 0px 0.25em; | 669 | padding: 0px 0.25em; |
671 | background-color: #88ff88; | 670 | background-color: #88ff88; |
672 | border: solid 1px #007700; | 671 | border: solid 1px #007700; |
@@ -674,7 +673,6 @@ div#cgit a.branch-deco { | |||
674 | 673 | ||
675 | div#cgit a.tag-deco { | 674 | div#cgit a.tag-deco { |
676 | color: #000; | 675 | color: #000; |
677 | margin: 0px 0.5em; | ||
678 | padding: 0px 0.25em; | 676 | padding: 0px 0.25em; |
679 | background-color: #ffff88; | 677 | background-color: #ffff88; |
680 | border: solid 1px #777700; | 678 | border: solid 1px #777700; |
@@ -682,7 +680,6 @@ div#cgit a.tag-deco { | |||
682 | 680 | ||
683 | div#cgit a.tag-annotated-deco { | 681 | div#cgit a.tag-annotated-deco { |
684 | color: #000; | 682 | color: #000; |
685 | margin: 0px 0.5em; | ||
686 | padding: 0px 0.25em; | 683 | padding: 0px 0.25em; |
687 | background-color: #ffcc88; | 684 | background-color: #ffcc88; |
688 | border: solid 1px #777700; | 685 | border: solid 1px #777700; |
@@ -690,7 +687,6 @@ div#cgit a.tag-annotated-deco { | |||
690 | 687 | ||
691 | div#cgit a.remote-deco { | 688 | div#cgit a.remote-deco { |
692 | color: #000; | 689 | color: #000; |
693 | margin: 0px 0.5em; | ||
694 | padding: 0px 0.25em; | 690 | padding: 0px 0.25em; |
695 | background-color: #ccccff; | 691 | background-color: #ccccff; |
696 | border: solid 1px #000077; | 692 | border: solid 1px #000077; |
@@ -698,7 +694,6 @@ div#cgit a.remote-deco { | |||
698 | 694 | ||
699 | div#cgit a.deco { | 695 | div#cgit a.deco { |
700 | color: #000; | 696 | color: #000; |
701 | margin: 0px 0.5em; | ||
702 | padding: 0px 0.25em; | 697 | padding: 0px 0.25em; |
703 | background-color: #ff8888; | 698 | background-color: #ff8888; |
704 | border: solid 1px #770000; | 699 | border: solid 1px #770000; |
@@ -709,7 +704,6 @@ div#cgit div.commit-subject a.tag-deco, | |||
709 | div#cgit div.commit-subject a.tag-annotated-deco, | 704 | div#cgit div.commit-subject a.tag-annotated-deco, |
710 | div#cgit div.commit-subject a.remote-deco, | 705 | div#cgit div.commit-subject a.remote-deco, |
711 | div#cgit div.commit-subject a.deco { | 706 | div#cgit div.commit-subject a.deco { |
712 | margin-left: 1em; | ||
713 | font-size: 75%; | 707 | font-size: 75%; |
714 | } | 708 | } |
715 | 709 | ||
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); |