From 9ad47965387c63e287afac86c498566e37265248 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Dec 2019 23:36:02 +0000 Subject: feat(cgit-taz): Add patches for subtree about/ handling 1. Generate links to subtree about pages. 2. Render README files in subtrees, too. --- web/cgit-taz/0003-cgit_subtree_about_links.patch | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 web/cgit-taz/0003-cgit_subtree_about_links.patch (limited to 'web/cgit-taz/0003-cgit_subtree_about_links.patch') diff --git a/web/cgit-taz/0003-cgit_subtree_about_links.patch b/web/cgit-taz/0003-cgit_subtree_about_links.patch new file mode 100644 index 000000000000..6b3d0a70b11d --- /dev/null +++ b/web/cgit-taz/0003-cgit_subtree_about_links.patch @@ -0,0 +1,50 @@ +From 531b55dc96bb7ee2ce52a3612021e1c1f4ddac8a Mon Sep 17 00:00:00 2001 +From: Vincent Ambo +Date: Sat, 21 Dec 2019 23:27:28 +0000 +Subject: [PATCH 3/3] feat(ui-shared): Generate links to about pages from + subtrees + +If you're on tree/foo/bar, the about link will now point to +about/foo/bar. + +Currently the annoying thing about this is that it will also do it for +files. +--- + ui-shared.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/ui-shared.c b/ui-shared.c +index c7c3754..c37835a 100644 +--- a/ui-shared.c ++++ b/ui-shared.c +@@ -297,6 +297,12 @@ void cgit_tag_link(const char *name, const char *title, const char *class, + reporevlink("tag", name, title, class, tag, NULL, NULL); + } + ++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_tree_link(const char *name, const char *title, const char *class, + const char *head, const char *rev, const char *path) + { +@@ -985,10 +991,10 @@ void cgit_print_pageheader(void) + + html("
\n"); + if (ctx.env.authenticated && ctx.repo) { +- if (ctx.repo->readme.nr) +- reporevlink("about", "about", NULL, +- hc("about"), ctx.qry.head, NULL, +- NULL); ++ if (ctx.repo->readme.nr) { ++ cgit_about_link("about", NULL, hc("about"), ctx.qry.head, ++ ctx.qry.sha1, ctx.qry.vpath); ++ } + cgit_summary_link("summary", NULL, hc("summary"), + ctx.qry.head); + cgit_refs_link("refs", NULL, hc("refs"), ctx.qry.head, +-- +2.24.1.735.g03f4e72817-goog + -- cgit 1.4.1