aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2021-09-05 22:54:29 +0200
committerache <ache@ache.one>2021-09-05 22:54:29 +0200
commit7893e2558e3569b7e469a3b8957c3609136d6012 (patch)
treef30ffdce4005bfd06b2732e2a0015179aa467a7c
parentgit: update to v2.32.0 (diff)
Set the default page to /aboutfix_about
-rw-r--r--cmd.c2
-rw-r--r--ui-repolist.c6
-rw-r--r--ui-shared.c13
-rw-r--r--ui-shared.h3
4 files changed, 20 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index 0eb75b1..2ddd95b 100644
--- a/cmd.c
+++ b/cmd.c
@@ -55,7 +55,7 @@ static void about_fn(void)
cgit_redirect(ctx.repo->homepage, false);
else {
char *currenturl = cgit_currenturl();
- char *redirect = fmtalloc("%s../", currenturl);
+ char *redirect = fmtalloc("%s/../", currenturl);
cgit_redirect(redirect, false);
free(currenturl);
free(redirect);
diff --git a/ui-repolist.c b/ui-repolist.c
index 529a203..87996b5 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -321,9 +321,11 @@ void cgit_print_repolist(void)
}
htmlf("<tr><td class='%s'>",
!sorted && section ? "sublevel-repo" : "toplevel-repo");
- cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
+ // cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
+
+ cgit_about_link(ctx.repo->name, ctx.repo->name);
html("</td><td>");
- repourl = cgit_repourl(ctx.repo->url);
+ repourl = cgit_repourl_about(ctx.repo->url);
html_link_open(repourl, NULL, NULL);
free(repourl);
if (html_ntxt(ctx.repo->desc, ctx.cfg.max_repodesc_len) < 0)
diff --git a/ui-shared.c b/ui-shared.c
index acd8ab5..38e6d10 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -126,7 +126,13 @@ const char *cgit_loginurl(void)
login_url = fmtalloc("%s?p=login", cgit_rooturl());
return login_url;
}
-
+char *cgit_repourl_about(const char *reponame)
+{
+ if (ctx.cfg.virtual_root)
+ return fmtalloc("%s%s/about", ctx.cfg.virtual_root, reponame);
+ else
+ return fmtalloc("?r=%s&page=about", reponame);
+}
char *cgit_repourl(const char *reponame)
{
if (ctx.cfg.virtual_root)
@@ -328,6 +334,11 @@ static void reporevlink(const char *page, const char *name, const char *title,
html("</a>");
}
+void cgit_about_link(const char *name, const char *title)
+{
+ reporevlink("about", name, title, NULL, NULL, NULL, NULL);
+}
+
void cgit_summary_link(const char *name, const char *title, const char *class,
const char *head)
{
diff --git a/ui-shared.h b/ui-shared.h
index 6964873..373c654 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -8,6 +8,7 @@ extern char *cgit_currenturl(void);
extern char *cgit_currentfullurl(void);
extern const char *cgit_loginurl(void);
extern char *cgit_repourl(const char *reponame);
+extern char *cgit_repourl_about(const char *reponame);
extern char *cgit_fileurl(const char *reponame, const char *pagename,
const char *filename, const char *query);
extern char *cgit_pageurl(const char *reponame, const char *pagename,
@@ -19,6 +20,8 @@ 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_summary_link(const char *name, const char *title,
const char *class, const char *head);
+extern void cgit_about_link(const char *name, const char *title);
+
extern void cgit_tag_link(const char *name, const char *title,
const char *class, const char *tag);
extern void cgit_tree_link(const char *name, const char *title,