List for cgit developers and users
 help / color / mirror / Atom feed
From: list at eworm.de (Christian Hesse)
Subject: [PATCH 1/1] ui-tree: provide link to about page for petty formatting
Date: Sat, 29 Dec 2018 00:15:34 +0100	[thread overview]
Message-ID: <20181228231534.15570-1-list@eworm.de> (raw)

From: Christian Hesse <mail at eworm.de>

We have an ongoing discussion about display filters and pretty
formatting in tree view. How about providing a link to about page
for petty formatting?

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-shared.c | 6 ++++++
 ui-shared.h | 3 +++
 ui-tree.c   | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/ui-shared.c b/ui-shared.c
index 7a4c726..a955430 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -345,6 +345,12 @@ void cgit_tree_link(const char *name, const char *title, const char *class,
 	reporevlink("tree", name, title, class, head, rev, path);
 }
 
+void cgit_about_link(const char *name, const char *title, const char *class,
+		     const char *head, const char *rev, const char *path)
+{
+	reporevlink("about", name, title, class, head, rev, path);
+}
+
 void cgit_plain_link(const char *name, const char *title, const char *class,
 		     const char *head, const char *rev, const char *path)
 {
diff --git a/ui-shared.h b/ui-shared.h
index 6964873..e01d5d8 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -24,6 +24,9 @@ extern void cgit_tag_link(const char *name, const char *title,
 extern void cgit_tree_link(const char *name, const char *title,
 			   const char *class, const char *head,
 			   const char *rev, const char *path);
+extern void cgit_about_link(const char *name, const char *title,
+			    const char *class, const char *head,
+			    const char *rev, const char *path);
 extern void cgit_plain_link(const char *name, const char *title,
 			    const char *class, const char *head,
 			    const char *rev, const char *path);
diff --git a/ui-tree.c b/ui-tree.c
index df8ad82..7b45da6 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -108,6 +108,9 @@ static void print_object(const struct object_id *oid, char *path, const char *ba
 
 	cgit_print_layout_start();
 	htmlf("blob: %s (", oid_to_hex(oid));
+	cgit_about_link("about", NULL, NULL, ctx.qry.head,
+		        rev, path);
+	html(") (");
 	cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
 		        rev, path);
 	if (ctx.cfg.enable_blame) {


             reply	other threads:[~2018-12-28 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 23:15 list [this message]
2019-01-02  8:22 ` [PATCH 1/1] ui-tree: add about link in tree view list list
2019-01-03  7:56 ` [PATCH 1/1] ui-tree: provide link to about page for petty formatting 
2019-01-03  8:07   ` list

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181228231534.15570-1-list@eworm.de \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).