File tree 2 files changed +13
-4
lines changed 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,15 @@ func NewMilestone(ctx *context.Context) {
157
157
ctx .HTML (http .StatusOK , tplMilestoneNew )
158
158
}
159
159
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
+
160
169
// NewMilestonePost response for creating milestone
161
170
func NewMilestonePost (ctx * context.Context ) {
162
171
form := web .GetForm (ctx ).(* forms.CreateMilestoneForm )
@@ -192,7 +201,7 @@ func NewMilestonePost(ctx *context.Context) {
192
201
if err != nil {
193
202
return
194
203
}
195
- labelIDMark := base . Int64sToMap (labelIDs )
204
+ labelIDMark := Int64sToMap (labelIDs )
196
205
197
206
for i := range labels {
198
207
if labelIDMark [labels [i ].ID ] {
@@ -325,7 +334,7 @@ func EditMilestonePost(ctx *context.Context) {
325
334
if err != nil {
326
335
return
327
336
}
328
- labelIDMark := base . Int64sToMap (labelIDs )
337
+ labelIDMark := Int64sToMap (labelIDs )
329
338
330
339
for i := range labels {
331
340
if labelIDMark [labels [i ].ID ] {
Original file line number Diff line number Diff line change 58
58
{{if or .Labels .OrgLabels}}
59
59
{{range .Labels}}
60
60
<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>
62
62
{{end}}
63
63
64
64
<div class="ui divider"></div>
65
65
{{range .OrgLabels}}
66
66
<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>
68
68
{{end}}
69
69
{{else}}
70
70
<div class="header" style="text-transform: none;font-size:14px;">{{.locale.Tr "repo.issues.new.no_items"}}</div>
You can’t perform that action at this time.
0 commit comments