Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Print each person through one helper
The log, refs and tag pages no longer open a filter of their own, so they stop including filter.h.
Diffstat (limited to 'source/ui-shared.c')
-rw-r--r--source/ui-shared.c12
1 file changed, 12 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index fc4e559..8c5e4e5 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -11,6 +11,7 @@
#include "cache.h"
#include "cgit.h"
+#include "filter.h"
#include "html.h"
#include "shared.h"
#include "submodule-config.h"
@@ -1307,6 +1308,17 @@ void cgit_print_age(time_t t, int tz, time_t max_relative)
print_rel_date(t, tz, secs * 1.0 / SECONDS_PER_YEAR, "age-years", "years");
}
+void cgit_print_person(const char *name, const char *email, const char *origin, int show_email)
+{
+ cgit_open_filter(ctx.repo->email_filter, email ? email : "", origin);
+ html_txt(name);
+ if (show_email && email && ctx.cfg.enable_plain_email) {
+ html(" ");
+ html_txt(email);
+ }
+ cgit_close_filter(ctx.repo->email_filter);
+}
+
/*
* Whether a content type carries text a charset applies to, which is every
* text type and the XML types of RFC 7303, the atom feed among them.