Skip to content
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

Move the captcha script loader to the template which really needs it #28718

Merged
merged 3 commits into from
Jan 7, 2024

Conversation

wxiaoguang
Copy link
Contributor

It improves the maintainability for the templates.

Now base/footer.tmpl doesn't need to depend on "captcha" feature.

@wxiaoguang wxiaoguang added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jan 7, 2024
@wxiaoguang wxiaoguang added this to the 1.22.0 milestone Jan 7, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 7, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 7, 2024
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jan 7, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 7, 2024
Copy link
Member

@delvh delvh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this won't break anything for somebody…

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 7, 2024
@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Jan 7, 2024

I hope this won't break anything for somebody…

These scripts are for the "captcha" elements.

Theoretically they are the same:

<body>
  <div> captcha html </div>
  <script src="captcha.js"></script>  <!-- the new approach -->
  <div> ... other code ... </div>
  <script src="index.js"></script>
</body>

vs

<body>
  <div> captcha html </div>
  <div> ... other code ... </div>
  <script src="captcha.js"></script> <!-- the old approach -->
  <script src="index.js"></script>
</body>

Update: and ideally, it should make JS do the async import (in the future ...), and then no need to use <script> tag in HTML code.

@wxiaoguang wxiaoguang enabled auto-merge (squash) January 7, 2024 14:54
@wxiaoguang wxiaoguang added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 7, 2024
@wxiaoguang wxiaoguang merged commit a04f8c0 into go-gitea:main Jan 7, 2024
25 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 7, 2024
@wxiaoguang wxiaoguang deleted the refactor-captcha branch January 8, 2024 01:10
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 8, 2024
* giteaofficial/main:
  [skip ci] Updated licenses and gitignores
  Move the captcha script loader to the template which really needs it (go-gitea#28718)
  Suggest to use Type=simple for systemd service (go-gitea#28717)
  Fix incorrect URL for "Reference in New Issue" (go-gitea#28716)
  Avoid unnecessary 500 panic when a commit doesn't exist (go-gitea#28719)
  [skip ci] Updated translations via Crowdin
  Improve frontend guideline (go-gitea#28711)
  Fix panic when parsing empty pgsql host (go-gitea#28708)
  Add merge arrow direction and update styling (go-gitea#28523)
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
…o-gitea#28718)

It improves the maintainability for the templates.

Now `base/footer.tmpl` doesn't need to depend on "captcha" feature.
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
…o-gitea#28718)

It improves the maintainability for the templates.

Now `base/footer.tmpl` doesn't need to depend on "captcha" feature.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/templates This PR modifies the template files size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants