From f29b079f3c939395623ff7e9faf112a4a9433d88 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Wed, 31 Aug 2022 18:19:53 +0500 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=D1=8F=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=BB=D0=B8=D1=87=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?,=20=D1=83=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=BF=D0=BE=20=D0=B0=D0=BB=D1=84?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D1=82=D1=83=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=20#106?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/web/explore/competence.go | 14 ++++++++++++-- templates/explore/competences.tmpl | 21 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/routers/web/explore/competence.go b/routers/web/explore/competence.go index d65ecc453d..0fb9d90067 100644 --- a/routers/web/explore/competence.go +++ b/routers/web/explore/competence.go @@ -1,10 +1,13 @@ package explore import ( + "code.gitea.io/gitea/models/db" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" - "net/http" + "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/util" ) const ( @@ -18,5 +21,12 @@ func Competences(ctx *context.Context) { ctx.Data["PageIsExplore"] = true ctx.Data["PageIsExploreCompetences"] = true - ctx.HTML(http.StatusOK, tplExploreCompetences) + RenderUserSearch(ctx, &user_model.SearchUserOptions{ + Actor: ctx.User, + Type: user_model.UserTypeIndividual, + ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum}, + IsActive: util.OptionalBoolTrue, + Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate}, + }, tplExploreCompetences) + } diff --git a/templates/explore/competences.tmpl b/templates/explore/competences.tmpl index 730e194328..7b9382d5a4 100644 --- a/templates/explore/competences.tmpl +++ b/templates/explore/competences.tmpl @@ -6,7 +6,26 @@ {{template "explore/search" .}}
- Здесь будет список пользователей заложен + {{range .Users}} +
+ {{avatar .}} +
+ {{.Name}} {{.FullName}} +
+ {{if .Location}} + {{svg "octicon-location"}} {{.Location}} ({{.LocationCoordinate}}) + {{end}} + {{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}} + {{svg "octicon-mail"}} + {{.Email}} + {{end}} + {{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}} +
+
+
+ {{else}} +
{{$.i18n.Tr "explore.user_no_results"}}
+ {{end}}
{{template "base/paginate" .}}