Skip to content

Commit 4e52857

Browse files
committed
remove unused element
1 parent d21143b commit 4e52857

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

routers/web/repo/issue_comment.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import (
99
"html/template"
1010
"net/http"
1111
"strconv"
12+
"strings"
1213

1314
issues_model "code.gitea.io/gitea/models/issues"
1415
"code.gitea.io/gitea/models/renderhelper"
1516
user_model "code.gitea.io/gitea/models/user"
1617
"code.gitea.io/gitea/modules/git"
1718
"code.gitea.io/gitea/modules/gitrepo"
19+
"code.gitea.io/gitea/modules/htmlutil"
1820
"code.gitea.io/gitea/modules/log"
1921
"code.gitea.io/gitea/modules/markup/markdown"
2022
repo_module "code.gitea.io/gitea/modules/repository"
@@ -287,9 +289,10 @@ func UpdateCommentContent(ctx *context.Context) {
287289
ctx.ServerError("RenderString", err)
288290
return
289291
}
290-
} else {
291-
contentEmpty := fmt.Sprintf(`<span class="no-content">%s</span>`, ctx.Tr("repo.issues.no_content"))
292-
renderedContent = template.HTML(contentEmpty)
292+
}
293+
294+
if strings.TrimSpace(string(renderedContent)) == "" {
295+
renderedContent = htmlutil.HTMLFormat(`<span class="no-content">%s</span>`, ctx.Tr("repo.issues.no_content"))
293296
}
294297

295298
ctx.JSON(http.StatusOK, map[string]any{

templates/repo/issue/view_content.tmpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@
168168
{{template "repo/issue/view_content/reference_issue_dialog" .}}
169169
{{template "shared/user/block_user_dialog" .}}
170170

171-
<div class="tw-hidden" id="no-content">
172-
<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
173-
</div>
174-
175171
<div class="ui g-modal-confirm delete modal">
176172
<div class="header">
177173
{{svg "octicon-trash"}}

0 commit comments

Comments
 (0)