diff options
author | Unknwon <u@gogs.io> | 2016-03-11 15:33:12 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-11 15:33:12 -0500 |
commit | 2bf8494332592b3c57f9a12a26b9abd356fb3f15 (patch) | |
tree | e46c61ba30018ebbafcda6b97b36d3ffece3cfb0 /templates/explore | |
parent | df2bdf7ea36ad0729e0326ca799d8896d7f96946 (diff) | |
download | gitea-2bf8494332592b3c57f9a12a26b9abd356fb3f15.tar.gz gitea-2bf8494332592b3c57f9a12a26b9abd356fb3f15.zip |
#13 finish user and repository search
Both are possible on explore and admin panel
Diffstat (limited to 'templates/explore')
-rw-r--r-- | templates/explore/navbar.tmpl | 9 | ||||
-rw-r--r-- | templates/explore/page.tmpl | 21 | ||||
-rw-r--r-- | templates/explore/repos.tmpl | 24 | ||||
-rw-r--r-- | templates/explore/search.tmpl | 7 | ||||
-rw-r--r-- | templates/explore/users.tmpl | 35 |
5 files changed, 71 insertions, 25 deletions
diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl index 2b6aa93f5c..1e2ab786af 100644 --- a/templates/explore/navbar.tmpl +++ b/templates/explore/navbar.tmpl @@ -1,8 +1,11 @@ <div class="four wide column"> - <div class="ui vertical menu"> + <div class="ui vertical menu navbar"> <div class="header item">{{.i18n.Tr "explore"}}</div> - <a class="{{if .PageIsExploreRepositories}}active{{end}} item" href="{{AppSubUrl}}/explore"> - {{.i18n.Tr "explore.repos"}} + <a class="{{if .PageIsExploreRepositories}}active{{end}} item" href="{{AppSubUrl}}/explore/repos"> + <span class="octicon octicon-repo"></span> {{.i18n.Tr "explore.repos"}} + </a> + <a class="{{if .PageIsExploreUsers}}active{{end}} item" href="{{AppSubUrl}}/explore/users"> + <span class="octicon octicon-person"></span> {{.i18n.Tr "explore.users"}} </a> </div> </div> diff --git a/templates/explore/page.tmpl b/templates/explore/page.tmpl new file mode 100644 index 0000000000..bb07f2611b --- /dev/null +++ b/templates/explore/page.tmpl @@ -0,0 +1,21 @@ +{{with .Page}} + {{if gt .TotalPages 1}} + <div class="center page buttons"> + <div class="ui borderless pagination menu"> + <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}&q={{$.Keyword}}"{{end}}> + <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} + </a> + {{range .Pages}} + {{if eq .Num -1}} + <a class="disabled item">...</a> + {{else}} + <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?page={{.Num}}&q={{$.Keyword}}"{{end}}>{{.Num}}</a> + {{end}} + {{end}} + <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}&q={{$.Keyword}}"{{end}}> + {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> + </a> + </div> + </div> + {{end}} +{{end}}
\ No newline at end of file diff --git a/templates/explore/repos.tmpl b/templates/explore/repos.tmpl index 5523295312..080a5076f1 100644 --- a/templates/explore/repos.tmpl +++ b/templates/explore/repos.tmpl @@ -4,29 +4,9 @@ <div class="ui grid"> {{template "explore/navbar" .}} <div class="twelve wide column content"> + {{template "explore/search" .}} {{template "explore/repo_list" .}} - - {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}"{{end}}> - <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}} - </a> - {{range .Pages}} - {{if eq .Num -1}} - <a class="disabled item">...</a> - {{else}} - <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?page={{.Num}}"{{end}}>{{.Num}}</a> - {{end}} - {{end}} - <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}"{{end}}> - {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i> - </a> - </div> - </div> - {{end}} - {{end}} + {{template "explore/page" .}} </div> </div> </div> diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl new file mode 100644 index 0000000000..f18648865c --- /dev/null +++ b/templates/explore/search.tmpl @@ -0,0 +1,7 @@ +<form class="ui form"> + <div class="ui fluid action input"> + <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus> + <button class="ui blue button">{{.i18n.Tr "explore.search"}}</button> + </div> +</form> +<div class="ui divider"></div>
\ No newline at end of file diff --git a/templates/explore/users.tmpl b/templates/explore/users.tmpl new file mode 100644 index 0000000000..b7eca4b024 --- /dev/null +++ b/templates/explore/users.tmpl @@ -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="{{.AvatarLink}}"> + <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 .Email $.IsSigned}} + <i class="octicon octicon-mail"></i> + <a href="mailto:{{.Email}}" rel="nofollow">{{.Email}}</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" .}} |