Алексей Безбородов
2 years ago
13 changed files with 309 additions and 18 deletions
@ -0,0 +1,33 @@
|
||||
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" |
||||
"code.gitea.io/gitea/modules/structs" |
||||
"code.gitea.io/gitea/modules/util" |
||||
) |
||||
|
||||
const ( |
||||
tplExploreCompetences base.TplName = "explore/competences" |
||||
) |
||||
|
||||
func Competences(ctx *context.Context) { |
||||
ctx.Data["UsersIsDisabled"] = setting.Service.Explore.DisableUsersPage |
||||
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
||||
ctx.Data["Title"] = ctx.Tr("explore") |
||||
ctx.Data["PageIsExplore"] = true |
||||
ctx.Data["PageIsExploreCompetences"] = true |
||||
|
||||
RenderUserSearch(ctx, &user_model.SearchUserOptions{ |
||||
Actor: ctx.User, |
||||
Type: user_model.UserTypeIdentity, |
||||
ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum}, |
||||
IsActive: util.OptionalBoolTrue, |
||||
Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate}, |
||||
Kind: user_model.ByCompetence, |
||||
}, tplExploreCompetences) |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
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" |
||||
"code.gitea.io/gitea/modules/structs" |
||||
"code.gitea.io/gitea/modules/util" |
||||
) |
||||
|
||||
const ( |
||||
tplExploreInterests base.TplName = "explore/interests" |
||||
) |
||||
|
||||
func Interests(ctx *context.Context) { |
||||
ctx.Data["UsersIsDisabled"] = setting.Service.Explore.DisableUsersPage |
||||
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
||||
ctx.Data["Title"] = ctx.Tr("explore") |
||||
ctx.Data["PageIsExplore"] = true |
||||
ctx.Data["PageIsExploreInterests"] = true |
||||
|
||||
RenderUserSearch(ctx, &user_model.SearchUserOptions{ |
||||
Actor: ctx.User, |
||||
Type: user_model.UserTypeIdentity, |
||||
ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum}, |
||||
IsActive: util.OptionalBoolTrue, |
||||
Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate}, |
||||
Kind: user_model.ByInterest, |
||||
}, tplExploreInterests) |
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
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" |
||||
"code.gitea.io/gitea/modules/structs" |
||||
"code.gitea.io/gitea/modules/util" |
||||
) |
||||
|
||||
const ( |
||||
tplExploreResources base.TplName = "explore/resources" |
||||
) |
||||
|
||||
func Resources(ctx *context.Context) { |
||||
ctx.Data["UsersIsDisabled"] = setting.Service.Explore.DisableUsersPage |
||||
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
||||
ctx.Data["Title"] = ctx.Tr("explore") |
||||
ctx.Data["PageIsExplore"] = true |
||||
ctx.Data["PageIsExploreResources"] = true |
||||
|
||||
RenderUserSearch(ctx, &user_model.SearchUserOptions{ |
||||
Actor: ctx.User, |
||||
Type: user_model.UserTypeIdentity, |
||||
ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum}, |
||||
IsActive: util.OptionalBoolTrue, |
||||
Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate}, |
||||
Kind: user_model.ByResource, |
||||
}, tplExploreResources) |
||||
|
||||
} |
@ -0,0 +1,39 @@
|
||||
{{template "base/head" .}} |
||||
|
||||
<div class="page-content explore"> |
||||
{{template "explore/navbar" .}} |
||||
<div class="ui container"> |
||||
{{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}} |
||||
{{if .Competences}} |
||||
<h4>{{$.i18n.Tr "explore.competences"}}:</h4> |
||||
<div>{{(index $.RenderedContent .ID)|Str2html}}</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{else}} |
||||
<div>{{$.i18n.Tr "explore.user_no_results"}}</div> |
||||
{{end}} |
||||
</div> |
||||
|
||||
{{template "base/paginate" .}} |
||||
</div> |
||||
</div> |
||||
|
||||
{{template "base/footer" .}} |
@ -0,0 +1,39 @@
|
||||
{{template "base/head" .}} |
||||
|
||||
<div class="page-content explore"> |
||||
{{template "explore/navbar" .}} |
||||
<div class="ui container"> |
||||
{{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}} |
||||
{{if .Interests}} |
||||
<h4>{{$.i18n.Tr "explore.interests"}}:</h4> |
||||
<div>{{(index $.RenderedContent .ID)|Str2html}}</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{else}} |
||||
<div>{{$.i18n.Tr "explore.user_no_results"}}</div> |
||||
{{end}} |
||||
</div> |
||||
|
||||
{{template "base/paginate" .}} |
||||
</div> |
||||
</div> |
||||
|
||||
{{template "base/footer" .}} |
@ -0,0 +1,39 @@
|
||||
{{template "base/head" .}} |
||||
|
||||
<div class="page-content explore"> |
||||
{{template "explore/navbar" .}} |
||||
<div class="ui container"> |
||||
{{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}} |
||||
{{if .Resources}} |
||||
<h4>{{$.i18n.Tr "explore.resources"}}:</h4> |
||||
<div>{{(index $.RenderedContent .ID)|Str2html}}</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{else}} |
||||
<div>{{$.i18n.Tr "explore.user_no_results"}}</div> |
||||
{{end}} |
||||
</div> |
||||
|
||||
{{template "base/paginate" .}} |
||||
</div> |
||||
</div> |
||||
|
||||
{{template "base/footer" .}} |
Loading…
Reference in new issue