html("</a>");
}
+void cgit_patch_link(char *name, char *title, char *class, char *head,
+ char *rev)
+{
+ reporevlink("patch", name, title, class, head, rev, NULL);
+}
+
void cgit_object_link(struct object *obj)
{
char *page, *arg, *url;
char buf[64];
struct tm *time;
+ if (!secs)
+ return;
time = gmtime(&secs);
strftime(buf, sizeof(buf)-1, format, time);
html_txt(buf);
{
time_t now, secs;
+ if (!t)
+ return;
time(&now);
secs = now - t;
html_txt(title);
html("</title>\n");
htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
+ if (cgit_robots && *cgit_robots)
+ htmlf("<meta name='robots' content='%s'/>\n", cgit_robots);
html("<link rel='stylesheet' type='text/css' href='");
html_attr(cgit_css);
html("'/>\n");
{
static const char *default_info = "This is cgit, a fast webinterface for git repositories";
int header = 0;
+ char *url;
- html("<div id='sidebar'>\n");
- html("<div id='logo'><a href='");
+ html("<table id='layout' summary=''>\n");
+ html("<tr><td id='sidebar'>\n");
+ html("<table class='sidebar' cellspacing='0' summary=''>\n");
+ html("<tr><td class='sidebar'>\n<a href='");
html_attr(cgit_rooturl());
- htmlf("'><img src='%s' alt='cgit'/></a></div>\n",
+ htmlf("'><img src='%s' alt='cgit'/></a>\n",
cgit_logo);
- html("<div class='infobox'>");
+ html("</td></tr>\n<tr><td class='sidebar'>\n");
if (cgit_query_repo) {
html("<h1 class='first'>");
html_txt(strrpart(cgit_repo->name, 20));
cgit_query_sha1);
cgit_diff_link("diff", NULL, "menu", cgit_query_head,
cgit_query_sha1, cgit_query_sha2, NULL);
+ cgit_patch_link("patch", NULL, "menu", cgit_query_head,
+ cgit_query_sha1);
for_each_ref(print_archive_ref, &header);
+ if (cgit_repo->clone_url || cgit_clone_prefix) {
+ html("<h1>clone</h1>\n");
+ if (cgit_repo->clone_url)
+ url = cgit_repo->clone_url;
+ else
+ url = fmt("%s%s", cgit_clone_prefix,
+ cgit_repo->url);
+ html("<a class='menu' href='");
+ html_attr(url);
+ html("' title='");
+ html_attr(url);
+ html("'>\n");
+ html_txt(strrpart(url, 20));
+ html("</a>\n");
+ }
+
html("<h1>branch</h1>\n");
html("<form method='get' action=''>\n");
add_hidden_formfields(0, 1, cgit_query_page);
- html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>");
+// html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>");
html("<select name='h' onchange='this.form.submit();'>\n");
for_each_branch_ref(print_branch_option, cgit_query_head);
html("</select>\n");
- html("</td><td>");
- html("<noscript><input type='submit' id='switch-btn' value='..'/></noscript>\n");
- html("</td></tr></table>");
+// html("</td><td>");
+ html("<noscript><input type='submit' id='switch-btn' value='switch'/></noscript>\n");
+// html("</td></tr></table>");
html("</form>\n");
html("<h1>search</h1>\n");
html(default_info);
}
- html("</div>\n");
+ html("</td></tr></table></td>\n");
- html("</div>\n<table summary='page content' class='grid'><tr><td id='content'>\n");
+ html("<td id='content'>\n");
}