summaryrefslogtreecommitdiff
path: root/ui-repolist.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-05-18 22:48:22 +0200
committerLars Hjemli <hjemli@gmail.com>2007-05-18 22:51:18 +0200
commit5877c49f68b1e1bef94b4867f22c336f0e1605b6 (patch)
tree4e628096d9f189b7ef5ff9dcda40a07a5f7b21d0 /ui-repolist.c
parent08cc2e5f0e24773dad81d38bd6b689e36afe9dda (diff)
downloadcgit-5877c49f68b1e1bef94b4867f22c336f0e1605b6.tar.gz
cgit-5877c49f68b1e1bef94b4867f22c336f0e1605b6.tar.bz2
cgit-5877c49f68b1e1bef94b4867f22c336f0e1605b6.zip
Teach cgit how to group repositories by category
The new parameter 'repo.group' is used to set the repository group for the following repositores. Whenever this parameter changes value, a subheading is generated in the index page (printing the current value of repo.group). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-repolist.c')
-rw-r--r--ui-repolist.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index d7311e4..a884c20 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -12,6 +12,7 @@ void cgit_print_repolist(struct cacheitem *item)
{
struct repoinfo *repo;
int i;
+ char *last_group = NULL;
cgit_print_docstart(cgit_root_title, item);
cgit_print_pageheader(cgit_root_title, 0);
@@ -25,6 +26,15 @@ void cgit_print_repolist(struct cacheitem *item)
for (i=0; i<cgit_repolist.count; i++) {
repo = &cgit_repolist.repos[i];
+ if ((last_group == NULL && repo->group != NULL) ||
+ (last_group != NULL && repo->group == NULL) ||
+ (last_group != NULL && repo->group!= NULL &&
+ strcmp(repo->group, last_group))) {
+ html("<tr><td colspan='4' class='repogroup'>");
+ html_txt(repo->group);
+ html("</td></tr>");
+ last_group = repo->group;
+ }
html("<tr><td>");
html_link_open(cgit_repourl(repo->url), NULL, NULL);
html_txt(repo->name);
='5' class='logmsg'> 2020-05-10Allow options on group level.René 'Necoro' Neumann3-5/+11 Closes #12. 2020-05-10Renamed feed template to html templateRené 'Necoro' Neumann2-2/+2 2020-05-10Release v0.2.0v0.2.0René 'Necoro' Neumann2-2/+6 2020-05-10Fix building cacheRené 'Necoro' Neumann1-1/+3 2020-05-10Update READMERené 'Necoro' Neumann1-5/+44 2020-05-10Ignore 'dist' folder and build productsRené 'Necoro' Neumann1-0/+2 2020-05-08Print item hashes in debug modeRené 'Necoro' Neumann1-1/+7 2020-05-07Improve html renderingRené 'Necoro' Neumann2-53/+32 2020-05-07Do not assume items to be new when their published date is newer than the ↵René 'Necoro' Neumann2-7/+1 last run 2020-05-07Updating some depsRené 'Necoro' Neumann2-2/+7 2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12