Browse Source

Выводятся личности, упорядоченные по алфавиту логинов #106

pull/118/head
Artur Galyamov 2 years ago
parent
commit
f29b079f3c
  1. 14
      routers/web/explore/competence.go
  2. 21
      templates/explore/competences.tmpl

14
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)
}

21
templates/explore/competences.tmpl

@ -6,7 +6,26 @@
{{template "explore/search" .}}
<div class="ui user list">
Здесь будет список пользователей заложен
{{range .Users}}
<div class="item">
{{avatar .}}
<div class="content">
<span class="header"><a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}</span>
<div class="description">
{{if .Location}}
{{svg "octicon-location"}} {{.Location}} ({{.LocationCoordinate}})
{{end}}
{{if and $.ShowUserEmail .Email $.IsSigned (not .KeepEmailPrivate)}}
{{svg "octicon-mail"}}
<a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</a>
{{end}}
{{svg "octicon-clock"}} {{$.i18n.Tr "user.join_on"}} {{.CreatedUnix.FormatShort}}
</div>
</div>
</div>
{{else}}
<div>{{$.i18n.Tr "explore.user_no_results"}}</div>
{{end}}
</div>
{{template "base/paginate" .}}

Loading…
Cancel
Save