Skip to content

Commit 67cbdad

Browse files
committed
fix
1 parent a716441 commit 67cbdad

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

models/issues/comment.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,14 @@ const (
199199
RoleDescriptorContributor Role = "contributor"
200200
)
201201

202-
// HasRole returns if a role is not none
203-
func (rd RoleDescriptor) HasRole() bool {
204-
return rd.Role != ""
205-
}
206-
207202
// LocaleString returns the locale string name of the Status
208203
func (r Role) LocaleString(lang translation.Locale) string {
209-
return lang.Tr("repo.issues.role." + r.Role)
204+
return lang.Tr("repo.issues.role." + string(r))
210205
}
211206

212207
// LocaleHelper returns the locale string name of the Status
213208
func (r Role) LocaleHelper(lang translation.Locale) string {
214-
return lang.Tr("repo.issues.role." + r.Role + "_helper")
209+
return lang.Tr("repo.issues.role." + string(r) + "_helper")
215210
}
216211

217212
// Comment represents a comment in commit and issue page.

templates/repo/issue/view_content/show_role.tmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
{{ctx.Locale.Tr "repo.issues.author"}}
44
</div>
55
{{end}}
6-
7-
{{if (.ShowRole.Role.HasRole)}}
6+
{{if .ShowRole.Role}}
87
<div class="ui basic label role-label" data-tooltip-content="{{.ShowRole.Role.LocaleHelper ctx.Locale}}">
98
{{.ShowRole.Role.LocaleString ctx.Locale}}
109
</div>

0 commit comments

Comments
 (0)