From 58fcffcc0813233a1f3ed798bf8a4ff83cfb89fb Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Sat, 28 Jul 2018 17:02:07 +0100 Subject: log added (still incomplete) --- ui_70-log.c | 55 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 30 deletions(-) (limited to 'ui_70-log.c') 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("", ctx.qry.showmsg ? " class='logheader'" : ""); + + cgit_gopher_start_selector(GOPHER_MENU); if (revs->graph) { /* Print graph segment for current commit */ - html(""); - html(graphbuf.buf); - html(""); + cgit_gopher_text(graphbuf.buf); strbuf_setlen(&graphbuf, 0); } else { - html(""); cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2); - html(""); } - htmlf("", 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(""); - 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(""); @@ -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("%d", files); if (ctx.repo->enable_log_linecount) htmlf("-%d/" "+%d", rem_lines, add_lines); - - html("\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(""); + /*html("
");*/ } - html(""); + cgit_gopher_start_selector(GOPHER_INFO); if (commit_graph) - html(""); + cgit_gopher_text_pad("", GOPHER_SUMMARY_DATE_LEN); else - html(""); - html(""); + }*/ + cgit_gopher_text_pad("Author", GOPHER_SUMMARY_NAME_LEN); if (rev.graph) - html(""); + cgit_gopher_text_pad("Age", GOPHER_SUMMARY_AGE_LEN); if (ctx.repo->enable_log_filecount) { - html(""); + cgit_gopher_text_pad("Files", GOPHER_SUMMARY_MODE_LEN); columns++; } if (ctx.repo->enable_log_linecount) { - html(""); + cgit_gopher_text_pad("Lines", GOPHER_SUMMARY_MODE_LEN); columns++; } - html("\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("
AgeCommit 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("AuthorAgeFilesLines
    "); if (ofs > 0) { html("
  • "); 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("
  • "); } - html("
"); cgit_print_layout_end(); } else if ((commit = get_revision(&rev)) != NULL) { htmlf("", columns); -- cgit v1.2.3