Skip to content

Commit

Permalink
Merge all pagination-templates into 'base/paginate'
Browse files Browse the repository at this point in the history
to reduce code-duplicity
  • Loading branch information
bkcsoft committed Nov 7, 2016
1 parent 86fb1a0 commit 562f9b6
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 33 deletions.
23 changes: 0 additions & 23 deletions templates/admin/base/page.tmpl

This file was deleted.

2 changes: 1 addition & 1 deletion templates/admin/org/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</table>
</div>

{{template "admin/base/page" .}}
{{template "base/paginate" .}}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</table>
</div>

{{template "admin/base/page" .}}
{{template "base/paginage" .}}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/user/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</table>
</div>

{{template "admin/base/page" .}}
{{template "base/paginate" .}}
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion templates/explore/page.tmpl → templates/base/paginate.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{{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>
Expand All @@ -13,8 +14,9 @@
{{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>
{{$.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}}
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/organizations.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{{end}}
</div>

{{template "explore/page" .}}
{{template "base/paginate" .}}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/repos.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="twelve wide column content">
{{template "explore/search" .}}
{{template "explore/repo_list" .}}
{{template "explore/page" .}}
{{template "base/paginate" .}}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/users.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{{end}}
</div>

{{template "explore/page" .}}
{{template "base/paginate" .}}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/org/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="ui divider"></div>
{{end}}
{{template "explore/repo_list" .}}
{{template "explore/page" .}}
{{template "base/paginate" .}}
</div>

<div class="ui five wide column">
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/release/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</li>
{{end}}
</ul>
{{template "admin/base/page" .}}
{{template "base/paginage" .}}
</div>
</div>
{{template "base/footer" .}}
2 changes: 1 addition & 1 deletion templates/user/profile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</div>
{{if ne .TabName "activity"}}
{{template "explore/repo_list" .}}
{{template "explore/page" .}}
{{template "base/paginate" .}}
{{else}}
<br>
<div class="feeds">
Expand Down

0 comments on commit 562f9b6

Please sign in to comment.