summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-05-04 15:27:15 +0800
committerGitHub <noreply@github.com>2023-05-04 15:27:15 +0800
commitb1cee3fa3bbe9e54c3ced95fa9a38caa5b3494b9 (patch)
tree7db697eaf035465e8fa1ec65a23c4356aebeb308
parent5d77691d428d5302ee4df6c2a936b8e2ea9dca7e (diff)
downloadgitea-b1cee3fa3bbe9e54c3ced95fa9a38caa5b3494b9.tar.gz
gitea-b1cee3fa3bbe9e54c3ced95fa9a38caa5b3494b9.zip
Don't display creating page button in a mirror wiki repository (#24395)
A mirror repository with wiki is also a mirror. So creating page from UI should be disabled. This PR hides the button like other places.
-rw-r--r--options/locale/locale_en-US.ini1
-rw-r--r--templates/repo/settings/options.tmpl2
-rw-r--r--templates/repo/wiki/pages.tmpl2
3 files changed, 3 insertions, 2 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 180fd1c18d..83b978bee5 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1904,6 +1904,7 @@ settings.sync_mirror = Synchronize Now
settings.mirror_sync_in_progress = Mirror synchronization is in progress. Check back in a minute.
settings.site = Website
settings.update_settings = Update Settings
+settings.update_mirror_settings = Update Mirror Settings
settings.branches.switch_default_branch = Switch Default Branch
settings.branches.update_default_branch = Update Default Branch
settings.branches.add_new_rule = Add New Rule
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 688d00bd72..cd2854c062 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -153,7 +153,7 @@
</div>
{{end}}
<div class="field">
- <button class="ui green button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+ <button class="ui green button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button>
</div>
</form>
</td>
diff --git a/templates/repo/wiki/pages.tmpl b/templates/repo/wiki/pages.tmpl
index 97abf9b543..6169109ce9 100644
--- a/templates/repo/wiki/pages.tmpl
+++ b/templates/repo/wiki/pages.tmpl
@@ -5,7 +5,7 @@
<h2 class="ui header gt-df gt-ac gt-sb">
<span>{{.locale.Tr "repo.wiki.pages"}}</span>
<span>
- {{if and .CanWriteWiki (not .IsRepositoryMirror)}}
+ {{if and .CanWriteWiki (not .Repository.IsMirror)}}
<a class="ui green small button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
{{end}}
</span>