ctx.qry.name = xstrdup(value);
} else if (!strcmp(name, "mimetype")) {
ctx.qry.mimetype = xstrdup(value);
+ } else if (!strcmp(name, "s")){
+ ctx.qry.sort = xstrdup(value);
+ } else if (!strcmp(name, "showmsg")) {
+ ctx.qry.showmsg = atoi(value);
+ } else if (!strcmp(name, "period")) {
+ ctx.qry.period = xstrdup(value);
}
}
font-size: 80%;
color: #ccc;
}
-
+a.branch-deco {
+ margin: 0px 0.5em;
+ padding: 0px 0.25em;
+ background-color: #88ff88;
+ border: solid 1px #007700;
+}
+a.tag-deco {
+ margin: 0px 0.5em;
+ padding: 0px 0.25em;
+ background-color: #ffff88;
+ border: solid 1px #777700;
+}
+a.remote-deco {
+ margin: 0px 0.5em;
+ padding: 0px 0.25em;
+ background-color: #ccccff;
+ border: solid 1px #000077;
+}
+a.deco {
+ margin: 0px 0.5em;
+ padding: 0px 0.25em;
+ background-color: #ff8888;
+ border: solid 1px #770000;
+}
+ table.stats {
+ border: solid 1px black;
+ border-collapse: collapse;
+ }
+
+ table.stats th {
+ text-align: left;
+ padding: 1px 0.5em;
+ background-color: #eee;
+ border: solid 1px black;
+ }
+
+ table.stats td {
+ text-align: right;
+ padding: 1px 0.5em;
+ border: solid 1px black;
+ }
+
+ table.stats td.total {
+ font-weight: bold;
+ text-align: left;
+ }
+
+ table.stats td.sum {
+ color: #c00;
+ font-weight: bold;
+ /* background-color: #eee; */
+ }
+
+ table.stats td.left {
+ text-align: left;
+ }
+
+ table.vgraph {
+ border-collapse: separate;
+ border: solid 1px black;
+ height: 200px;
+ }
+
+ table.vgraph th {
+ background-color: #eee;
+ font-weight: bold;
+ border: solid 1px white;
+ padding: 1px 0.5em;
+ }
+
+ table.vgraph td {
+ vertical-align: bottom;
+ padding: 0px 10px;
+ }
+
+ table.vgraph div.bar {
+ background-color: #eee;
+ }
+
+ table.hgraph {
+ border: solid 1px black;
+ width: 800px;
+ }
+
+ table.hgraph th {
+ background-color: #eee;
+ font-weight: bold;
+ border: solid 1px black;
+ padding: 1px 0.5em;
+ }
+
+ table.hgraph td {
+ vertical-align: center;
+ padding: 2px 2px;
+ }
+
+ table.hgraph div.bar {
+ background-color: #eee;
+ height: 1em;
+ }
int snapshots;
int enable_log_filecount;
int enable_log_linecount;
+ int max_stats;
+ time_t mtime;
};
struct cgit_repolist {
char *name;
char *mimetype;
char *url;
+ char *period;
int ofs;
int nohead;
+ char *sort;
+ int showmsg;
};
struct cgit_config {
ret->snapshots = ctx.cfg.snapshots;
ret->enable_log_filecount = ctx.cfg.enable_log_filecount;
ret->enable_log_linecount = ctx.cfg.enable_log_linecount;
+ ret->max_stats = ctx.cfg.max_stats;
ret->module_link = ctx.cfg.module_link;
ret->readme = NULL;
+ ret->mtime = -1;
return ret;
}
reporevlink("patch", name, title, class, head, rev, NULL);
}
+ void cgit_stats_link(char *name, char *title, char *class, char *head,
+ char *path)
+ {
+ reporevlink("stats", name, title, class, head, NULL, path);
+ }
+
void cgit_object_link(struct object *obj)
{
- char *page, *rev, *name;
+ char *page, *shortrev, *fullrev, *name;
+ fullrev = sha1_to_hex(obj->sha1);
+ shortrev = xstrdup(fullrev);
+ shortrev[10] = '\0';
if (obj->type == OBJ_COMMIT) {
- cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL,
- ctx.qry.head, sha1_to_hex(obj->sha1));
+ cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
+ ctx.qry.head, fullrev);
return;
} else if (obj->type == OBJ_TREE)
page = "tree";
html("<td>");
cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev,
- fullpath, 0, NULL, NULL);
+ fullpath, 0, NULL, NULL, ctx.qry.showmsg);
+ if (ctx.repo->max_stats)
+ cgit_stats_link("stats", NULL, "button", ctx.qry.head,
+ fullpath);
html("</td></tr>\n");
free(name);
return 0;