summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.css10
-rw-r--r--ui-shared.c7
2 files changed, 17 insertions, 0 deletions
diff --git a/cgit.css b/cgit.css
index 67cf48e..80680c9 100644
--- a/cgit.css
+++ b/cgit.css
@@ -23,76 +23,86 @@ a:hover {
table {
border-collapse: collapse;
}
table#header {
width: 100%;
margin-bottom: 1em;
}
table#header td.logo {
width: 96px;
}
table#header td.main {
font-size: 200%;
}
table#header td.sub {
color: #777;
border-top: solid 1px #ccc;
}
table.tabs {
border-bottom: solid 2px #ccc;
border-collapse: collapse;
margin-top: 2em;
margin-bottom: 1em;
width: 100%;
}
table.tabs td {
padding: 0px 0.5em;
+ vertical-align: bottom;
}
table.tabs td a {
padding: 2px 1em;
color: #007;
}
table.tabs td a.active {
color: #000;
background-color: #ccc;
}
+table.tabs td.branch {
+ text-align: right;
+}
+
+table.tabs td.branch form {
+ padding-bottom: 2px;
+ font-size: 90%;
+}
+
div.content {
margin: 0px;
padding: 1em;
}
table.list {
width: 100%;
border: none;
border-collapse: collapse;
}
table.list tr {
background: white;
}
table.list tr:hover {
background: #eee;
}
table.list tr.nohover:hover {
background: white;
}
table.list th {
font-weight: normal;
border-bottom: solid 1px #ccc;
padding: 0.1em 0.5em 0.1em 0.5em;
vertical-align: baseline;
}
table.list td {
diff --git a/ui-shared.c b/ui-shared.c
index 03d147f..73e3d4c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -489,64 +489,71 @@ void cgit_print_pageheader(struct cgit_context *ctx)
if (ctx->repo) {
html("<a href='");
html_attr(cgit_rooturl());
html("'>index</a> / ");
html_txt(ctx->repo->name);
} else
html_txt(ctx->cfg.root_title);
html("</td></tr>\n");
html("<tr><td class='sub'>");
if (ctx->repo)
html_txt(ctx->repo->desc);
else
html_txt(ctx->cfg.index_info);
html("</td></tr>\n");
html("</table>\n");
html("<table class='tabs'><tr><td>\n");
if (ctx->repo) {
reporevlink(NULL, "summary", NULL, hc(cmd, "summary"),
ctx->qry.head, NULL, NULL);
cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head,
ctx->qry.sha1, NULL);
cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head,
NULL, NULL, 0, NULL, NULL);
cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head,
ctx->qry.sha1, NULL);
cgit_commit_link("commit", NULL, hc(cmd, "commit"),
ctx->qry.head, ctx->qry.sha1);
cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head,
ctx->qry.sha1, ctx->qry.sha2, NULL);
cgit_patch_link("patch", NULL, hc(cmd, "patch"), ctx->qry.head,
ctx->qry.sha1);
+ html("</td><td class='branch'>");
+ html("<form method='get' action=''>\n");
+ add_hidden_formfields(0, 1, ctx->qry.page);
+ html("<select name='h' onchange='this.form.submit();'>\n");
+ for_each_branch_ref(print_branch_option, ctx->qry.head);
+ html("</select> ");
+ html("<input type='submit' name='' value='switch'/>");
} else {
html("<a class='active' href='");
html_attr(cgit_rooturl());
html("'>index</a>\n");
}
html("</td></tr></table>\n");
html("<div class='content'>");
}
void cgit_print_filemode(unsigned short mode)
{
if (S_ISDIR(mode))
html("d");
else if (S_ISLNK(mode))
html("l");
else if (S_ISGITLINK(mode))
html("m");
else
html("-");
html_fileperm(mode >> 6);
html_fileperm(mode >> 3);
html_fileperm(mode);
}
void cgit_print_snapshot_links(const char *repo, const char *head,
const char *hex, int snapshots)
{
const struct cgit_snapshot_format* f;
char *filename;
for (f = cgit_snapshot_formats; f->suffix; f++) {
if (!(snapshots & f->bit))