mirror of
https://git.zx2c4.com/cgit
synced 2025-07-13 03:34:40 +02:00
ui-repolist: Allow sections to be collapsible
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>
This commit is contained in:
parent
84b158abe0
commit
1a66e7f3c1
6 changed files with 63 additions and 24 deletions
13
cgit.h
13
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue