Skip to content

Commit 3aec5c6

Browse files
committed
Update
1 parent 0da7f38 commit 3aec5c6

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

routers/web/repo/milestone.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ func NewMilestone(ctx *context.Context) {
157157
ctx.HTML(http.StatusOK, tplMilestoneNew)
158158
}
159159

160+
// Int64sToMap converts a slice of int64 to a int64 map.
161+
func Int64sToMap(ints []int64) map[int64]bool {
162+
m := make(map[int64]bool)
163+
for _, i := range ints {
164+
m[i] = true
165+
}
166+
return m
167+
}
168+
160169
// NewMilestonePost response for creating milestone
161170
func NewMilestonePost(ctx *context.Context) {
162171
form := web.GetForm(ctx).(*forms.CreateMilestoneForm)
@@ -192,7 +201,7 @@ func NewMilestonePost(ctx *context.Context) {
192201
if err != nil {
193202
return
194203
}
195-
labelIDMark := base.Int64sToMap(labelIDs)
204+
labelIDMark := Int64sToMap(labelIDs)
196205

197206
for i := range labels {
198207
if labelIDMark[labels[i].ID] {
@@ -325,7 +334,7 @@ func EditMilestonePost(ctx *context.Context) {
325334
if err != nil {
326335
return
327336
}
328-
labelIDMark := base.Int64sToMap(labelIDs)
337+
labelIDMark := Int64sToMap(labelIDs)
329338

330339
for i := range labels {
331340
if labelIDMark[labels[i].ID] {

templates/repo/issue/milestone_new.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@
5858
{{if or .Labels .OrgLabels}}
5959
{{range .Labels}}
6060
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{svg "octicon-check"}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
61-
{{if .Description }}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
61+
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
6262
{{end}}
6363

6464
<div class="ui divider"></div>
6565
{{range .OrgLabels}}
6666
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon-check {{if not .IsChecked}}invisible{{end}}">{{svg "octicon-check"}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
67-
{{if .Description }}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
67+
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji}}</small>{{end}}</a>
6868
{{end}}
6969
{{else}}
7070
<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div>

0 commit comments

Comments
 (0)