"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
struct tm *tm = gmtime(&t);
return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
struct tm *tm = gmtime(&t);
return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
- tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year,
+ tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year,
} else {
tmp = fmt("?url=%s/%s/%s", reponame, pagename,
(filename ? filename : ""));
} else {
tmp = fmt("?url=%s/%s/%s", reponame, pagename,
(filename ? filename : ""));
}
if (query)
tmp = fmt("%s%s%s", tmp, delim, query);
}
if (query)
tmp = fmt("%s%s%s", tmp, delim, query);
- return cgit_fileurl(reponame,pagename,0,query);
+ return cgit_fileurl(reponame, pagename, 0, query);
if(rvbuf[sizeof(rvbuf)-1])
die("cgit_repobasename: truncated repository name '%s'", reponame);
p = strlen(rvbuf)-1;
/* strip trailing slashes */
if(rvbuf[sizeof(rvbuf)-1])
die("cgit_repobasename: truncated repository name '%s'", reponame);
p = strlen(rvbuf)-1;
/* strip trailing slashes */
-static void site_url(const char *page, const char *search, int ofs)
+static void site_url(const char *page, const char *search, const char *sort, int ofs)
}
static void site_link(const char *page, const char *name, const char *title,
}
static void site_link(const char *page, const char *name, const char *title,
- const char *class, const char *search, int ofs)
+ const char *class, const char *search, const char *sort, int ofs)
html("'>");
html_txt(name);
html("</a>");
}
void cgit_index_link(const char *name, const char *title, const char *class,
html("'>");
html_txt(name);
html("</a>");
}
void cgit_index_link(const char *name, const char *title, const char *class,
- site_link(NULL, name, title, class, pattern, ofs);
+ site_link(NULL, name, title, class, pattern, sort, ofs);
}
static char *repolink(const char *title, const char *class, const char *page,
}
static char *repolink(const char *title, const char *class, const char *page,
char *delim;
delim = repolink(title, class, "log", head, path);
char *delim;
delim = repolink(title, class, "log", head, path);
char *delim;
delim = repolink(title, class, "commit", head, path);
char *delim;
delim = repolink(title, class, "commit", head, path);
struct cgit_context *ctx)
{
if (!strcmp(ctx->qry.page, "repolist"))
struct cgit_context *ctx)
{
if (!strcmp(ctx->qry.page, "repolist"))
- return cgit_index_link(name, title, class, ctx->qry.search,
+ return cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort,
ctx->qry.ofs);
else if (!strcmp(ctx->qry.page, "summary"))
return cgit_summary_link(name, title, class, ctx->qry.head);
ctx->qry.ofs);
else if (!strcmp(ctx->qry.page, "summary"))
return cgit_summary_link(name, title, class, ctx->qry.head);
- cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
+ cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
ctx.qry.head, fullrev, NULL, 0);
return;
} else if (obj->type == OBJ_TREE)
ctx.qry.head, fullrev, NULL, 0);
return;
} else if (obj->type == OBJ_TREE)
- cgit_index_link("index", NULL, NULL, NULL, 0);
+ cgit_index_link("index", NULL, NULL, NULL, NULL, 0);
html(" : ");
cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL, NULL);
html("</td><td class='form'>");
html(" : ");
cgit_summary_link(ctx->repo->name, ctx->repo->name, NULL, NULL);
html("</td><td class='form'>");
- site_link(NULL, "index", NULL, hc(ctx, "repolist"), NULL, 0);
+ site_link(NULL, "index", NULL, hc(ctx, "repolist"), NULL, NULL, 0);
if (ctx->cfg.root_readme)
site_link("about", "about", NULL, hc(ctx, "about"),
if (ctx->cfg.root_readme)
site_link("about", "about", NULL, hc(ctx, "about"),
html("</td><td class='form'>");
html("<form method='get' action='");
html_attr(cgit_rooturl());
html("</td><td class='form'>");
html("<form method='get' action='");
html_attr(cgit_rooturl());