aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.h
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2016-09-12 22:54:08 -0500
committerJohn Keeping <john@keeping.me.uk>2016-10-01 11:51:07 +0100
commit1a66e7f3c15bf8d0d5d1b198c6674911a213779e (patch)
tree23f5d14af44ad63e1a9ad8c615fe622a0d4b52fe /cgit.h
parentui-repolist: provide hyperlinks on section names (diff)
downloadcgit-1a66e7f3c15bf8d0d5d1b198c6674911a213779e.tar.xz
cgit-1a66e7f3c15bf8d0d5d1b198c6674911a213779e.zip
ui-repolist: Allow sections to be collapsiblejk/collapsible-sections
The index page can be difficult to navigate for really large git servers. This change allows a configuration like: section-collapse=people section-collapse=tests And an index page would only display the "people" and "tests" section headers entries (not their repos) with a hyperlink that can be used to drill down into each section. Additionally the boolean logic around displaying sections in ui-repolist.c was simplified to eliminate an impossible condition. Signed-off-by: Andy Doan <andy.doan@linaro.org> Reviewed-by: John Keeping <john@keeping.me.uk> Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'cgit.h')
-rw-r--r--cgit.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/cgit.h b/cgit.h
index df42312..5d81fe8 100644
--- a/cgit.h
+++ b/cgit.h
@@ -75,6 +75,12 @@ struct cgit_exec_filter {
int pid;
};
+struct cgit_section {
+ unsigned int collapse : 1;
+ char *name;
+ struct cgit_section *next;
+};
+
struct cgit_repo {
char *url;
char *name;
@@ -85,7 +91,7 @@ struct cgit_repo {
char *defbranch;
char *module_link;
struct string_list readme;
- char *section;
+ struct cgit_section *section;
char *clone_url;
char *logo;
char *logo_link;
@@ -208,7 +214,7 @@ struct cgit_config {
char *root_desc;
char *root_readme;
char *script_name;
- char *section;
+ struct cgit_section *section;
char *repository_sort;
char *virtual_root; /* Always ends with '/'. */
char *strict_export;
@@ -305,6 +311,7 @@ struct cgit_context {
struct cgit_config cfg;
struct cgit_repo *repo;
struct cgit_page page;
+ struct cgit_section *sections;
};
typedef int (*write_archive_fn_t)(const char *, const char *);
@@ -322,6 +329,8 @@ extern struct cgit_repolist cgit_repolist;
extern struct cgit_context ctx;
extern const struct cgit_snapshot_format cgit_snapshot_formats[];
+extern struct cgit_section* get_or_create_section(const char *section);
+
extern char *cgit_default_repo_desc;
extern struct cgit_repo *cgit_add_repo(const char *url);
extern struct cgit_repo *cgit_get_repoinfo(const char *url);