summaryrefslogtreecommitdiffstatshomepage
path: root/cgit.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cgit.c8
-rw-r--r--cgit.css104
2 files changed, 101 insertions, 11 deletions
diff --git a/cgit.c b/cgit.c
index f35f605..608cab6 100644
--- a/cgit.c
+++ b/cgit.c
@@ -12,6 +12,7 @@
#include "configfile.h"
#include "html.h"
#include "ui-shared.h"
+#include "ui-stats.h"
#include "scan-tree.h"
const char *cgit_version = CGIT_VERSION;
@@ -54,6 +55,8 @@ void config_cb(const char *name, const char *value)
ctx.cfg.enable_log_filecount = atoi(value);
else if (!strcmp(name, "enable-log-linecount"))
ctx.cfg.enable_log_linecount = atoi(value);
+ else if (!strcmp(name, "max-stats"))
+ ctx.cfg.max_stats = cgit_find_stats_period(value, NULL);
else if (!strcmp(name, "cache-size"))
ctx.cfg.cache_size = atoi(value);
else if (!strcmp(name, "cache-root"))
@@ -112,6 +115,8 @@ void config_cb(const char *name, const char *value)
ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value);
else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount"))
ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value);
+ else if (ctx.repo && !strcmp(name, "repo.max-stats"))
+ ctx.repo->max_stats = cgit_find_stats_period(value, NULL);
else if (ctx.repo && !strcmp(name, "repo.module-link"))
ctx.repo->module_link= xstrdup(value);
else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) {
@@ -158,6 +163,8 @@ static void querystring_cb(const char *name, const char *value)
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);
}
}
@@ -181,6 +188,7 @@ static void prepare_context(struct cgit_context *ctx)
ctx->cfg.max_lock_attempts = 5;
ctx->cfg.max_msg_len = 80;
ctx->cfg.max_repodesc_len = 80;
+ ctx->cfg.max_stats = 0;
ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
ctx->cfg.renamelimit = -1;
ctx->cfg.robots = "index, nofollow";
diff --git a/cgit.css b/cgit.css
index be3b1d0..957d5aa 100644
--- a/cgit.css
+++ b/cgit.css
@@ -236,26 +236,31 @@ table.blob {
border-top: solid 1px black;
}
-table.blob td.no {
- border-right: solid 1px black;
+table.blob td.lines {
+ margin: 0; padding: 0;
+ vertical-align: top;
color: black;
+}
+
+table.blob td.linenumbers {
+ margin: 0; padding: 0;
+ vertical-align: top;
+ border-right: 1px solid gray;
background-color: #eee;
- text-align: right;
}
-table.blob td.no a {
- color: black;
+table.blob pre {
+ padding: 0; margin: 0;
}
-table.blob td.no a:hover {
- color: black;
+table.blob a.no {
+ color: gray;
+ text-align: right;
text-decoration: none;
}
-table.blob td.txt {
- white-space: pre;
- font-family: monospace;
- padding-left: 0.5em;
+table.blob a.no a:hover {
+ color: black;
}
table.nowrap td {
@@ -500,3 +505,80 @@ div.commit-subject a {
margin-left: 1em;
font-size: 75%;
}
+
+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;
+}