Skip to content

Commit fcf33b0

Browse files
committed
Use last index again, use suggested changes for warning layout
1 parent 5272881 commit fcf33b0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

models/issues/label.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ func (label *Label) ExclusiveScope() string {
194194
if !label.Exclusive {
195195
return ""
196196
}
197-
index := strings.Index(label.Name, "/")
198-
if index == -1 || index == 0 || index == len(label.Name)-1 {
197+
lastIndex := strings.LastIndex(label.Name, "/")
198+
if lastIndex == -1 || lastIndex == 0 || lastIndex == len(label.Name)-1 {
199199
return ""
200200
}
201-
return label.Name[:index]
201+
return label.Name[:lastIndex]
202202
}
203203

204204
// NewLabel creates a new label

templates/repo/issue/labels/edit_delete_label.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
</div>
4040
<br/>
4141
<small class="desc">{{.locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small>
42-
<div class="desc gt-hidden label-exclusive-warning">
43-
<br/>{{.locale.Tr "repo.issues.label_exclusive_warning" | Safe}}
42+
<div class="desc gt-ml-2 gt-mt-3 gt-hidden label-exclusive-warning">
43+
{{svg "octicon-alert"}} {{.locale.Tr "repo.issues.label_exclusive_warning" | Safe}}
4444
</div>
4545
</div>
4646
<div class="field">

0 commit comments

Comments
 (0)