]> gitweb.ps.run Git - ps-cgit/blob - ui-repolist.c
Use tables and css to create the diffstat graph, fix scaling
[ps-cgit] / ui-repolist.c
1 /* 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
11 void cgit_print_repolist(struct cacheitem *item)
12 {
13         struct repoinfo *repo;
14         int i;
15
16         cgit_print_docstart(cgit_root_title, item);
17         cgit_print_pageheader(cgit_root_title, 0);
18
19         html("<table class='list nowrap'>");
20         html("<tr class='nohover'>"
21              "<th class='left'>Name</th>"
22              "<th class='left'>Description</th>"
23              "<th class='left'>Owner</th></tr>\n");
24
25         for (i=0; i<cgit_repolist.count; i++) {
26                 repo = &cgit_repolist.repos[i];
27                 html("<tr><td>");
28                 html_link_open(cgit_repourl(repo->url), NULL, NULL);
29                 html_txt(repo->name);
30                 html_link_close();
31                 html("</td><td>");
32                 html_txt(repo->desc);
33                 html("</td><td>");
34                 html_txt(repo->owner);
35                 html("</td></tr>\n");
36         }
37         html("</table>");
38         cgit_print_docend();
39 }