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-05-18 22:00:25 +00:00
|
|
|
if (cgit_index_header) {
|
|
|
|
html("<tr class='nohover'><td colspan='4' class='include-block'>");
|
|
|
|
html_include(cgit_index_header);
|
|
|
|
html("</td></tr>");
|
|
|
|
}
|
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>"
|
2007-05-16 00:12:06 +00:00
|
|
|
"<th class='left'>Owner</th>"
|
|
|
|
"<th class='left'>Links</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-05-16 08:45:45 +00:00
|
|
|
html_ntxt(cgit_max_repodesc_len, 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);
|
2007-05-16 00:12:06 +00: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 15:48:03 +00:00
|
|
|
html("</td></tr>\n");
|
|
|
|
}
|
|
|
|
html("</table>");
|
|
|
|
cgit_print_docend();
|
|
|
|
}
|