Add CurrentURL template variable back#37444
Merged
wxiaoguang merged 2 commits intogo-gitea:mainfrom Apr 27, 2026
Merged
Conversation
silverwind
reviewed
Apr 26, 2026
| base := NewBaseContext(resp, req) | ||
| ctx := NewWebContext(base, rnd, session.GetContextSession(req)) | ||
| ctx.Data.MergeFrom(middleware.CommonTemplateContextData()) | ||
| ctx.Data["CurrentURL"] = setting.AppSubURL + req.URL.RequestURI() |
Member
There was a problem hiding this comment.
Suggested change
| ctx.Data["CurrentURL"] = setting.AppSubURL + req.URL.RequestURI() | |
| ctx.Data["CurrentURL"] = setting.AppSubURL + req.URL.RequestURI() // legacy - do not use |
Contributor
Author
There was a problem hiding this comment.
Commenting or not, there is no different.
- If our code base is clear enough, no one will try to use such a variable, the same to a lot of others.
- If in the future it still needs to use such variables, there is nothing wrong.
Just keep the code simple and no need to add more comments.
silverwind
approved these changes
Apr 27, 2026
lunny
approved these changes
Apr 27, 2026
Collaborator
|
I was unable to create a backport for 1.26. @wxiaoguang, please send one manually. 🍵 |
silverwind
added a commit
to hanism01/gitea
that referenced
this pull request
Apr 27, 2026
…-review-feedback * origin/main: (144 commits) Add API endpoint to reply to pull request review comments (go-gitea#36683) Add CurrentURL template variable back (go-gitea#37444) refactor: use named `Permission` field in `Repository` struct instead of anonymous embedding (go-gitea#37441) Refactor pull request view (3) (go-gitea#37439) Update 1.26.1 changelog in main (go-gitea#37442) Make GetPossibleUserByID can handle deleted user (go-gitea#37430) Fix fetch action redirect (go-gitea#37437) Refactor integration test DecodeJSON calls to use generic return value (go-gitea#37432) Integrate renovate bot for all dependency updates (go-gitea#37050) Refactor pull request view (2) (go-gitea#37428) Use MarkLongPolling instead of hard-coded route path (go-gitea#37427) Optimize CI caches (go-gitea#37387) Update AGENTS.md (go-gitea#37420) Update Nix flake (go-gitea#37425) [skip ci] Updated translations via Crowdin remove excessive quote from terraform instructions (go-gitea#37424) Improve testing init, clean up webhook tests (go-gitea#37412) Fix color regressions, add `priority` color (go-gitea#37417) [skip ci] Updated translations via Crowdin Stabilize e2e logout propagation test (go-gitea#37403) ... # Conflicts: # models/project/column.go # routers/web/repo/issue_page_meta.go
wxiaoguang
added a commit
that referenced
this pull request
Apr 27, 2026
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Apr 29, 2026
* main: Add DEFAULT_TITLE_SOURCE setting for pull request title default behavior (go-gitea#37465) Fix compare dropdown for branches without common history (go-gitea#37470) FIX: URL sanitization to handle schemeless credentials (go-gitea#37440) Refactor pull request view (4) (go-gitea#37451) Fix scheduled action panic with null event payload (go-gitea#37459) Fix attachment Content-Security-Policy (go-gitea#37455) [skip ci] Updated translations via Crowdin Rename CurrentRefPath to CurrentRefSubURL (go-gitea#37453) Clean up org pages layout (go-gitea#37445) Fix script error alert (go-gitea#37458) Fix inconsistent disabled styling on logged-out repo header buttons (go-gitea#37406) Add API endpoint to reply to pull request review comments (go-gitea#36683) Add CurrentURL template variable back (go-gitea#37444)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because some custom template users need it, also add a new test and comments