1 /* ui-repolist.c: functions for generating the repolist page
3 * Copyright (C) 2006 Lars Hjemli
5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text)
11 void cgit_print_repolist(struct cacheitem *item)
13 struct repoinfo *repo;
16 cgit_print_docstart(cgit_root_title, item);
17 cgit_print_pageheader(cgit_root_title, 0);
19 html("<table class='list nowrap'>");
20 if (cgit_index_header) {
21 html("<tr class='nohover'><td colspan='4' class='include-block'>");
22 html_include(cgit_index_header);
25 html("<tr class='nohover'>"
26 "<th class='left'>Name</th>"
27 "<th class='left'>Description</th>"
28 "<th class='left'>Owner</th>"
29 "<th class='left'>Links</th></tr>\n");
31 for (i=0; i<cgit_repolist.count; i++) {
32 repo = &cgit_repolist.repos[i];
34 html_link_open(cgit_repourl(repo->url), NULL, NULL);
38 html_ntxt(cgit_max_repodesc_len, repo->desc);
40 html_txt(repo->owner);
42 html_link_open(cgit_pageurl(repo->name, "commit", NULL),
43 "Commit: display last commit", NULL);
45 html_link_open(cgit_pageurl(repo->name, "diff", NULL),
46 "Diff: see changes introduced by last commit", NULL);
48 html_link_open(cgit_pageurl(repo->name, "log", NULL),
49 "Log: show history of the main branch", NULL);
51 html_link_open(cgit_pageurl(repo->name, "tree", NULL),
52 "Tree: browse the files in the main branch", NULL);