Introduce 'section' as canonical spelling for 'repo.group'

The 'repo.' prefix should be reserved for repo-specific options, but
the option 'repo.group' must still be honored to stay backwards
compatible.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
Lars Hjemli
2009-08-23 22:58:39 +02:00
parent 50d5af3adc
commit e7af002d5c
6 changed files with 22 additions and 17 deletions

View File

@ -203,7 +203,7 @@ int sort_repolist(char *field)
void cgit_print_repolist()
{
int i, columns = 4, hits = 0, header = 0;
char *last_group = NULL;
char *last_section = NULL;
int sorted = 0;
if (ctx.cfg.enable_index_links)
@ -233,18 +233,18 @@ void cgit_print_repolist()
if (!header++)
print_header(columns);
if (!sorted &&
((last_group == NULL && ctx.repo->group != NULL) ||
(last_group != NULL && ctx.repo->group == NULL) ||
(last_group != NULL && ctx.repo->group != NULL &&
strcmp(ctx.repo->group, last_group)))) {
htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>",
((last_section == NULL && ctx.repo->section != NULL) ||
(last_section != NULL && ctx.repo->section == NULL) ||
(last_section != NULL && ctx.repo->section != NULL &&
strcmp(ctx.repo->section, last_section)))) {
htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>",
columns);
html_txt(ctx.repo->group);
html_txt(ctx.repo->section);
html("</td></tr>");
last_group = ctx.repo->group;
last_section = ctx.repo->section;
}
htmlf("<tr><td class='%s'>",
!sorted && ctx.repo->group ? "sublevel-repo" : "toplevel-repo");
!sorted && ctx.repo->section ? "sublevel-repo" : "toplevel-repo");
cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
html("</td><td>");
html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL);