Skip to content

Commit 02c2bc4

Browse files
committed
removed view type param from milestones endpoint because it wasn't being used
1 parent 92289d2 commit 02c2bc4

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

routers/user/home.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ func Milestones(ctx *context.Context) {
161161
return
162162
}
163163

164-
viewType := "all"
165164
sortType := ctx.Query("sort")
166-
167165
page := ctx.QueryInt("page")
168166
if page <= 1 {
169167
page = 1
@@ -303,7 +301,6 @@ func Milestones(ctx *context.Context) {
303301
ctx.Data["Counts"] = counts
304302
ctx.Data["MilestoneStats"] = milestoneStats
305303
ctx.Data["Total"] = total
306-
ctx.Data["ViewType"] = viewType
307304
ctx.Data["SortType"] = sortType
308305
ctx.Data["RepoID"] = repoID
309306
ctx.Data["IsShowClosed"] = isShowClosed
@@ -315,7 +312,6 @@ func Milestones(ctx *context.Context) {
315312
}
316313

317314
pager := context.NewPagination(total, setting.UI.IssuePagingNum, page, 5)
318-
pager.AddParam(ctx, "type", "ViewType")
319315
pager.AddParam(ctx, "repo", "RepoID")
320316
pager.AddParam(ctx, "sort", "SortType")
321317
pager.AddParam(ctx, "state", "State")

templates/user/dashboard/milestones.tmpl

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<div class="ui stackable grid">
66
<div class="four wide column">
77
<div class="ui secondary vertical filter menu">
8-
<a class="{{if eq .ViewType "your_repositories"}}ui basic blue button{{end}} item" href="{{.Link}}?type=your_repositories&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
8+
<a class="item" href="{{.Link}}?type=your_repositories&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
99
{{.i18n.Tr "home.issues.in_your_repos"}}
1010
<strong class="ui right">{{.Total}}</strong>
1111
</a>
1212
<div class="ui divider"></div>
1313
{{range .Repos}}
14-
<a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&sort={{$.SortType}}&state={{$.State}}" title="{{.FullName}}">
14+
<a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?sort={{$.SortType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&state={{$.State}}" title="{{.FullName}}">
1515
<span class="text truncate">{{.FullName}}</span>
1616
<div class="floating ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{index $.Counts .ID}}</div>
1717
</a>
@@ -20,11 +20,11 @@
2020
</div>
2121
<div class="twelve wide column content">
2222
<div class="ui tiny basic status buttons">
23-
<a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=open">
23+
<a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?repo={{.RepoID}}&sort={{$.SortType}}&state=open">
2424
<i class="octicon octicon-issue-opened"></i>
2525
{{.i18n.Tr "repo.milestones.open_tab" .MilestoneStats.OpenCount}}
2626
</a>
27-
<a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=closed">
27+
<a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?repo={{.RepoID}}&sort={{$.SortType}}&state=closed">
2828
<i class="octicon octicon-issue-closed"></i>
2929
{{.i18n.Tr "repo.milestones.close_tab" .MilestoneStats.ClosedCount}}
3030
</a>
@@ -37,12 +37,12 @@
3737
<i class="dropdown icon"></i>
3838
</span>
3939
<div class="menu">
40-
<a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=closestduedate&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.closest_due_date"}}</a>
41-
<a class="{{if eq .SortType "furthestduedate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=furthestduedate&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.furthest_due_date"}}</a>
42-
<a class="{{if eq .SortType "leastcomplete"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastcomplete&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_complete"}}</a>
43-
<a class="{{if eq .SortType "mostcomplete"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=mostcomplete&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_complete"}}</a>
44-
<a class="{{if eq .SortType "mostissues"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=mostissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_issues"}}</a>
45-
<a class="{{if eq .SortType "leastissues"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_issues"}}</a>
40+
<a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active{{end}} item" href="{{$.Link}}?repo={{.RepoID}}&sort=closestduedate&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.closest_due_date"}}</a>
41+
<a class="{{if eq .SortType "furthestduedate"}}active{{end}} item" href="{{$.Link}}?repo={{.RepoID}}&sort=furthestduedate&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.furthest_due_date"}}</a>
42+
<a class="{{if eq .SortType "leastcomplete"}}active{{end}} item" href="{{$.Link}}?repo={{.RepoID}}&sort=leastcomplete&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_complete"}}</a>
43+
<a class="{{if eq .SortType "mostcomplete"}}active{{end}} item" href="{{$.Link}}?repo={{.RepoID}}&sort=mostcomplete&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_complete"}}</a>
44+
<a class="{{if eq .SortType "mostissues"}}active{{end}} item" href="{{$.Link}}?repo={{.RepoID}}&sort=mostissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_issues"}}</a>
45+
<a class="{{if eq .SortType "leastissues"}}active{{end}} item" href="{{$.Link}}?repo={{.RepoID}}&sort=leastissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_issues"}}</a>
4646
</div>
4747
</div>
4848
</div>
@@ -75,6 +75,17 @@
7575
{{if .TotalTrackedTime}}<i class="octicon octicon-clock"></i> {{.TotalTrackedTime|Sec2Time}}{{end}}
7676
</span>
7777
</div>
78+
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
79+
<div class="ui right operate">
80+
<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
81+
{{if .IsClosed}}
82+
<a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-check"></i> {{$.i18n.Tr "repo.milestones.open"}}</a>
83+
{{else}}
84+
<a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.milestones.close"}}</a>
85+
{{end}}
86+
<a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
87+
</div>
88+
{{end}}
7889
{{if .Content}}
7990
<div class="content">
8091
{{.RenderedContent|Str2html}}

0 commit comments

Comments
 (0)