Skip to content

Commit 3c71376

Browse files
committed
fix render, fix access token scope
1 parent ef94ae9 commit 3c71376

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

modules/templates/util_render.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"math"
1111
"net/url"
1212
"regexp"
13-
"strconv"
1413
"strings"
1514
"unicode"
1615

@@ -173,16 +172,15 @@ func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML {
173172

174173
if label.ExclusiveOrder > 0 {
175174
// <scope> | <label> | <order>
176-
orderHTML := ut.RenderEmoji(strconv.Itoa(label.ExclusiveOrder))
177175
return htmlutil.HTMLFormat(`<span class="ui label %s scope-parent" data-tooltip-content title="%s">`+
178176
`<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>`+
179177
`<div class="ui label scope-middle" style="color: %s !important; background-color: %s !important">%s</div>`+
180-
`<div class="ui label scope-right">%s</div>`+
178+
`<div class="ui label scope-right">%d</div>`+
181179
`</span>`,
182180
extraCSSClasses, descriptionText,
183181
textColor, scopeColor, scopeHTML,
184182
textColor, itemColor, itemHTML,
185-
orderHTML)
183+
label.ExclusiveOrder)
186184
}
187185

188186
// <scope> | <label>

routers/web/user/setting/applications.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
auth_model "code.gitea.io/gitea/models/auth"
1212
"code.gitea.io/gitea/models/db"
13-
issues_model "code.gitea.io/gitea/models/issues"
1413
user_model "code.gitea.io/gitea/models/user"
1514
"code.gitea.io/gitea/modules/setting"
1615
"code.gitea.io/gitea/modules/templates"
@@ -44,8 +43,9 @@ func ApplicationsPost(ctx *context.Context) {
4443

4544
_ = ctx.Req.ParseForm()
4645
var scopeNames []string
46+
const accessTokenScopePrefix = "scope-"
4747
for k, v := range ctx.Req.Form {
48-
if strings.HasPrefix(k, issues_model.ScopeSortPrefix) {
48+
if strings.HasPrefix(k, accessTokenScopePrefix) {
4949
scopeNames = append(scopeNames, v...)
5050
}
5151
}

0 commit comments

Comments
 (0)