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/admin | |
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/admin')
-rw-r--r-- | templates/admin/base/page.tmpl | 23 | ||||
-rw-r--r-- | templates/admin/base/search.tmpl | 6 | ||||
-rw-r--r-- | templates/admin/org/list.tmpl | 29 | ||||
-rw-r--r-- | templates/admin/repo/list.tmpl | 27 | ||||
-rw-r--r-- | templates/admin/user/list.tmpl | 29 |
5 files changed, 43 insertions, 71 deletions
diff --git a/templates/admin/base/page.tmpl b/templates/admin/base/page.tmpl new file mode 100644 index 0000000000..b689ed0811 --- /dev/null +++ b/templates/admin/base/page.tmpl @@ -0,0 +1,23 @@ + {{with .Page}} + {{if gt .TotalPages 1}} + <div class="center page buttons"> + <div class="ui borderless pagination menu"> + <a class="{{if .IsFirst}}disabled{{end}} item" href="{{$.Link}}?q={{$.Keyword}}"><i class="angle double left icon"></i> {{$.i18n.Tr "admin.first_page"}}</a> + <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> + <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}&q={{$.Keyword}}">{{$.i18n.Tr "admin.last_page"}} <i class="angle double right icon"></i></a> + </div> + </div> + {{end}} + {{end}}
\ No newline at end of file diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl new file mode 100644 index 0000000000..29026a11a1 --- /dev/null +++ b/templates/admin/base/search.tmpl @@ -0,0 +1,6 @@ +<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>
\ No newline at end of file diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index 0230f03021..8560d02196 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -8,6 +8,9 @@ <h4 class="ui top attached header"> {{.i18n.Tr "admin.orgs.org_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) </h4> + <div class="ui attached segment"> + {{template "admin/base/search" .}} + </div> <div class="ui attached table segment"> <table class="ui very basic striped table"> <thead> @@ -22,7 +25,7 @@ </tr> </thead> <tbody> - {{range .Orgs}} + {{range .Users}} <tr> <td>{{.Id}}</td> <td><a href="{{.HomeLink}}">{{.Name}}</a></td> @@ -37,29 +40,7 @@ </table> </div> - {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if .IsFirst}}disabled{{end}} item" href="{{$.Link}}"><i class="angle double left icon"></i> {{$.i18n.Tr "admin.first_page"}}</a> - <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> - <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}">{{$.i18n.Tr "admin.last_page"}} <i class="angle double right icon"></i></a> - </div> - </div> - {{end}} - {{end}} + {{template "admin/base/page" .}} </div> </div> </div> diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index cbbc91f80e..6cd34855bf 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -8,6 +8,9 @@ <h4 class="ui top attached header"> {{.i18n.Tr "admin.repos.repo_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) </h4> + <div class="ui attached segment"> + {{template "admin/base/search" .}} + </div> <div class="ui attached table segment"> <table class="ui very basic striped table"> <thead> @@ -41,29 +44,7 @@ </table> </div> - {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if .IsFirst}}disabled{{end}} item" href="{{$.Link}}"><i class="angle double left icon"></i> {{$.i18n.Tr "admin.first_page"}}</a> - <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> - <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}">{{$.i18n.Tr "admin.last_page"}} <i class="angle double right icon"></i></a> - </div> - </div> - {{end}} - {{end}} + {{template "admin/base/page" .}} </div> </div> </div> diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 670b05450c..5b5048f84a 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -8,9 +8,12 @@ <h4 class="ui top attached header"> {{.i18n.Tr "admin.users.user_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui blue tiny button" href="{{AppSubUrl}}/admin/users/new">{{.i18n.Tr "admin.users.new_account"}}</a> + <a class="ui black tiny button" href="{{AppSubUrl}}/admin/users/new">{{.i18n.Tr "admin.users.new_account"}}</a> </div> </h4> + <div class="ui attached segment"> + {{template "admin/base/search" .}} + </div> <div class="ui attached table segment"> <table class="ui very basic striped table"> <thead> @@ -42,29 +45,7 @@ </table> </div> - {{with .Page}} - {{if gt .TotalPages 1}} - <div class="center page buttons"> - <div class="ui borderless pagination menu"> - <a class="{{if .IsFirst}}disabled{{end}} item" href="{{$.Link}}"><i class="angle double left icon"></i> {{$.i18n.Tr "admin.first_page"}}</a> - <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> - <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}">{{$.i18n.Tr "admin.last_page"}} <i class="angle double right icon"></i></a> - </div> - </div> - {{end}} - {{end}} + {{template "admin/base/page" .}} </div> </div> </div> |