summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-04 22:24:04 +0800
committerUnknwon <u@gogs.io>2015-08-04 22:24:04 +0800
commit9311a9858ae4dd10450370da8a93c37c1dad798b (patch)
treef394b405e8973b917d2770b404cf8ede39dc73c0 /templates/repo
parente7f015db8cd1d16fc630e14afe88763a5ca787a8 (diff)
downloadgitea-9311a9858ae4dd10450370da8a93c37c1dad798b.tar.gz
gitea-9311a9858ae4dd10450370da8a93c37c1dad798b.zip
milestone: pagination
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/issue/create.tmpl2
-rw-r--r--templates/repo/issue/list.tmpl8
-rw-r--r--templates/repo/issue/milestone.tmpl26
-rw-r--r--templates/repo/milestone2/list.tmpl58
4 files changed, 29 insertions, 65 deletions
diff --git a/templates/repo/issue/create.tmpl b/templates/repo/issue/create.tmpl
index de0c47ac20..f38c57d0d5 100644
--- a/templates/repo/issue/create.tmpl
+++ b/templates/repo/issue/create.tmpl
@@ -54,7 +54,7 @@
{{else}}
<ul class="list-unstyled">
{{range .OpenMilestones}}
- <li class="milestone-item" data-id="{{.Id}}">
+ <li class="milestone-item" data-id="{{.ID}}">
<p><strong>{{.Name}}</strong></p>
<!-- <p>due to 3 days later</p> -->
</li>
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index e24f8bb926..0a3eebbdaf 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -88,20 +88,20 @@
{{end}}
{{with .Page}}
- {{if gt .Total 1}}
+ {{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="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&page={{.Previous}}"{{end}}>
+ <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&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="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&page={{.Num}}"{{end}}>{{.Num}}</a>
+ <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&page={{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
- <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&page={{.Next}}"{{end}}>
+ <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&page={{.Next}}"{{end}}>
{{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
</a>
</div>
diff --git a/templates/repo/issue/milestone.tmpl b/templates/repo/issue/milestone.tmpl
index 3add7cd807..d5b22806aa 100644
--- a/templates/repo/issue/milestone.tmpl
+++ b/templates/repo/issue/milestone.tmpl
@@ -28,8 +28,8 @@
{{range .Milestones}}
<li class="item">
<i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&midx={{.Index}}">{{.Name}}</a>
- <div class="ui right blue progress" data-percent="{{if .Completeness}}{{.Completeness}}{{else}}100{{end}}">
- <div class="bar">
+ <div class="ui right blue progress" data-percent="{{.Completeness}}">
+ <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}>
<div class="progress"></div>
</div>
</div>
@@ -63,6 +63,28 @@
{{end}}
</li>
{{end}}
+
+ {{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}}?state={{$.State}}&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}}?state={{$.State}}&page={{.Num}}"{{end}}>{{.Num}}</a>
+ {{end}}
+ {{end}}
+ <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?state={{$.State}}&page={{.Next}}"{{end}}>
+ {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
+ </a>
+ </div>
+ </div>
+ {{end}}
+ {{end}}
</div>
</div>
</div>
diff --git a/templates/repo/milestone2/list.tmpl b/templates/repo/milestone2/list.tmpl
deleted file mode 100644
index 6864442457..0000000000
--- a/templates/repo/milestone2/list.tmpl
+++ /dev/null
@@ -1,58 +0,0 @@
-{{template "ng/base/head" .}}
-{{template "ng/base/header" .}}
-<div id="repo-wrapper">
- {{template "repo/header_old" .}}
- <div class="issue-main container repo-wide-wrapper">
- <ul id="issue-list-nav" class="menu menu-line">
- <li><a href="#">Issue</a></li>
- <li><a href="#">Pull Request</a></li>
- <li><a href="#">Labels</a></li>
- <li class="current"><a href="#">Milestones</a></li>
- <li class="right" id="milestone-new"><a href="#"><button id="issue-new-btn" class="btn btn-green text-bold">New Milestone</button></a></li>
- </ul>
- <div id="issue-list-container">
- <div id="issue-list-menu">
- <div class="left">
- <span class="mark open hover"><a href="#">
- <i class="octicon octicon-milestone"></i> 88 Open
- </a></span>
- <span class="mark close"><a href="">
- <i class="octicon octicon-issue-closed"></i> 12 Close
- </a></span>
- </div>
- <div class="clear"></div>
- </div>
- <ul id="milestone-list" class="list-no-style">
- <li class="item" id="milestone-id">
- <!--<a class="comment" href="#">
- <i class="octicon octicon-comment"></i> 7
- </a>-->
- <p class="title text-bold">
- <i class="octicon octicon-milestone"></i>
- <a href="#" class="title-text">Delete account text</a>
- </p>
- <p class="desc">
- <i class="octicon octicon-clock"></i> Updated 3 days ago &nbsp;&nbsp;
- <i class="octicon octicon-calendar"></i> Due to Dec 31,2014
- </p>
- <div class="content">
- In this version of release, users are able to register and log in/out on Gogs, setting up SSH keys and do most of Git operations through SSH with public repositories. And Web UI only for view of Git data, no extra features are supported.
- </div>
- <div class="action">
- <p class="status-bar">
- <span class="closed">closed 12</span>
- <span class="inline-block bar"><span class="inline-block opening"></span></span>
- <span class="open">12 open</span>
- </p>
- <div class="action-bar text-right">
- <a href="#">Edit</a>
- <a href="#">Delete</a>
- <a href="#" class="text-red">Close</a>
- </div>
- </div>
- </li>
- </ul>
- </div>
- </div>
-</div>
-{{template "ng/base/footer" .}} \ No newline at end of file