summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2008-05-03 10:44:20 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-05-04 15:30:02 (UTC)
commit17890d0058c1555133c8767ceb123e809e6971ab (patch) (side-by-side diff)
treee20eac18444fd75f6e25f03b6622245ca848d0d6
parentaa3c4486b41b8b13d0f52477f033837fc8bb9524 (diff)
downloadcgit-17890d0058c1555133c8767ceb123e809e6971ab.zip
cgit-17890d0058c1555133c8767ceb123e809e6971ab.tar.gz
cgit-17890d0058c1555133c8767ceb123e809e6971ab.tar.bz2
Add link to index page from repo header, remove page name
This makes it more obvious how to get back to the index, especially when the config option `logo-link` is used. And the page name displayed in the header provided no extra information. It only consumed space and deserved to die. While at it, make sure that the different parts of the header doesn't wrap when horizontal space is limited. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.css3
-rw-r--r--ui-shared.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/cgit.css b/cgit.css
index fac5f85..a37d218 100644
--- a/cgit.css
+++ b/cgit.css
@@ -15,104 +15,107 @@ a {
color: blue;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
table {
border-collapse: collapse;
}
table#header {
width: 100%;
margin-bottom: 1em;
}
table#header td.logo {
width: 96px;
}
table#header td.main {
font-size: 250%;
padding-left: 10px;
+ white-space: nowrap;
}
table#header td.main a {
color: #000;
}
table#header td.form {
text-align: right;
vertical-align: bottom;
padding-right: 1em;
padding-bottom: 2px;
+ white-space: nowrap;
}
table#header td.form form,
table#header td.form input,
table#header td.form select {
font-size: 90%;
}
table#header td.sub {
color: #777;
border-top: solid 1px #ccc;
padding-left: 10px;
}
table.tabs {
/* border-bottom: solid 2px #ccc; */
border-collapse: collapse;
margin-top: 2em;
margin-bottom: 0px;
width: 100%;
}
table.tabs td {
padding: 0px 1em;
vertical-align: bottom;
}
table.tabs td a {
padding: 2px 0.75em;
color: #777;
font-size: 110%;
}
table.tabs td a.active {
color: #000;
background-color: #ccc;
}
table.tabs td.form {
text-align: right;
}
table.tabs td.form form {
padding-bottom: 2px;
font-size: 90%;
+ white-space: nowrap;
}
table.tabs td.form input,
table.tabs td.form select {
font-size: 90%;
}
div.content {
margin: 0px;
padding: 2em;
border-top: solid 3px #ccc;
border-bottom: solid 3px #ccc;
}
table.list {
width: 100%;
border: none;
border-collapse: collapse;
}
table.list tr {
background: white;
}
diff --git a/ui-shared.c b/ui-shared.c
index 44269a7..cd98387 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -524,52 +524,52 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
}
char *hc(struct cgit_cmd *cmd, const char *page)
{
return (strcmp(cmd->name, page) ? NULL : "active");
}
void cgit_print_pageheader(struct cgit_context *ctx)
{
struct cgit_cmd *cmd = cgit_get_cmd(ctx);
html("<table id='header'>\n");
html("<tr>\n");
html("<td class='logo' rowspan='2'><a href='");
if (ctx->cfg.logo_link)
html_attr(ctx->cfg.logo_link);
else
html_attr(cgit_rooturl());
html("'><img src='");
html_attr(ctx->cfg.logo);
html("' alt='cgit logo'/></a></td>\n");
html("<td class='main'>");
if (ctx->repo) {
+ cgit_index_link("index", NULL, NULL, NULL, 0);
+ html(" : ");
reporevlink(NULL, ctx->repo->name, NULL, hc(cmd, "summary"),
ctx->qry.head, NULL, NULL);
- html(" : ");
- html_txt(ctx->qry.page);
html("</td><td class='form'>");
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'/>");
html("</form>");
} else
html_txt(ctx->cfg.root_title);
html("</td></tr>\n");
html("<tr><td class='sub'");
if (ctx->repo) {
html(" colspan='2'>");
html_txt(ctx->repo->desc);
} else {
html(">");
if (ctx->cfg.root_desc)
html_txt(ctx->cfg.root_desc);
else if (ctx->cfg.index_info)
html_include(ctx->cfg.index_info);
}
html("</td></tr></table>\n");