+ html("<table summary='repository info' class='list nowrap'>");
+ cgit_print_branches(ctx.cfg.summary_branches);
+ html("<tr class='nohover'><td colspan='4'> </td></tr>");
+ cgit_print_tags(ctx.cfg.summary_tags);
+ if (ctx.cfg.summary_log > 0) {
+ html("<tr class='nohover'><td colspan='4'> </td></tr>");
+ cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,
+ NULL, NULL, 0);
+ }
+ if (ctx.repo->clone_url)
+ print_urls(ctx.repo->clone_url, NULL);
+ else if (ctx.cfg.clone_prefix)
+ print_urls(ctx.cfg.clone_prefix, ctx.repo->url);
+ html("</table>");
+}
+
+void cgit_print_repo_readme(char *path)
+{
+ char *slash, *tmp, *colon, *ref = 0;
+
+ if (!ctx.repo->readme)
+ return;
+
+ if (path) {
+ slash = strrchr(ctx.repo->readme, '/');
+ if (!slash) {
+ slash = strchr(ctx.repo->readme, ':');
+ if (!slash)
+ return;
+ }
+ tmp = xmalloc(slash - ctx.repo->readme + 1 + strlen(path) + 1);
+ strncpy(tmp, ctx.repo->readme, slash - ctx.repo->readme + 1);
+ strcpy(tmp + (slash - ctx.repo->readme + 1), path);
+ } else
+ tmp = ctx.repo->readme;
+ colon = strchr(tmp, ':');
+ if (colon && strlen(colon) > 1) {
+ *colon = '\0';
+ ref = tmp;
+ tmp = colon + 1;
+ while ((*tmp == '/' || *tmp == ':') && *tmp != '\0')
+ ++tmp;
+ if (!(*tmp))
+ return;
+ }
+ html("<div id='summary'>");
+ if (ctx.repo->about_filter)
+ cgit_open_filter(ctx.repo->about_filter);
+ if (ref)
+ cgit_print_file(tmp, ref);
+ else
+ html_include(tmp);
+ if (ctx.repo->about_filter)
+ cgit_close_filter(ctx.repo->about_filter);
+ html("</div>");