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.
pull/24515/head^2
Lunny Xiao 2 years ago committed by GitHub
parent 5d77691d42
commit b1cee3fa3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      options/locale/locale_en-US.ini
  2. 2
      templates/repo/settings/options.tmpl
  3. 2
      templates/repo/wiki/pages.tmpl

@ -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

@ -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>

@ -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>

Loading…
Cancel
Save