diff options
Diffstat (limited to 'ui_70-log.c')
-rw-r--r-- | ui_70-log.c | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/ui_70-log.c b/ui_70-log.c index d696e20..598634d 100644 --- a/ui_70-log.c +++ b/ui_70-log.c @@ -9,7 +9,7 @@ #include "cgit.h" #include "ui-log.h" #include "html.h" -#include "ui-shared.h" +#include "ui_70-shared.h" #include "argv-array.h" static int files, add_lines, rem_lines, lines_counted; @@ -196,22 +196,18 @@ static void print_commit(struct commit *commit, struct rev_info *revs) } info = cgit_parse_commit(commit); - htmlf("<tr%s>", ctx.qry.showmsg ? " class='logheader'" : ""); + + cgit_gopher_start_selector(GOPHER_MENU); if (revs->graph) { /* Print graph segment for current commit */ - html("<td class='commitgraph'>"); - html(graphbuf.buf); - html("</td>"); + cgit_gopher_text(graphbuf.buf); strbuf_setlen(&graphbuf, 0); } else { - html("<td>"); cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2); - html("</td>"); } - htmlf("<td%s>", ctx.qry.showmsg ? " class='logsubject'" : ""); if (ctx.qry.showmsg) { /* line-wrap long commit subjects instead of truncating them */ size_t subject_len = strlen(info->subject); @@ -237,13 +233,13 @@ static void print_commit(struct commit *commit, struct rev_info *revs) strcpy(info->subject + i, wrap_symbol); } } + cgit_gopher_text_pad(info->subject, GOPHER_SUMMARY_DESC_LEN + 1); + cgit_gopher_text_pad(info->author, GOPHER_SUMMARY_NAME_LEN); + cgit_gopher_tab(); cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); - show_commit_decorations(commit); - html("</td><td>"); - cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); - html_txt(info->author); - cgit_close_filter(ctx.repo->email_filter); + + cgit_gopher_end_selector(); if (revs->graph) { html("</td><td>"); @@ -258,13 +254,12 @@ static void print_commit(struct commit *commit, struct rev_info *revs) cgit_diff_commit(commit, inspect_files, ctx.qry.vpath); } - if (ctx.repo->enable_log_filecount) +/* if (ctx.repo->enable_log_filecount) htmlf("</td><td>%d", files); if (ctx.repo->enable_log_linecount) htmlf("</td><td><span class='deletions'>-%d</span>/" "<span class='insertions'>+%d</span>", rem_lines, add_lines); - - html("</td></tr>\n"); +*/ if ((revs->graph && !graph_is_commit_finished(revs->graph)) || ctx.qry.showmsg) { /* Print a second table row */ @@ -451,16 +446,16 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern if (pager) { cgit_print_layout_start(); - html("<table class='list nowrap'>"); + /*html("<table class='list nowrap'>");*/ } - html("<tr class='nohover'>"); + cgit_gopher_start_selector(GOPHER_INFO); if (commit_graph) - html("<th></th>"); + cgit_gopher_text_pad("", GOPHER_SUMMARY_DATE_LEN); else - html("<th class='left'>Age</th>"); - html("<th class='left'>Commit message"); - if (pager) { + cgit_gopher_text_pad("Age", GOPHER_SUMMARY_DATE_LEN); + cgit_gopher_text_pad("Commit message", GOPHER_SUMMARY_DESC_LEN); + /*if (pager) { html(" ("); cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, NULL, ctx.qry.head, ctx.qry.sha1, @@ -468,19 +463,21 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern ctx.qry.search, ctx.qry.showmsg ? 0 : 1, ctx.qry.follow); html(")"); - } - html("</th><th class='left'>Author</th>"); + }*/ + cgit_gopher_text_pad("Author", GOPHER_SUMMARY_NAME_LEN); if (rev.graph) - html("<th class='left'>Age</th>"); + cgit_gopher_text_pad("Age", GOPHER_SUMMARY_AGE_LEN); if (ctx.repo->enable_log_filecount) { - html("<th class='left'>Files</th>"); + cgit_gopher_text_pad("Files", GOPHER_SUMMARY_MODE_LEN); columns++; } if (ctx.repo->enable_log_linecount) { - html("<th class='left'>Lines</th>"); + cgit_gopher_text_pad("Lines", GOPHER_SUMMARY_MODE_LEN); columns++; } - html("</tr>\n"); + cgit_gopher_tab(); + cgit_gopher_selector_link("Err"); + cgit_gopher_end_selector(); if (ofs<0) ofs = 0; @@ -515,7 +512,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern commit->parents = NULL; } if (pager) { - html("</table><ul class='pager'>"); if (ofs > 0) { html("<li>"); cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, @@ -534,7 +530,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern ctx.qry.follow); html("</li>"); } - html("</ul>"); cgit_print_layout_end(); } else if ((commit = get_revision(&rev)) != NULL) { htmlf("<tr class='nohover'><td colspan='%d'>", columns); |