-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix issue filter #34914
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 issue filter #34914
Conversation
`0` is zero value and won't be put into query parameter by QueryBuild Fix go-gitea#34913
Manually backported then no need to wait for the bot. It seems the for most time the bot only does the backport then main branch gets another push. |
* giteaofficial/main: Fix modal + form abuse (go-gitea#34921) [skip ci] Updated translations via Crowdin Follow file symlinks in the UI to their target (go-gitea#28835) Fix issue filter (go-gitea#34914) Fix: RPM package download routing & missing package version count (go-gitea#34909) Add support for 3D/CAD file formats preview (go-gitea#34794)
@@ -15,7 +15,7 @@ | |||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}"> | |||
</div> | |||
<div class="divider"></div> | |||
<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" 0}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> | |||
<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we write NIL
as uppercase? Shouldn't it work as nil
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Golang team's strange decision. Template can't use "nil", so we use our template helper function NIL
Maybe related to
https://github.com/golang/go/issues/58326
https://github.com/golang/go/issues/57773
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have a few cases of lowercase nil
in the templates, and I recall they work:
templates/repo/file_info.tmpl:7: {{if ne .NumLines nil}}
templates/repo/file_info.tmpl:12: {{if ne .FileSize nil}}
templates/repo/issue/view_content.tmpl:8: {{ctx.AvatarUtils.Avatar nil 40}}
templates/repo/issue/view_content/comments.tmpl:21: {{ctx.AvatarUtils.Avatar nil 40}}
templates/repo/diff/comments.tmpl:6: <span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's different. Official document and issue have explained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The real example is:
{{$var := nil}}
, it fails. We have to use {{$var := NIL}}
…h/gitea into feature/enhanced-workflow-runs-api * 'feature/enhanced-workflow-runs-api' of github.com:bdruth/gitea: [skip ci] Updated translations via Crowdin Follow file symlinks in the UI to their target (go-gitea#28835) Fix issue filter (go-gitea#34914) Fix: RPM package download routing & missing package version count (go-gitea#34909) Add support for 3D/CAD file formats preview (go-gitea#34794) Add a `login`/`login-name`/`username` disambiguation to affected endpoint parameters and response/request models (go-gitea#34901) Improve tags list page (go-gitea#34898) [skip ci] Updated translations via Crowdin docs: fix typo in pull request merge warning message text (go-gitea#34899) Refactor container package (go-gitea#34877) [skip ci] Updated translations via Crowdin
0
is zero value and won't be put into query parameter by QueryBuildFix #34913