diff options
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/ui-shared.c b/ui-shared.c index 172499c..bca50aa 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -40,6 +40,14 @@ void cgit_print_error(char *msg) | |||
40 | html("</div>\n"); | 40 | html("</div>\n"); |
41 | } | 41 | } |
42 | 42 | ||
43 | char *cgit_rooturl() | ||
44 | { | ||
45 | if (cgit_virtual_root) | ||
46 | return fmt("%s/", cgit_virtual_root); | ||
47 | else | ||
48 | return "./cgit.cgi"; | ||
49 | } | ||
50 | |||
43 | char *cgit_repourl(const char *reponame) | 51 | char *cgit_repourl(const char *reponame) |
44 | { | 52 | { |
45 | if (cgit_virtual_root) { | 53 | if (cgit_virtual_root) { |
@@ -113,10 +121,23 @@ void cgit_print_docend() | |||
113 | 121 | ||
114 | void cgit_print_pageheader(char *title, int show_search) | 122 | void cgit_print_pageheader(char *title, int show_search) |
115 | { | 123 | { |
116 | html("<table id='layout'><tr><td id='header'>"); | 124 | html("<table id='layout'>"); |
117 | htmlf("<a href='%s'>", cgit_logo_link); | 125 | html("<tr><td id='header'>"); |
118 | htmlf("<img id='logo' src='%s'/>\n", cgit_logo); | 126 | html(cgit_root_title); |
119 | htmlf("</a>"); | 127 | html("</td><td id='logo'>"); |
128 | html("<a href='"); | ||
129 | html_attr(cgit_logo_link); | ||
130 | htmlf("'><img src='%s'/></a>", cgit_logo); | ||
131 | html("</td></tr>"); | ||
132 | html("<tr><td id='crumb'>"); | ||
133 | htmlf("<a href='%s'>root</a>", cgit_rooturl()); | ||
134 | if (cgit_query_repo) { | ||
135 | htmlf(" : <a href='%s'>", cgit_repourl(cgit_repo->url)); | ||
136 | html_txt(cgit_repo->name); | ||
137 | htmlf("</a> : %s", title); | ||
138 | } | ||
139 | html("</td>"); | ||
140 | html("<td id='search'>"); | ||
120 | if (show_search) { | 141 | if (show_search) { |
121 | html("<form method='get' href='"); | 142 | html("<form method='get' href='"); |
122 | html_attr(cgit_currurl()); | 143 | html_attr(cgit_currurl()); |
@@ -137,12 +158,8 @@ void cgit_print_pageheader(char *title, int show_search) | |||
137 | html_attr(cgit_query_search); | 158 | html_attr(cgit_query_search); |
138 | html("'/></form>"); | 159 | html("'/></form>"); |
139 | } | 160 | } |
140 | if (cgit_query_repo) | 161 | html("</td></tr>"); |
141 | htmlf("<a href='%s'>", cgit_repourl(cgit_query_repo)); | 162 | html("<tr><td id='content' colspan='2'>"); |
142 | html_txt(title); | ||
143 | if (cgit_query_repo) | ||
144 | html("</a>"); | ||
145 | html("</td></tr><tr><td id='content'>"); | ||
146 | } | 163 | } |
147 | 164 | ||
148 | void cgit_print_snapshot_start(const char *mimetype, const char *filename, | 165 | void cgit_print_snapshot_start(const char *mimetype, const char *filename, |