diff --git a/routers/web/explore/user.go b/routers/web/explore/user.go index 5973a4e066..ccfce1a3ff 100644 --- a/routers/web/explore/user.go +++ b/routers/web/explore/user.go @@ -6,6 +6,8 @@ package explore import ( "bytes" + "code.gitea.io/gitea/modules/markup" + "code.gitea.io/gitea/modules/markup/markdown" "net/http" "code.gitea.io/gitea/models/db" @@ -78,6 +80,20 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions, ctx.Data["Keyword"] = opts.Keyword ctx.Data["Total"] = count ctx.Data["Users"] = users + var renderedCompetences = make(map[int64]string) + for _, user := range users { + renderedCompetences[user.ID], err = markdown.RenderString(&markup.RenderContext{ + URLPrefix: ctx.Repo.RepoLink, + Metas: map[string]string{"mode": "document"}, + GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, + }, user.Competences) + if err != nil { + ctx.ServerError("RenderCompetences", err) + return + } + } + ctx.Data["RenderedCompetences"] = renderedCompetences ctx.Data["UsersTwoFaStatus"] = user_model.UserList(users).GetTwoFaStatus() ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled diff --git a/templates/explore/competences.tmpl b/templates/explore/competences.tmpl index 7b9382d5a4..91fece10f9 100644 --- a/templates/explore/competences.tmpl +++ b/templates/explore/competences.tmpl @@ -20,6 +20,10 @@ {{.Email}} {{end}} {{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}} + {{if .Competences}} +