Commit 25a7920e30cade15f831c95e64a01b9d897a8cea

Parents: 907134b7a29177cb45aa461c549c004b1ae875af

From: Christian Hesse <mail@eworm.de>
Date: Sat Dec 29 00:13:54 2018 +0700

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

Signed-off-by: Christian Hesse <mail@eworm.de>

Stats

ui-shared.c +6/-0
ui-shared.h +3/-0
ui-tree.c +3/-0

Changeset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff --git a/ui-shared.c b/ui-shared.c
index 11aed19a80e882c6999eecb32250cd206fee5210..52fe76cb0e38925666487fedea19acbf0b619835 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -346,6 +346,12 @@ {
 	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 6964873a63942e2222d3981d73d4178c52c51508..e01d5d8f8c99d898843f68243696c8ab62b31552 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -24,6 +24,9 @@ 			  const char *class, const char *tag);
 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 98ce1ca09ab9ffb3101517db8e858878869dfe26..5d7b257e95b6c3108d011d93bc47c562682e164d 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -110,6 +110,9 @@ 	cgit_set_title_from_path(path);
 
 	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.repo->enable_blame && !is_binary) {