2006-12-11 15:48:03 +00:00
|
|
|
/* ui-repolist.c: functions for generating the repolist page
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Lars Hjemli
|
|
|
|
*
|
|
|
|
* Licensed under GNU General Public License v2
|
|
|
|
* (see COPYING for full license text)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "cgit.h"
|
|
|
|
|
|
|
|
void cgit_print_repolist(struct cacheitem *item)
|
|
|
|
{
|
2007-02-03 14:02:55 +00:00
|
|
|
struct repoinfo *repo;
|
|
|
|
int i;
|
2006-12-11 15:48:03 +00:00
|
|
|
|
|
|
|
cgit_print_docstart(cgit_root_title, item);
|
2006-12-28 01:01:49 +00:00
|
|
|
cgit_print_pageheader(cgit_root_title, 0);
|
2006-12-11 15:48:03 +00:00
|
|
|
|
2006-12-22 00:44:32 +00:00
|
|
|
html("<table class='list nowrap'>");
|
2007-01-27 23:39:26 +00:00
|
|
|
html("<tr class='nohover'>"
|
2006-12-22 00:44:32 +00:00
|
|
|
"<th class='left'>Name</th>"
|
|
|
|
"<th class='left'>Description</th>"
|
|
|
|
"<th class='left'>Owner</th></tr>\n");
|
2006-12-11 15:48:03 +00:00
|
|
|
|
2007-02-03 14:02:55 +00:00
|
|
|
for (i=0; i<cgit_repolist.count; i++) {
|
|
|
|
repo = &cgit_repolist.repos[i];
|
2006-12-11 15:48:03 +00:00
|
|
|
html("<tr><td>");
|
2007-02-03 14:02:55 +00:00
|
|
|
html_link_open(cgit_repourl(repo->url), NULL, NULL);
|
|
|
|
html_txt(repo->name);
|
2006-12-11 15:48:03 +00:00
|
|
|
html_link_close();
|
|
|
|
html("</td><td>");
|
2007-02-03 14:02:55 +00:00
|
|
|
html_txt(repo->desc);
|
2006-12-11 15:48:03 +00:00
|
|
|
html("</td><td>");
|
2007-02-03 14:02:55 +00:00
|
|
|
html_txt(repo->owner);
|
2006-12-11 15:48:03 +00:00
|
|
|
html("</td></tr>\n");
|
|
|
|
}
|
|
|
|
html("</table>");
|
|
|
|
cgit_print_docend();
|
|
|
|
}
|