diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 279214bcf04f..3fd25f81fb55 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -246,6 +246,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
isShowClosed = true
}
+ archived := ctx.FormBool("archived")
+
page := ctx.FormInt("page")
if page <= 1 {
page = 1
@@ -417,6 +419,15 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
ctx.Data["PinnedIssues"] = pinned
ctx.Data["IsRepoAdmin"] = ctx.IsSigned && (ctx.Repo.IsAdmin() || ctx.Doer.IsAdmin)
ctx.Data["IssueStats"] = issueStats
+ ctx.Data["OpenCount"] = issueStats.OpenCount
+ ctx.Data["ClosedCount"] = issueStats.ClosedCount
+ linkStr := "%s?q=%s&type=%s&sort=%s&state=%s&labels=%s&milestone=%d&project=%d&assignee=%d&poster=%d&archived=%t"
+ ctx.Data["OpenLink"] = fmt.Sprintf(linkStr, ctx.Link,
+ url.QueryEscape(keyword), url.QueryEscape(viewType), url.QueryEscape(sortType), "open", url.QueryEscape(selectLabels),
+ mentionedID, projectID, assigneeID, posterID, archived)
+ ctx.Data["ClosedLink"] = fmt.Sprintf(linkStr, ctx.Link,
+ url.QueryEscape(keyword), url.QueryEscape(viewType), url.QueryEscape(sortType), "closed", url.QueryEscape(selectLabels),
+ mentionedID, projectID, assigneeID, posterID, archived)
ctx.Data["SelLabelIDs"] = labelIDs
ctx.Data["SelectLabels"] = selectLabels
ctx.Data["ViewType"] = viewType
@@ -432,6 +443,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
} else {
ctx.Data["State"] = "open"
}
+ ctx.Data["ShowArchivedLabels"] = archived
pager.AddParam(ctx, "q", "Keyword")
pager.AddParam(ctx, "type", "ViewType")
@@ -442,11 +454,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
pager.AddParam(ctx, "project", "ProjectID")
pager.AddParam(ctx, "assignee", "AssigneeID")
pager.AddParam(ctx, "poster", "PosterID")
+ pager.AddParam(ctx, "archived", "ShowArchivedLabels")
- if ctx.FormBool("archived") {
- ctx.Data["ShowArchivedLabels"] = true
- pager.AddParam(ctx, "archived", "ShowArchivedLabels")
- }
ctx.Data["Page"] = pager
}
diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go
index 32cbc29c671a..4db02fce9ea4 100644
--- a/routers/web/repo/milestone.go
+++ b/routers/web/repo/milestone.go
@@ -4,6 +4,7 @@
package repo
import (
+ "fmt"
"net/http"
"net/url"
"time"
@@ -72,6 +73,11 @@ func Milestones(ctx *context.Context) {
}
ctx.Data["OpenCount"] = stats.OpenCount
ctx.Data["ClosedCount"] = stats.ClosedCount
+ linkStr := "%s/milestones?state=%s&q=%s&sort=%s"
+ ctx.Data["OpenLink"] = fmt.Sprintf(linkStr, ctx.Repo.RepoLink, "open",
+ url.QueryEscape(keyword), url.QueryEscape(sortType))
+ ctx.Data["ClosedLink"] = fmt.Sprintf(linkStr, ctx.Repo.RepoLink, "closed",
+ url.QueryEscape(keyword), url.QueryEscape(sortType))
if ctx.Repo.Repository.IsTimetrackerEnabled(ctx) {
if err := miles.LoadTotalTrackedTimes(ctx); err != nil {
diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl
new file mode 100644
index 000000000000..511ef7f397c5
--- /dev/null
+++ b/templates/repo/issue/filter_list.tmpl
@@ -0,0 +1,206 @@
+
+
+
+ {{ctx.Locale.Tr "repo.issues.filter_label"}}
+
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
+
+{{if not .Milestone}}
+
+
+
+ {{ctx.Locale.Tr "repo.issues.filter_milestone"}}
+
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
+{{end}}
+
+
+
+
+ {{ctx.Locale.Tr "repo.issues.filter_project"}}
+
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
+
+
+
+
+ {{ctx.Locale.Tr "repo.issues.filter_poster"}}
+
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
+
+
+
+
+ {{ctx.Locale.Tr "repo.issues.filter_assignee"}}
+
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
+
+{{if .IsSigned}}
+
+
+
+ {{ctx.Locale.Tr "repo.issues.filter_type"}}
+
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+
+
+{{end}}
+
+
+
diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl
index 15a90869b01d..8645ff9d5076 100644
--- a/templates/repo/issue/filters.tmpl
+++ b/templates/repo/issue/filters.tmpl
@@ -7,212 +7,11 @@
diff --git a/templates/repo/issue/milestone/filter_list.tmpl b/templates/repo/issue/milestone/filter_list.tmpl
new file mode 100644
index 000000000000..0eea42d6ee61
--- /dev/null
+++ b/templates/repo/issue/milestone/filter_list.tmpl
@@ -0,0 +1,15 @@
+
+
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
index ff89d40734ec..3d4bbfd8b1ad 100644
--- a/templates/repo/issue/milestones.tmpl
+++ b/templates/repo/issue/milestones.tmpl
@@ -2,53 +2,17 @@
{{template "repo/header" .}}
-
+ {{template "base/alert" .}}
+
+
- {{template "base/alert" .}}
-
+ {{template "repo/issue/filters" .}}
diff --git a/templates/repo/issue/openclose.tmpl b/templates/repo/issue/openclose.tmpl
index ad8de4013a63..ff5ec3c5a542 100644
--- a/templates/repo/issue/openclose.tmpl
+++ b/templates/repo/issue/openclose.tmpl
@@ -1,14 +1,16 @@
diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl
index 822700c65212..361f16fd3b1e 100644
--- a/templates/repo/issue/search.tmpl
+++ b/templates/repo/issue/search.tmpl
@@ -1,12 +1,14 @@