feat(third_party/cgit): 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.
This commit is contained in:
parent
0294eec9da
commit
be2f51e1dd
1 changed files with 10 additions and 4 deletions
14
third_party/cgit/ui-shared.c
vendored
14
third_party/cgit/ui-shared.c
vendored
|
@ -330,6 +330,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)
|
||||
{
|
||||
|
@ -1020,10 +1026,10 @@ void cgit_print_pageheader(void)
|
|||
|
||||
html("<table class='tabs'><tr><td>\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,
|
||||
|
|
Loading…
Reference in a new issue