blob: d341193c1d727b4c61829d4bd890f22dfc02ea5a [file] [log] [blame]
Lars Hjemli74620f12006-12-11 16:48:03 +01001/* ui-repolist.c: functions for generating the repolist page
2 *
3 * Copyright (C) 2006 Lars Hjemli
4 *
5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text)
7 */
8
9#include "cgit.h"
10
11void cgit_print_repolist(struct cacheitem *item)
12{
Lars Hjemlice1c7332007-02-03 15:02:55 +010013 struct repoinfo *repo;
14 int i;
Lars Hjemli74620f12006-12-11 16:48:03 +010015
Lars Hjemli74620f12006-12-11 16:48:03 +010016 cgit_print_docstart(cgit_root_title, item);
Lars Hjemlie39d7382006-12-28 02:01:49 +010017 cgit_print_pageheader(cgit_root_title, 0);
Lars Hjemli74620f12006-12-11 16:48:03 +010018
Lars Hjemlic43f1242006-12-22 01:44:32 +010019 html("<table class='list nowrap'>");
Lars Hjemli777faf72007-01-28 00:39:26 +010020 html("<tr class='nohover'>"
Lars Hjemlic43f1242006-12-22 01:44:32 +010021 "<th class='left'>Name</th>"
22 "<th class='left'>Description</th>"
Lars Hjemli8f6f8c32007-05-16 02:12:06 +020023 "<th class='left'>Owner</th>"
24 "<th class='left'>Links</th></tr>\n");
Lars Hjemli74620f12006-12-11 16:48:03 +010025
Lars Hjemlice1c7332007-02-03 15:02:55 +010026 for (i=0; i<cgit_repolist.count; i++) {
27 repo = &cgit_repolist.repos[i];
Lars Hjemli74620f12006-12-11 16:48:03 +010028 html("<tr><td>");
Lars Hjemlice1c7332007-02-03 15:02:55 +010029 html_link_open(cgit_repourl(repo->url), NULL, NULL);
30 html_txt(repo->name);
Lars Hjemli74620f12006-12-11 16:48:03 +010031 html_link_close();
32 html("</td><td>");
Lars Hjemlice1c7332007-02-03 15:02:55 +010033 html_txt(repo->desc);
Lars Hjemli74620f12006-12-11 16:48:03 +010034 html("</td><td>");
Lars Hjemlice1c7332007-02-03 15:02:55 +010035 html_txt(repo->owner);
Lars Hjemli8f6f8c32007-05-16 02:12:06 +020036 html("</td><td>");
37 html_link_open(cgit_pageurl(repo->name, "commit", NULL),
38 "Commit: display last commit", NULL);
39 html("C</a> ");
40 html_link_open(cgit_pageurl(repo->name, "diff", NULL),
41 "Diff: see changes introduced by last commit", NULL);
42 html("D</a> ");
43 html_link_open(cgit_pageurl(repo->name, "log", NULL),
44 "Log: show history of the main branch", NULL);
45 html("L</a> ");
46 html_link_open(cgit_pageurl(repo->name, "tree", NULL),
47 "Tree: browse the files in the main branch", NULL);
48 html("T</a>");
Lars Hjemli74620f12006-12-11 16:48:03 +010049 html("</td></tr>\n");
50 }
Lars Hjemli74620f12006-12-11 16:48:03 +010051 html("</table>");
52 cgit_print_docend();
53}