aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorGravatar Lars Hjemli <hjemli@gmail.com>2006-12-12 00:48:03 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2006-12-12 00:49:18 (JST)
commit74620f12e4f7e91cb0a0b4ca731e07272d1b65f6 (patch)
tree2e4db980535682c0a606d425b2937126d4b2c09b /ui-shared.c
parent5a106eb09b9b5e189b96cc736046a92b054f6c7f (diff)
downloadcgit-74620f12e4f7e91cb0a0b4ca731e07272d1b65f6.zip
cgit-74620f12e4f7e91cb0a0b4ca731e07272d1b65f6.tar.gz
Move functions for repolist output into ui-repolist.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index e795043..cb8a8df 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -39,6 +39,27 @@ void cgit_print_error(char *msg)
39 html_txt(msg); 39 html_txt(msg);
40 html("</div>\n"); 40 html("</div>\n");
41} 41}
42
43char *cgit_repourl(const char *reponame)
44{
45 if (cgit_virtual_root) {
46 return fmt("%s/%s/", cgit_virtual_root, reponame);
47 } else {
48 return fmt("?r=%s", reponame);
49 }
50}
51
52char *cgit_pageurl(const char *reponame, const char *pagename,
53 const char *query)
54{
55 if (cgit_virtual_root) {
56 return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame,
57 pagename, query);
58 } else {
59 return fmt("?r=%s&p=%s&%s", reponame, pagename, query);
60 }
61}
62
42void cgit_print_docstart(char *title, struct cacheitem *item) 63void cgit_print_docstart(char *title, struct cacheitem *item)
43{ 64{
44 html("Content-Type: text/html; charset=utf-8\n"); 65 html("Content-Type: text/html; charset=utf-8\n");