From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16421 invoked from network); 19 Mar 2021 20:31:22 -0000 Received: from lists.zx2c4.com (165.227.139.114) by inbox.vuxu.org with ESMTPUTF8; 19 Mar 2021 20:31:22 -0000 Received: by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 8984e099; Fri, 19 Mar 2021 20:30:57 +0000 (UTC) Return-Path: Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by lists.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id 37a4a885 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 19 Mar 2021 20:30:55 +0000 (UTC) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2BC2A1FA00 for ; Fri, 19 Mar 2021 20:23:37 +0000 (UTC) From: Eric Wong To: cgit@lists.zx2c4.com Subject: [PATCH 3/5] ui-log: improve decoration display for browsers without CSS Date: Fri, 19 Mar 2021 20:23:35 +0000 Message-Id: <20210319202337.21676-4-e@80x24.org> In-Reply-To: <20210319202337.21676-1-e@80x24.org> References: <20210319202337.21676-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" Text-based browsers without CSS support show all the decorations bunched together without spacing. Rely on a whitespace instead of CSS support. Signed-off-by: Eric Wong --- cgit.css | 1 - ui-log.c | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cgit.css b/cgit.css index f9549a1..6ab28a1 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 6914f75..3679c0a 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);