Skip to content

Hide 'Mirror Settings' when unneeded, improve hints #24433

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

Merged
merged 18 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,11 @@ settings.hooks = Webhooks
settings.githooks = Git Hooks
settings.basic_settings = Basic Settings
settings.mirror_settings = Mirror Settings
settings.mirror_settings.docs = Set up your project to automatically push and/or pull changes to/from another repository. Branches, tags, and commits will be synced automatically. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/repo-mirror/">How do I mirror repositories?</a>
settings.mirror_settings.docs = Set up your project to automatically push and/or pull changes to/from another repository. Branches, tags, and commits will be synced automatically. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/usage/repo-mirror/">How do I mirror repositories?</a>
settings.mirror_settings.docs.no_new_pull_mirrors = Set up your project to automatically push changes to another repository. Branches, tags, and commits will be synced automatically. <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/usage/repo-mirror/#pushing-to-a-remote-repository">How do I mirror repositories?</a>
settings.mirror_settings.docs.no_new_push_mirrors = Push mirrors are currently disabled on your instance.
settings.mirror_settings.docs.no_new_mirrors = Your repository is mirroring changes to/from another repository. Please keep in mind that you can't create any new mirrors at this time, however, you may still modify your settings here. <a target="_blank" rel="noopener noreferrer"https://docs.gitea.io/en-us/repo-mirror/">How do I mirror repositories?</a>
settings.mirror_settings.docs.pull_mirror_instructions = To set up a pull mirror, please consult <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/usage/repo-mirror/#pulling-from-a-remote-repository">"Pulling from a remote repository" section</a>.
settings.mirror_settings.mirrored_repository = Mirrored repository
settings.mirror_settings.direction = Direction
settings.mirror_settings.direction.pull = Pull
Expand Down
12 changes: 10 additions & 2 deletions templates/repo/settings/options.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,20 @@

</div>

{{if .MirrorsEnabled}}
{{if and .MirrorsEnabled (or (or .PullMirrors .PushMirrors) .Repository.IsMirror)}}
<h4 class="ui top attached header">
{{.locale.Tr "repo.settings.mirror_settings"}}
</h4>
<div class="ui attached segment">
{{$.locale.Tr "repo.settings.mirror_settings.docs" | Safe}}
{{if and .PushMirrors .PullMirrors}}
{{$.locale.Tr "repo.settings.mirror_settings.docs" | Safe}} {{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions" | Safe}}
{{else if and .PushMirrors (not .PullMirrors)}}
{{$.locale.Tr "repo.settings.mirror_settings.docs.no_new_pull_mirrors" | Safe}}
{{else if and (not .PushMirrors) .PullMirrors}}
{{$.locale.Tr "repo.settings.mirror_settings.docs_no_new_push_mirrors" | Safe}} {{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions" | Safe}}
{{else}}
{{$.locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors" | Safe}}
{{end}}
<table class="ui table">
{{if or .Repository.IsMirror .PushMirrors}}
<thead>
Expand Down