diff options
author | lookshe <github@lookshe.org> | 2016-02-01 13:26:29 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-02-01 13:26:29 +0100 |
commit | 36a1d663a66e0e6226d55f477287578d867c6fb8 (patch) | |
tree | ff7e3c217fd589eb36e137b0eba0821b403fb6f0 | |
parent | 86ff85e75af635b3700b221625dfca4c7002218f (diff) |
added link to author (similar to gitweb)
-rw-r--r-- | ui-log.c | 2 | ||||
-rw-r--r-- | ui-refs.c | 2 | ||||
-rw-r--r-- | ui-shared.c | 12 | ||||
-rw-r--r-- | ui-shared.h | 1 | ||||
-rw-r--r-- | ui-stats.c | 2 |
5 files changed, 16 insertions, 3 deletions
@@ -237,7 +237,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) show_commit_decorations(commit); html("</td><td>"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); - html_txt(info->author); + cgit_author_link(info->author); cgit_close_filter(ctx.repo->email_filter); if (revs->graph) { @@ -70,7 +70,7 @@ static int print_branch(struct refinfo *ref) cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL); html("</td><td>"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs"); - html_txt(info->author); + cgit_author_link(info->author); cgit_close_filter(ctx.repo->email_filter); html("</td><td colspan='2'>"); cgit_print_age(info->commit->date, -1, NULL); diff --git a/ui-shared.c b/ui-shared.c index 54bbde7..037d250 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1104,3 +1104,15 @@ void cgit_print_snapshot_links(const char *repo, const char *head, } strbuf_release(&filename); } + +extern void cgit_author_link(char *author) +{ + char *delim; + + delim = repolink(NULL, NULL, "log", NULL, NULL); + html(delim); + htmlf("qt=author&q=%s", author); + html("'>"); + html_txt(author); + html("</a>"); +} diff --git a/ui-shared.h b/ui-shared.h index de08e1b..a82cd47 100644 --- a/ui-shared.h +++ b/ui-shared.h @@ -75,4 +75,5 @@ extern void cgit_print_snapshot_links(const char *repo, const char *head, const char *hex, int snapshots); extern void cgit_add_hidden_formfields(int incl_head, int incl_search, const char *page); +extern void cgit_author_link(char *author); #endif /* UI_SHARED_H */ @@ -326,7 +326,7 @@ static void print_authors(struct string_list *authors, int top, for (i = 0; i < top; i++) { author = &authors->items[i]; html("<tr><td class='left'>"); - html_txt(author->string); + cgit_author_link(author->string); html("</td>"); authorstat = author->util; items = &authorstat->list; |