You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/routers/web/repo
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`
3 years ago
..
activity.go Propagate context and ensure git commands run in request context (#17868) 3 years ago
attachment.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
blame.go Refactor i18n, use Locale to provide i18n/translation related functions (#18648) 3 years ago
branch.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
cherry_pick.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
commit.go Collaborator trust model should trust collaborators (#18539) 3 years ago
compare.go Fix compare link in active feeds for new branch (#19149) 3 years ago
download.go format with gofumpt (#18184) 3 years ago
editor.go Update HTTP status codes to modern codes (#18063) 3 years ago
editor_test.go format with gofumpt (#18184) 3 years ago
http.go Add `ContextUser` to http request context (#18798) 3 years ago
http_test.go Fix http path bug (#16117) 4 years ago
issue.go Update HTTP status codes to modern codes (#18063) 3 years ago
issue_content_history.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
issue_dependency.go Update HTTP status codes to modern codes (#18063) 3 years ago
issue_label.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
issue_label_test.go Update HTTP status codes to modern codes (#18063) 3 years ago
issue_lock.go Update HTTP status codes to modern codes (#18063) 3 years ago
issue_stopwatch.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
issue_test.go format with gofumpt (#18184) 3 years ago
issue_timetrack.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
issue_watch.go Update HTTP status codes to modern codes (#18063) 3 years ago
lfs.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
main_test.go Decouple unit test code from business code (#17623) 3 years ago
middlewares.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
migrate.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
milestone.go Only view milestones from current repo (#18414) 3 years ago
patch.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
projects.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
projects_test.go Decouple unit test code from business code (#17623) 3 years ago
pull.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
pull_review.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
release.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
release_test.go Decouple unit test, remove intermediate `unittestbridge` package (#17662) 3 years ago
repo.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
search.go Update HTTP status codes to modern codes (#18063) 3 years ago
setting.go Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 3 years ago
setting_protected_branch.go Update HTTP status codes to modern codes (#18063) 3 years ago
settings_test.go Update HTTP status codes to modern codes (#18063) 3 years ago
tag.go Move repository model into models/repo (#17933) 3 years ago
topic.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
view.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
webhook.go Update HTTP status codes to modern codes (#18063) 3 years ago
wiki.go Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 3 years ago
wiki_test.go Update HTTP status codes to modern codes (#18063) 3 years ago