-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor repo clone button and repo clone links, fix JS error on empty repo page #19208
Conversation
c93d979
to
6cff34c
Compare
6cff34c
to
0632a73
Compare
0632a73
to
f2ef337
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor English changes.
Otherwise I thought we were going to try to remove jQuery in an opportunistic manner - this seems like an opportune refactor.
Co-authored-by: zeripath <art27@cantab.net>
Updated
|
* giteaoffical/main: (31 commits) Add Package Registry (go-gitea#16510) Show messages for users if the ROOT_URL is wrong, show JavaScript errors (go-gitea#18971) [skip ci] Updated translations via Crowdin Make git.OpenRepository accept Context (go-gitea#19260) Use full output of git show-ref --tags to get tags for PushUpdateAddTag (go-gitea#19235) When conflicts have been previously detected ensure that they can be resolved (go-gitea#19247) More commit info from API (go-gitea#19252) Move some issue methods as functions (go-gitea#19255) Move project files into models/project sub package (go-gitea#17704) Granular webhook events in editHook (go-gitea#19251) Provide configuration to allow camo-media proxying (go-gitea#12802) Move init repository related functions to modules (go-gitea#19159) Move organization related structs into sub package (go-gitea#18518) Refactor repo clone button and repo clone links, fix JS error on empty repo page (go-gitea#19208) Show last cron messages on monitor page (go-gitea#19223) Allow API to create file on empty repo (go-gitea#19224) Use goproxy.io instead of goproxy.cn (go-gitea#19242) New cron task: delete old system notices (go-gitea#19219) Let web and API routes have different auth methods group (go-gitea#19168) Only send webhook events to active system webhooks and only deliver to active hooks (go-gitea#19234) ...
The last PR about clone buttons introduced an JS error when visiting an empty repo page:
Uncaught ReferenceError: isSSH is not defined
, because the variables are scoped and doesn't share between sub templates.This PR:
templates/repo/clone_buttons.tmpl
and make code clearinitRepoCloneLink
CloneLink.Git
ctx.Data["DisableSSH"] / ctx.Data["ExposeAnonSSH"] / ctx.Data["DisableHTTP"]
, and only set them when is is needed (eg: deploy keys / ssh keys)Data["CloneButton*"]
to provide data for clone buttons and linksData["RepoCloneLink"]
for the repo clone link (not the wiki)ctx.Data["PageIsWiki"]
because it has been set in the/wiki
middlewarequickstart
class inmigrating.tmpl
The backport fix for 1.16 is #19209, which is a very simple fix, no refactoring.
Screenshot
Disable SSH / Disable SSH and HTTP
Disable HTTP
Both HTTP and SSH
Wiki Page
go-get