summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-11 15:33:12 -0500
committerUnknwon <u@gogs.io>2016-03-11 15:33:12 -0500
commit2bf8494332592b3c57f9a12a26b9abd356fb3f15 (patch)
treee46c61ba30018ebbafcda6b97b36d3ffece3cfb0 /templates
parentdf2bdf7ea36ad0729e0326ca799d8896d7f96946 (diff)
downloadgitea-2bf8494332592b3c57f9a12a26b9abd356fb3f15.tar.gz
gitea-2bf8494332592b3c57f9a12a26b9abd356fb3f15.zip
#13 finish user and repository search
Both are possible on explore and admin panel
Diffstat (limited to 'templates')
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/admin/base/page.tmpl23
-rw-r--r--templates/admin/base/search.tmpl6
-rw-r--r--templates/admin/org/list.tmpl29
-rw-r--r--templates/admin/repo/list.tmpl27
-rw-r--r--templates/admin/user/list.tmpl29
-rw-r--r--templates/base/head.tmpl2
-rw-r--r--templates/explore/navbar.tmpl9
-rw-r--r--templates/explore/page.tmpl21
-rw-r--r--templates/explore/repos.tmpl24
-rw-r--r--templates/explore/search.tmpl7
-rw-r--r--templates/explore/users.tmpl35
12 files changed, 116 insertions, 98 deletions
diff --git a/templates/.VERSION b/templates/.VERSION
index 45796557fa..0d83594e58 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.9.5.0311 \ No newline at end of file
+0.9.6.0311 \ No newline at end of file
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"}}&nbsp;<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"}}&nbsp;<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"}}&nbsp;<i class="icon right arrow"></i>
- </a>
- <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}">{{$.i18n.Tr "admin.last_page"}}&nbsp;<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"}}&nbsp;<i class="icon right arrow"></i>
- </a>
- <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}">{{$.i18n.Tr "admin.last_page"}}&nbsp;<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"}}&nbsp;<i class="icon right arrow"></i>
- </a>
- <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}">{{$.i18n.Tr "admin.last_page"}}&nbsp;<i class="angle double right icon"></i></a>
- </div>
- </div>
- {{end}}
- {{end}}
+ {{template "admin/base/page" .}}
</div>
</div>
</div>
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index a391a96356..df56a79802 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -59,7 +59,7 @@
<a class="item{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a>
{{end}}
- <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore">{{.i18n.Tr "explore"}}</a>
+ <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
{{/*<div class="item">
<div class="ui icon input">
<input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
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" .}}