2006-12-11 16:48:03 +01: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 15:02:55 +01:00
|
|
|
struct repoinfo *repo;
|
|
|
|
int i;
|
2006-12-11 16:48:03 +01:00
|
|
|
|
|
|
|
cgit_print_docstart(cgit_root_title, item);
|
2006-12-28 02:01:49 +01:00
|
|
|
cgit_print_pageheader(cgit_root_title, 0);
|
2006-12-11 16:48:03 +01:00
|
|
|
|
2006-12-22 01:44:32 +01:00
|
|
|
html("<table class='list nowrap'>");
|
2007-01-28 00:39:26 +01:00
|
|
|
html("<tr class='nohover'>"
|
2006-12-22 01:44:32 +01:00
|
|
|
"<th class='left'>Name</th>"
|
|
|
|
"<th class='left'>Description</th>"
|
2007-05-16 02:12:06 +02:00
|
|
|
"<th class='left'>Owner</th>"
|
|
|
|
"<th class='left'>Links</th></tr>\n");
|
2006-12-11 16:48:03 +01:00
|
|
|
|
2007-02-03 15:02:55 +01:00
|
|
|
for (i=0; i<cgit_repolist.count; i++) {
|
|
|
|
repo = &cgit_repolist.repos[i];
|
2006-12-11 16:48:03 +01:00
|
|
|
html("<tr><td>");
|
2007-02-03 15:02:55 +01:00
|
|
|
html_link_open(cgit_repourl(repo->url), NULL, NULL);
|
|
|
|
html_txt(repo->name);
|
2006-12-11 16:48:03 +01:00
|
|
|
html_link_close();
|
|
|
|
html("</td><td>");
|
2007-05-16 10:45:45 +02:00
|
|
|
html_ntxt(cgit_max_repodesc_len, repo->desc);
|
2006-12-11 16:48:03 +01:00
|
|
|
html("</td><td>");
|
2007-02-03 15:02:55 +01:00
|
|
|
html_txt(repo->owner);
|
2007-05-16 02:12:06 +02:00
|
|
|
html("</td><td>");
|
|
|
|
html_link_open(cgit_pageurl(repo->name, "commit", NULL),
|
|
|
|
"Commit: display last commit", NULL);
|
|
|
|
html("C</a> ");
|
|
|
|
html_link_open(cgit_pageurl(repo->name, "diff", NULL),
|
|
|
|
"Diff: see changes introduced by last commit", NULL);
|
|
|
|
html("D</a> ");
|
|
|
|
html_link_open(cgit_pageurl(repo->name, "log", NULL),
|
|
|
|
"Log: show history of the main branch", NULL);
|
|
|
|
html("L</a> ");
|
|
|
|
html_link_open(cgit_pageurl(repo->name, "tree", NULL),
|
|
|
|
"Tree: browse the files in the main branch", NULL);
|
|
|
|
html("T</a>");
|
2006-12-11 16:48:03 +01:00
|
|
|
html("</td></tr>\n");
|
|
|
|
}
|
|
|
|
html("</table>");
|
|
|
|
cgit_print_docend();
|
|
|
|
}
|