summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--html.c16
-rw-r--r--html.h1
-rw-r--r--ui-repolist.c8
-rw-r--r--ui-shared.c20
-rw-r--r--ui-shared.h1
5 files changed, 32 insertions, 14 deletions
diff --git a/html.c b/html.c
index 167127f..d7d9fd7 100644
--- a/html.c
+++ b/html.c
@@ -130,2 +130,18 @@ void html_attr(char *txt)
130 130
131void html_url_path(char *txt)
132{
133 char *t = txt;
134 while(t && *t){
135 int c = *t;
136 if (c=='"' || c=='#' || c=='\'' || c=='?') {
137 write(htmlfd, txt, t - txt);
138 write(htmlfd, fmt("%%%2x", c), 3);
139 txt = t+1;
140 }
141 t++;
142 }
143 if (t!=txt)
144 html(txt);
145}
146
131void html_url_arg(char *txt) 147void html_url_arg(char *txt)
diff --git a/html.h b/html.h
index 038cf60..a55d4b2 100644
--- a/html.h
+++ b/html.h
@@ -12,2 +12,3 @@ extern void html_ntxt(int len, char *txt);
12extern void html_attr(char *txt); 12extern void html_attr(char *txt);
13extern void html_url_path(char *txt);
13extern void html_url_arg(char *txt); 14extern void html_url_arg(char *txt);
diff --git a/ui-repolist.c b/ui-repolist.c
index 725338b..ab050c7 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -133,5 +133,3 @@ void cgit_print_repolist()
133 ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); 133 ctx.repo->group ? "sublevel-repo" : "toplevel-repo");
134 html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); 134 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
135 html_txt(ctx.repo->name);
136 html_link_close();
137 html("</td><td>"); 135 html("</td><td>");
@@ -147,5 +145,3 @@ void cgit_print_repolist()
147 html("<td>"); 145 html("<td>");
148 html_link_open(cgit_repourl(ctx.repo->url), 146 cgit_summary_link("summary", NULL, "button", NULL);
149 NULL, "button");
150 html("summary</a>");
151 cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 147 cgit_log_link("log", NULL, "button", NULL, NULL, NULL,
diff --git a/ui-shared.c b/ui-shared.c
index a2f636c..1fc5c09 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -208,6 +208,6 @@ static char *repolink(char *title, char *class, char *page, char *head,
208 if (ctx.cfg.virtual_root) { 208 if (ctx.cfg.virtual_root) {
209 html_attr(ctx.cfg.virtual_root); 209 html_url_path(ctx.cfg.virtual_root);
210 if (ctx.cfg.virtual_root[strlen(ctx.cfg.virtual_root) - 1] != '/') 210 if (ctx.cfg.virtual_root[strlen(ctx.cfg.virtual_root) - 1] != '/')
211 html("/"); 211 html("/");
212 html_attr(ctx.repo->url); 212 html_url_path(ctx.repo->url);
213 if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/') 213 if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/')
@@ -215,6 +215,6 @@ static char *repolink(char *title, char *class, char *page, char *head,
215 if (page) { 215 if (page) {
216 html(page); 216 html_url_path(page);
217 html("/"); 217 html("/");
218 if (path) 218 if (path)
219 html_attr(path); 219 html_url_path(path);
220 } 220 }
@@ -259,2 +259,7 @@ static void reporevlink(char *page, char *name, char *title, char *class,
259 259
260void cgit_summary_link(char *name, char *title, char *class, char *head)
261{
262 reporevlink(NULL, name, title, class, head, NULL, NULL);
263}
264
260void cgit_tree_link(char *name, char *title, char *class, char *head, 265void cgit_tree_link(char *name, char *title, char *class, char *head,
@@ -600,4 +605,3 @@ void cgit_print_pageheader(struct cgit_context *ctx)
600 html(" : "); 605 html(" : ");
601 reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"), 606 cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL, NULL);
602 ctx->qry.head, NULL, NULL);
603 html("</td><td class='form'>"); 607 html("</td><td class='form'>");
@@ -629,4 +633,4 @@ void cgit_print_pageheader(struct cgit_context *ctx)
629 if (ctx->repo) { 633 if (ctx->repo) {
630 reporevlink(NULL, "summary", NULL, hc(cmd, "summary"), 634 cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL,
631 ctx->qry.head, NULL, NULL); 635 ctx->qry.head);
632 cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head, 636 cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head,
diff --git a/ui-shared.h b/ui-shared.h
index 747f092..0cd5ed1 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -12,2 +12,3 @@ extern void cgit_index_link(char *name, char *title, char *class,
12 char *pattern, int ofs); 12 char *pattern, int ofs);
13extern void cgit_summary_link(char *name, char *title, char *class, char *head);
13extern void cgit_tree_link(char *name, char *title, char *class, char *head, 14extern void cgit_tree_link(char *name, char *title, char *class, char *head,