forgejo/modules/context
wxiaoguang d4c789dfc1
Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208)
The last PR about clone buttons introduced an JS error when visiting an empty repo page:
* https://github.com/go-gitea/gitea/pull/19028
* `Uncaught ReferenceError: isSSH is not defined`, because the variables are scoped and doesn't share between sub templates.

This:
1. Simplify `templates/repo/clone_buttons.tmpl` and make code clear
2. Move most JS code into `initRepoCloneLink`
3. Remove unused `CloneLink.Git`
4. Remove `ctx.Data["DisableSSH"] / ctx.Data["ExposeAnonSSH"] / ctx.Data["DisableHTTP"]`, and only set them when is is needed (eg: deploy keys / ssh keys)
5. Introduce `Data["CloneButton*"]` to provide data for clone buttons and links
6. Introduce `Data["RepoCloneLink"]` for the repo clone link (not the wiki)
7. Remove most `ctx.Data["PageIsWiki"]` because it has been set in the `/wiki` middleware
8. Remove incorrect `quickstart` class in `migrating.tmpl`
2022-03-29 05:21:30 +02:00
..
access_log.go Pass down SignedUserName down to AccessLogger context (#16605) 2021-08-04 13:26:30 -04:00
api.go Update HTTP status codes to modern codes (#18063) 2022-03-23 12:54:07 +08:00
api_org.go Use a standalone struct name for Organization (#17632) 2021-11-19 19:41:40 +08:00
api_test.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
auth.go Renamed ctx.User to ctx.Doer. (#19161) 2022-03-22 15:03:22 +08:00
captcha.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
context.go Add ContextUser to http request context (#18798) 2022-03-26 17:04:22 +08:00
csrf.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
form.go Add config options to hide issue events (#17414) 2022-01-21 18:59:26 +01:00
org.go Add ContextUser to http request context (#18798) 2022-03-26 17:04:22 +08:00
pagination.go Refactor admin user filter query parameters (#18965) 2022-03-02 16:30:14 +01:00
permission.go Renamed ctx.User to ctx.Doer. (#19161) 2022-03-22 15:03:22 +08:00
private.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
repo.go Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 2022-03-29 05:21:30 +02:00
response.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
xsrf.go Move macaron to chi (#14293) 2021-01-26 16:36:53 +01:00
xsrf_test.go Move macaron to chi (#14293) 2021-01-26 16:36:53 +01:00