gitea/routers/web/repo
wxiaoguang ee242a08e9
Refactor issue template parsing and fix API endpoint (#29069)
The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes the
API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`
2024-02-12 05:04:10 +00:00
..
actions Display friendly error message (#29105) 2024-02-08 22:01:19 +00:00
setting Move some repository transfer functions to service layer (#28855) 2024-02-05 06:17:23 +00:00
activity.go
attachment.go
blame.go Use information from previous blame parts (#28572) 2023-12-21 22:48:18 +01:00
branch.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
cherry_pick.go
commit.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
compare.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
download.go
editor_test.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
editor.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
find.go
githttp_test.go
githttp.go Some refactor for git http (#28995) 2024-01-31 15:23:22 +00:00
helper_test.go
helper.go
issue_content_history.go Fix missing check (#28406) 2023-12-10 21:37:10 +02:00
issue_dependency.go
issue_label_test.go
issue_label.go
issue_lock.go
issue_pin.go Fix missing check (#28406) 2023-12-10 21:37:10 +02:00
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go Introduce htmx and use it to avoid full page load on Subscribe and Follow (#28908) 2024-01-30 15:45:54 +01:00
issue.go Refactor issue template parsing and fix API endpoint (#29069) 2024-02-12 05:04:10 +00:00
main_test.go
middlewares.go Improve user experience for outdated comments (#29050) 2024-02-08 01:50:48 +00:00
migrate.go
milestone.go Refactor issue template parsing and fix API endpoint (#29069) 2024-02-12 05:04:10 +00:00
packages.go
patch.go
projects_test.go
projects.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
pull_review_test.go Improve user experience for outdated comments (#29050) 2024-02-08 01:50:48 +00:00
pull_review.go Improve user experience for outdated comments (#29050) 2024-02-08 01:50:48 +00:00
pull.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
release_test.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
release.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
render.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
repo.go Don't do a full page load when clicking Watch or Star (#29001) 2024-02-05 09:56:20 +00:00
search.go
topic.go
treelist.go
view_test.go
view.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
wiki_test.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
wiki.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00