Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all rounded borders, change affected tab menus to pills #30707

Merged
merged 24 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions routers/web/repo/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ func DiffPreviewPost(ctx *context.Context) {
}

if diff.NumFiles == 0 {
ctx.HTMLString(http.StatusOK, `<div class="tw-p-6">`+ctx.Locale.TrString("repo.editor.no_changes_to_show")+`</div>`)
return
ctx.Data["File"] = nil
} else {
ctx.Data["File"] = diff.Files[0]
wxiaoguang marked this conversation as resolved.
Show resolved Hide resolved
}
ctx.Data["File"] = diff.Files[0]

ctx.HTML(http.StatusOK, tplEditDiffPreview)
}
Expand Down
9 changes: 0 additions & 9 deletions services/context/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,6 @@ func (b *Base) JSON(status int, content any) {
}
}

// HTMLString renders string as HTML
func (b *Base) HTMLString(status int, html string) {
b.Resp.Header().Set("Content-Type", "text/html;charset=utf-8")
b.Resp.WriteHeader(status)
if _, err := b.Resp.Write([]byte(html)); err != nil {
log.Error("Render HTMLString failed: %v", err)
}
}

// RemoteAddr returns the client machine ip address
func (b *Base) RemoteAddr() string {
return b.Req.RemoteAddr
Expand Down
6 changes: 6 additions & 0 deletions templates/repo/editor/diff_preview.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{if .File}}
<div class="diff-file-box">
<div class="ui attached table segment">
<div class="file-body file-code code-diff code-diff-unified unicode-escaped">
Expand All @@ -9,3 +10,8 @@
</div>
</div>
</div>
{{else}}
<div class="tw-p-6">
{{ctx.Locale.Tr "repo.editor.no_changes_to_show"}}
</div>
{{end}}