Browse Source

Add the ability to explore organizations (#3573)

* Add ability to explore organizations

* Use right icon for org explore links
for-closed-social
Daniel Oaks 8 years ago
committed by 无闻
parent
commit
b3d9ca4ccd
6 changed files with 940 additions and 1104 deletions
  1. +1
    -0
      cmd/web.go
  2. +1
    -0
      conf/locale/locale_en-US.ini
  3. +881
    -1101
      modules/bindata/bindata.go
  4. +19
    -3
      routers/home.go
  5. +3
    -0
      templates/explore/navbar.tmpl
  6. +35
    -0
      templates/explore/organizations.tmpl

+ 1
- 0
cmd/web.go View File

@ -214,6 +214,7 @@ func runWeb(ctx *cli.Context) error {
})
m.Get("/repos", routers.ExploreRepos)
m.Get("/users", routers.ExploreUsers)
m.Get("/organizations", routers.ExploreOrganizations)
}, ignSignIn)
m.Combo("/install", routers.InstallInit).Get(routers.Install).
Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)

+ 1
- 0
conf/locale/locale_en-US.ini View File

@ -137,6 +137,7 @@ issues.in_your_repos = In your repositories
[explore]
repos = Repositories
users = Users
organizations = Organizations
search = Search
[auth]

+ 881
- 1101
modules/bindata/bindata.go
File diff suppressed because it is too large
View File


+ 19
- 3
routers/home.go View File

@ -17,9 +17,10 @@ import (
)
const (
HOME base.TplName = "home"
EXPLORE_REPOS base.TplName = "explore/repos"
EXPLORE_USERS base.TplName = "explore/users"
HOME base.TplName = "home"
EXPLORE_REPOS base.TplName = "explore/repos"
EXPLORE_USERS base.TplName = "explore/users"
EXPLORE_ORGANIZATIONS base.TplName = "explore/organizations"
)
func Home(ctx *context.Context) {
@ -180,6 +181,21 @@ func ExploreUsers(ctx *context.Context) {
})
}
func ExploreOrganizations(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("explore")
ctx.Data["PageIsExplore"] = true
ctx.Data["PageIsExploreOrganizations"] = true
RenderUserSearch(ctx, &UserSearchOptions{
Type: models.USER_TYPE_ORGANIZATION,
Counter: models.CountOrganizations,
Ranger: models.Organizations,
PageSize: setting.UI.ExplorePagingNum,
OrderBy: "updated_unix DESC",
TplName: EXPLORE_ORGANIZATIONS,
})
}
func NotFound(ctx *context.Context) {
ctx.Data["Title"] = "Page Not Found"
ctx.Handle(404, "home.NotFound", nil)

+ 3
- 0
templates/explore/navbar.tmpl View File

@ -7,5 +7,8 @@
<a class="{{if .PageIsExploreUsers}}active{{end}} item" href="{{AppSubUrl}}/explore/users">
<span class="octicon octicon-person"></span> {{.i18n.Tr "explore.users"}}
</a>
<a class="{{if .PageIsExploreOrganizations}}active{{end}} item" href="{{AppSubUrl}}/explore/organizations">
<span class="octicon octicon-organization"></span> {{.i18n.Tr "explore.organizations"}}
</a>
</div>
</div>

+ 35
- 0
templates/explore/organizations.tmpl View File

@ -0,0 +1,35 @@
{{template "base/head" .}}
<div class="explore users">
<div class="ui container">
<div class="ui grid">
{{template "explore/navbar" .}}
<div class="twelve wide column content">
{{template "explore/search" .}}
<div class="ui user list">
{{range .Users}}
<div class="item">
<img class="ui avatar image" src="{{.RelAvatarLink}}">
<div class="content">
<span class="header"><a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}</span>
<div class="description">
{{if .Location}}
<i class="octicon octicon-location"></i> {{.Location}}
{{end}}
{{if and .Website}}
<i class="octicon octicon-link"></i>
<a href="{{.Website}}" rel="nofollow">{{.Website}}</a>
{{end}}
<i class="octicon octicon-clock"></i> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
</div>
</div>
</div>
{{end}}
</div>
{{template "explore/page" .}}
</div>
</div>
</div>
</div>
{{template "base/footer" .}}

Loading…
Cancel
Save