",
!sorted && section ? "sublevel-repo" : "toplevel-repo");
- cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
+ cgit_repo_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
html(" | ");
repourl = cgit_repourl(ctx.repo->url);
html_link_open(repourl, NULL, NULL);
diff --git a/ui-shared.c b/ui-shared.c
index acd8ab5..17b1e49 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -203,6 +203,9 @@ static void site_url(const char *page, const char *search, const char *sort, int
{
char *delim = "?";
+ if (!strcmp(page ? page : "", ctx.cfg.root_default_tab))
+ page = NULL;
+
if (always_root || page)
html_attr(cgit_rooturl());
else {
@@ -257,7 +260,7 @@ static void site_link(const char *page, const char *name, const char *title,
void cgit_index_link(const char *name, const char *title, const char *class,
const char *pattern, const char *sort, int ofs, int always_root)
{
- site_link(NULL, name, title, class, pattern, sort, ofs, always_root);
+ site_link("repolist", name, title, class, pattern, sort, ofs, always_root);
}
static char *repolink(const char *title, const char *class, const char *page,
@@ -317,6 +320,12 @@ static void reporevlink(const char *page, const char *name, const char *title,
{
char *delim;
+ if (page
+ && !rev
+ && !path
+ && !strcmp(page, ctx.repo->default_tab))
+ page = NULL;
+
delim = repolink(title, class, page, head, path);
if (rev && ctx.qry.head != NULL && strcmp(rev, ctx.qry.head)) {
html(delim);
@@ -328,10 +337,17 @@ static void reporevlink(const char *page, const char *name, const char *title,
html("");
}
+void cgit_repo_link(const char *name, const char *title, const char *class,
+ const char *head)
+{
+ reporevlink(NULL, name, title, class, head, NULL, NULL);
+}
+
+
void cgit_summary_link(const char *name, const char *title, const char *class,
const char *head)
{
- reporevlink(NULL, name, title, class, head, NULL, NULL);
+ reporevlink("summary", name, title, class, head, NULL, NULL);
}
void cgit_tag_link(const char *name, const char *title, const char *class,
@@ -995,7 +1011,7 @@ static void print_header(void)
if (ctx.repo) {
cgit_index_link("index", NULL, NULL, NULL, NULL, 0, 1);
html(" : ");
- cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
+ cgit_repo_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
if (ctx.env.authenticated) {
html(" | ");
html("\n");
} else if (ctx.env.authenticated) {
char *currenturl = cgit_currenturl();
- site_link(NULL, "index", NULL, hc("repolist"), NULL, NULL, 0, 1);
+ site_link("repolist", "index", NULL, hc("repolist"), NULL, NULL, 0, 1);
if (ctx.cfg.root_readme)
site_link("about", "about", NULL, hc("about"),
NULL, NULL, 0, 1);
diff --git a/ui-shared.h b/ui-shared.h
index 6964873..9faf2ba 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -17,6 +17,8 @@ extern void cgit_add_clone_urls(void (*fn)(const char *));
extern void cgit_index_link(const char *name, const char *title,
const char *class, const char *pattern, const char *sort, int ofs, int always_root);
+extern void cgit_repo_link(const char *name, const char *title,
+ const char *class, const char *head);
extern void cgit_summary_link(const char *name, const char *title,
const char *class, const char *head);
extern void cgit_tag_link(const char *name, const char *title,
--
2.30.2
|