Skip to content

Commit b1cee3f

Browse files
authored
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.
1 parent 5d77691 commit b1cee3f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,7 @@ settings.sync_mirror = Synchronize Now
19041904
settings.mirror_sync_in_progress = Mirror synchronization is in progress. Check back in a minute.
19051905
settings.site = Website
19061906
settings.update_settings = Update Settings
1907+
settings.update_mirror_settings = Update Mirror Settings
19071908
settings.branches.switch_default_branch = Switch Default Branch
19081909
settings.branches.update_default_branch = Update Default Branch
19091910
settings.branches.add_new_rule = Add New Rule

templates/repo/settings/options.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
</div>
154154
{{end}}
155155
<div class="field">
156-
<button class="ui green button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
156+
<button class="ui green button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button>
157157
</div>
158158
</form>
159159
</td>

templates/repo/wiki/pages.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h2 class="ui header gt-df gt-ac gt-sb">
66
<span>{{.locale.Tr "repo.wiki.pages"}}</span>
77
<span>
8-
{{if and .CanWriteWiki (not .IsRepositoryMirror)}}
8+
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
99
<a class="ui green small button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
1010
{{end}}
1111
</span>

0 commit comments

Comments
 (0)