Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix templating in pull request comparison#33025

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
wxiaoguang merged 8 commits intogo-gitea:mainfromTheFox0x7:fix-alert-templates
Dec 29, 2024

Conversation

@TheFox0x7
Copy link
Contributor

Adds test for expected behavior

Closes:#33013


I'm not stuck on details being empty - I just don't know what to put in there. Suggestions welcome :)

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelDec 28, 2024
@github-actionsgithub-actionsbot added the modifies/goPull requests that update Go code labelDec 28, 2024
@wxiaoguang
Copy link
Contributor

wxiaoguang commentedDec 28, 2024
edited
Loading

I think it's better to fix it in template, but not add empty values to the map. Because if there is no details, the template shouldn't render that part.

(And in case the future developers would forget/not know that there must be a detail to make the template work ....)

{{.Message}}<details><summary>{{.Summary}}</summary>{{if .Details}}<code>{{.Details | SanitizeHTML}}</code>{{end}}</details>
TheFox0x7 reacted with thumbs up emoji

@TheFox0x7
Copy link
ContributorAuthor

This works but there's a downside of there still being the drop down arrow for it without any contents:
image

I came up with this to fix it:

{{.Message}}{{ if .Details }}<details><summary>{{.Summary}}</summary><code>{{.Details | SanitizeHTML}}</code></details>{{ else }}<div>{{ .Summary }}</div>{{ end }}

image

Let me know if that works or if I should leave the version with empty contents. I'm not sure if that has any impact somewhere else.

@wxiaoguang
Copy link
Contributor

I came up with this to fix it:

Yup, that's even better. Thank you!

@github-actionsgithub-actionsbot added the modifies/templatesThis PR modifies the template files labelDec 28, 2024
@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsDec 28, 2024
@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsDec 28, 2024
@lunnylunny added this to the1.24.0 milestoneDec 28, 2024
@wxiaoguangwxiaoguangenabled auto-merge (squash)December 28, 2024 18:52
@lunnylunny added the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelDec 29, 2024
@lunny
Copy link
Member

I think this could be backport to v1.23

@wxiaoguangwxiaoguang merged commitff96873 intogo-gitea:mainDec 29, 2024
26 checks passed
@GiteaBotGiteaBot removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelDec 29, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull requestDec 29, 2024
@GiteaBotGiteaBot added the backport/doneAll backports for this PR have been created labelDec 29, 2024
wxiaoguang pushed a commit that referenced this pull requestDec 29, 2024
Backport#33025 by TheFox0x7Adds test for expected behaviorCloses:#33013---Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull requestDec 30, 2024
* giteaofficial/main:  Refactor pagination (go-gitea#33037)  Test webhook email (go-gitea#33033)  Fix review code comment avatar alignment (go-gitea#33031)  Fix templating in pull request comparison (go-gitea#33025)  Refactor tests (go-gitea#33021)  [skip ci] Updated translations via Crowdin  always show assignees on right (go-gitea#33006)  fix toggle commit body button ui when latest commit message is long (go-gitea#32997)  Fix and/or comment some legacy CSS problems (go-gitea#33015)  Refactor comment history and fix content edit (go-gitea#33018)  Fix bug on activities (go-gitea#33008)  Refactor arch route handlers (go-gitea#32993)  fix scoped label ui when contains emoji (go-gitea#33007)  [skip ci] Updated translations via Crowdin  De-emphasize signed commits (go-gitea#31160)  Fix eslint (go-gitea#33002)  Fix Agit pull request permission check (go-gitea#32999)  Support for email addresses containing uppercase characters when activating user account (go-gitea#32998)
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsMar 29, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@lunnylunnylunny approved these changes

@wxiaoguangwxiaoguangwxiaoguang approved these changes

Assignees

No one assigned

Labels

backport/doneAll backports for this PR have been createdlgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/goPull requests that update Go codemodifies/templatesThis PR modifies the template files

Projects

None yet

Milestone

1.24.0

Development

Successfully merging this pull request may close these issues.

Alert templates on pull request comparison page don't work

4 participants

@TheFox0x7@wxiaoguang@lunny@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp