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.
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`
2 years ago
..
branch Prevent double encoding of branch names in delete branch (#18714) 2 years ago
diff Added auto-save whitespace behavior if it changed manually (#15566) 2 years ago
editor Fix broken cancel button link on patch page (#18718) 2 years ago
graph Propagate context and ensure git commands run in request context (#17868) 2 years ago
issue Use the new/choose link for New Issue on project page (#19172) 2 years ago
migrate Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 2 years ago
projects Use the new/choose link for New Issue on project page (#19172) 2 years ago
pulls Improvements to content history (#17746) 3 years ago
release Prevent double encoding of branch names in delete branch (#18714) 2 years ago
settings Add config option to disable "Update branch by rebase" (#18745) 2 years ago
wiki Refactor i18n, use Locale to provide i18n/translation related functions (#18648) 2 years ago
activity.tmpl Refactor i18n, use Locale to provide i18n/translation related functions (#18648) 2 years ago
blame.tmpl Add warning for BIDI characters in page renders and in diffs (#17562) 3 years ago
branch_dropdown.tmpl Add apply-patch, basic revert and cherry-pick functionality (#17902) 2 years ago
clone_buttons.tmpl Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 2 years ago
commit_page.tmpl Show fullname on issue edits and gpg/ssh signing info (#18827) 2 years ago
commit_status.tmpl Show dropdown with all statuses for commit (#13977) 4 years ago
commit_statuses.tmpl Separate the details links of commit-statuses in headers (#18661) 2 years ago
commits.tmpl Add compare tag dropdown to releases page (#15695) 3 years ago
commits_list.tmpl Refactor i18n, use Locale to provide i18n/translation related functions (#18648) 2 years ago
commits_list_small.tmpl Fix a broken link in `commits_list_small.tmpl` (#18763) 2 years ago
commits_table.tmpl Cleanup and use global style on popups (#17674) 3 years ago
create.tmpl Unify and simplify TrN for i18n (#18141) 3 years ago
empty.tmpl Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 2 years ago
forks.tmpl Add pagination to fork list (#17639) 3 years ago
graph.tmpl Re-separate the color translation strings (#17390) 3 years ago
header.tmpl Propagate context and ensure git commands run in request context (#17868) 2 years ago
home.tmpl Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 2 years ago
icon.tmpl Do not display org avatar near icon for internal repos (#13957) 4 years ago
search.tmpl Automatically pause queue if index service is unavailable (#15066) 2 years ago
shabox_badge.tmpl Fix avatar template error (#13833) 4 years ago
sub_menu.tmpl Unify and simplify TrN for i18n (#18141) 3 years ago
unicode_escape_prompt.tmpl Left-Align text in Unicode warning boxes (#18331) 2 years ago
upload.tmpl Add attachments for PR reviews (#16075) 3 years ago
user_cards.tmpl Direct avatar rendering (#13649) 4 years ago
view_file.tmpl Set `rel="nofollow noindex"` on new issue links (#19023) 2 years ago
view_list.tmpl Refactor i18n, use Locale to provide i18n/translation related functions (#18648) 2 years ago
watchers.tmpl Add class to page content to unify top margin (#13766) 4 years ago