mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 20:56:19 +01:00
a01387f5b1
Fixes: https://github.com/go-gitea/gitea/issues/30384 On repo settings page, there id `repo_name` was used 5 times on the same page, some in modal and such. I think we are better off just auto-generating these IDs in the future so that labels link up with their form element. Ideally this id generation would be done in backend in a subtemplate, but seeing that we already have similar JS patches for checkboxes, I took the easy path for now. I also checked that these `#repo_name` were not in use in JS and the only case where this id appears in JS is on the migration page where it's still there. --------- Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit d4ec6b3d16496ce3b479d5a08f79823122dc2b7b) Conflicts: - templates/repo/settings/options.tmpl Conflict resolved by manually removing all `id` and `for` attributes from elements that had `repo_name` as their id.
759 lines
34 KiB
Go HTML Template
759 lines
34 KiB
Go HTML Template
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}
|
|
<div class="user-main-content twelve wide column">
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.settings.basic_settings"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{template "base/disable_form_autofill"}}
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="update">
|
|
<div class="required field {{if .Err_RepoName}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "repo.repo_name"}}</label>
|
|
<input name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
|
|
</div>
|
|
<div class="inline field">
|
|
<label>{{ctx.Locale.Tr "repo.repo_size"}}</label>
|
|
<span {{if not (eq .Repository.Size 0)}} data-tooltip-content="{{.Repository.SizeDetailsString ctx.Locale}}"{{end}}>{{ctx.Locale.TrSize .Repository.Size}}</span>
|
|
</div>
|
|
<div class="inline field">
|
|
<label>{{ctx.Locale.Tr "repo.template"}}</label>
|
|
<div class="ui checkbox">
|
|
<input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
|
|
<label>{{ctx.Locale.Tr "repo.template_helper"}}</label>
|
|
</div>
|
|
</div>
|
|
{{if not .Repository.IsFork}}
|
|
<div class="inline field">
|
|
<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
|
|
<div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{ctx.Locale.Tr "repo.stars_remove_warning"}}"{{end}}>
|
|
{{if .IsAdmin}}
|
|
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
|
|
{{else}}
|
|
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
|
|
{{end}}
|
|
<label>{{ctx.Locale.Tr "repo.visibility_helper"}} {{if .Repository.NumForks}}<span class="text red">{{ctx.Locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div class="field {{if .Err_Description}}error{{end}}">
|
|
<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
|
|
<textarea id="description" name="description" rows="2" maxlength="2048">{{.Repository.Description}}</textarea>
|
|
</div>
|
|
<div class="field {{if .Err_Website}}error{{end}}">
|
|
<label for="website">{{ctx.Locale.Tr "repo.settings.site"}}</label>
|
|
<input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}">
|
|
</div>
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="divider"></div>
|
|
<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
|
|
{{.CsrfTokenHtml}}
|
|
<div class="inline field">
|
|
<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
|
|
<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
|
|
</div>
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
|
|
<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
{{/* These variables exist to make the logic in the Settings window easier to comprehend and are not used later on. */}}
|
|
{{$newMirrorsPartiallyEnabled := or (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}}
|
|
{{/* .Repository.IsMirror is not always reliable if the repository is not actively acting as a mirror because of errors. */}}
|
|
{{$showMirrorSettings := and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (or $newMirrorsPartiallyEnabled .Repository.IsMirror .PullMirror .PushMirrors)}}
|
|
{{$newMirrorsEntirelyEnabled := and (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}}
|
|
{{$onlyNewPushMirrorsEnabled := and (not .DisableNewPushMirrors) .DisableNewPullMirrors}}
|
|
{{$onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors (not .DisableNewPullMirrors)}}
|
|
{{$existingPushMirror := or .Repository.IsMirror .PushMirrors}}
|
|
{{$modifyBrokenPullMirror := and .Repository.IsMirror (not .PullMirror)}}
|
|
{{$isWorkingPullMirror := .PullMirror}}
|
|
|
|
{{if $showMirrorSettings}}
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
{{if .Repository.IsArchived}}
|
|
<div class="ui warning message tw-text-center">
|
|
{{ctx.Locale.Tr "repo.settings.archive.mirrors_unavailable"}}
|
|
</div>
|
|
{{else}}
|
|
{{if $newMirrorsEntirelyEnabled}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs"}}
|
|
<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}}
|
|
<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br>
|
|
{{else if $onlyNewPushMirrorsEnabled}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
|
|
<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br>
|
|
{{else if $onlyNewPullMirrorsEnabled}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
|
|
<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}}
|
|
{{if $existingPushMirror}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
|
|
{{end}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
|
|
{{end}}
|
|
|
|
{{if .Repository.IsMirror}}
|
|
<table class="ui table">
|
|
<thead>
|
|
<tr>
|
|
<th class="tw-w-2/5">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
{{if $modifyBrokenPullMirror}}
|
|
{{/* even if a repo is a pull mirror (IsMirror=true), the PullMirror might still be nil if the mirror migration is broken */}}
|
|
<tbody>
|
|
<tr>
|
|
<td colspan="4">
|
|
<div class="text red tw-py-4">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
{{else if $isWorkingPullMirror}}
|
|
<tbody>
|
|
<tr>
|
|
<td>{{.PullMirror.RemoteAddress}}</td>
|
|
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
|
|
<td>{{DateTime "full" .PullMirror.UpdatedUnix}}</td>
|
|
<td class="right aligned">
|
|
<form method="post" class="tw-inline-block">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="mirror-sync">
|
|
<button class="ui primary tiny button inline text-thin">{{ctx.Locale.Tr "repo.settings.sync_mirror"}}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4">
|
|
<form class="ui form" method="post">
|
|
{{template "base/disable_form_autofill"}}
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="mirror">
|
|
<div class="inline field {{if .Err_EnablePrune}}error{{end}}">
|
|
<label>{{ctx.Locale.Tr "repo.mirror_prune"}}</label>
|
|
<div class="ui checkbox">
|
|
<input id="enable_prune" name="enable_prune" type="checkbox" {{if .PullMirror.EnablePrune}}checked{{end}}>
|
|
<label>{{ctx.Locale.Tr "repo.mirror_prune_desc"}}</label>
|
|
</div>
|
|
</div>
|
|
<div class="inline field {{if .Err_Interval}}error{{end}}">
|
|
<label for="interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
|
|
<input id="interval" name="interval" value="{{.PullMirror.Interval}}">
|
|
</div>
|
|
{{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName}}
|
|
<div class="field {{if .Err_MirrorAddress}}error{{end}}">
|
|
<label for="mirror_address">{{ctx.Locale.Tr "repo.mirror_address"}}</label>
|
|
<input id="mirror_address" name="mirror_address" value="{{$address.Address}}" required>
|
|
<p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
|
|
</div>
|
|
<details class="ui optional field" {{if or .Err_Auth $address.Username}}open{{end}}>
|
|
<summary class="tw-p-1">
|
|
{{ctx.Locale.Tr "repo.need_auth"}}
|
|
</summary>
|
|
<div class="tw-p-1">
|
|
<div class="inline field {{if .Err_Auth}}error{{end}}">
|
|
<label for="mirror_username">{{ctx.Locale.Tr "username"}}</label>
|
|
<input id="mirror_username" name="mirror_username" value="{{$address.Username}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
|
|
</div>
|
|
<div class="inline field {{if .Err_Auth}}error{{end}}">
|
|
<label for="mirror_password">{{ctx.Locale.Tr "password"}}</label>
|
|
<input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{ctx.Locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{ctx.Locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off">
|
|
</div>
|
|
<p class="help">{{ctx.Locale.Tr "repo.mirror_password_help"}}</p>
|
|
</div>
|
|
</details>
|
|
|
|
{{if .LFSStartServer}}
|
|
<div class="inline field">
|
|
<label>{{ctx.Locale.Tr "repo.mirror_lfs"}}</label>
|
|
<div class="ui checkbox">
|
|
<input id="mirror_lfs" name="mirror_lfs" type="checkbox" {{if .PullMirror.LFS}}checked{{end}}>
|
|
<label>{{ctx.Locale.Tr "repo.mirror_lfs_desc"}}</label>
|
|
</div>
|
|
</div>
|
|
<div class="field {{if .Err_LFSEndpoint}}error{{end}}">
|
|
<label for="mirror_lfs_endpoint">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint"}}</label>
|
|
<input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
|
|
<p class="help">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery"}}</p>
|
|
</div>
|
|
{{end}}
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_mirror_settings"}}</button>
|
|
</div>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
{{end}}{{/* end if: $modifyBrokenPullMirror / $isWorkingPullMirror */}}
|
|
</table>
|
|
{{end}}{{/* end if .Repository.IsMirror */}}
|
|
|
|
<table class="ui table">
|
|
<thead>
|
|
<tr>
|
|
<th class="tw-w-2/5">{{ctx.Locale.Tr "repo.settings.mirror_settings.pushed_repository"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
|
|
<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .PushMirrors}}
|
|
<tr>
|
|
<td class="gt-word-break">{{.RemoteAddress}}</td>
|
|
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
|
|
<td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
|
|
<td class="right aligned">
|
|
<button
|
|
class="ui tiny button show-modal"
|
|
data-modal="#push-mirror-edit-modal"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}"
|
|
data-modal-push-mirror-edit-id="{{.ID}}"
|
|
data-modal-push-mirror-edit-interval="{{.Interval}}"
|
|
data-modal-push-mirror-edit-address="{{.RemoteAddress}}"
|
|
>
|
|
{{svg "octicon-pencil" 14}}
|
|
</button>
|
|
<form method="post" class="tw-inline-block">
|
|
{{$.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="push-mirror-sync">
|
|
<input type="hidden" name="push_mirror_id" value="{{.ID}}">
|
|
<button class="ui primary tiny button" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button>
|
|
</form>
|
|
<form method="post" class="tw-inline-block">
|
|
{{$.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="push-mirror-remove">
|
|
<input type="hidden" name="push_mirror_id" value="{{.ID}}">
|
|
<button class="ui basic red tiny button" data-tooltip-content="{{ctx.Locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr>
|
|
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{if (not .DisableNewPushMirrors)}}
|
|
<tr>
|
|
<td colspan="4">
|
|
<form class="ui form" method="post">
|
|
{{template "base/disable_form_autofill"}}
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="push-mirror-add">
|
|
<div class="field {{if .Err_PushMirrorAddress}}error{{end}}">
|
|
<label for="push_mirror_address">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label>
|
|
<input id="push_mirror_address" name="push_mirror_address" value="{{.push_mirror_address}}" required>
|
|
<p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
|
|
</div>
|
|
<details class="ui optional field" {{if or .Err_PushMirrorAuth .push_mirror_username}}open{{end}}>
|
|
<summary class="tw-p-1">
|
|
{{ctx.Locale.Tr "repo.need_auth"}}
|
|
</summary>
|
|
<div class="tw-p-1">
|
|
<div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
|
|
<label for="push_mirror_username">{{ctx.Locale.Tr "username"}}</label>
|
|
<input id="push_mirror_username" name="push_mirror_username" value="{{.push_mirror_username}}">
|
|
</div>
|
|
<div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
|
|
<label for="push_mirror_password">{{ctx.Locale.Tr "password"}}</label>
|
|
<input id="push_mirror_password" name="push_mirror_password" type="password" value="{{.push_mirror_password}}" autocomplete="off">
|
|
</div>
|
|
</div>
|
|
</details>
|
|
<div class="field">
|
|
<div class="ui checkbox">
|
|
<input id="push_mirror_sync_on_commit" name="push_mirror_sync_on_commit" type="checkbox" {{if .push_mirror_sync_on_commit}}checked{{end}}>
|
|
<label for="push_mirror_sync_on_commit">{{ctx.Locale.Tr "repo.mirror_sync_on_commit"}}</label>
|
|
</div>
|
|
</div>
|
|
<div class="inline field {{if .Err_PushMirrorInterval}}error{{end}}">
|
|
<label for="push_mirror_interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
|
|
<input id="push_mirror_interval" name="push_mirror_interval" value="{{if .push_mirror_interval}}{{.push_mirror_interval}}{{else}}{{.DefaultMirrorInterval}}{{end}}">
|
|
</div>
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
|
|
</div>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.settings.signing_settings"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<form class="ui form" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="signing">
|
|
<div class="field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label><br>
|
|
<div class="field">
|
|
<div class="ui radio checkbox">
|
|
<input type="radio" id="trust_model_default" name="trust_model" {{if eq .Repository.TrustModel.String "default"}}checked="checked"{{end}} value="default">
|
|
<label for="trust_model_default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</label>
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.default.desc"}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<div class="ui radio checkbox">
|
|
<input type="radio" id="trust_model_collaborator" name="trust_model" {{if eq .Repository.TrustModel.String "collaborator"}}checked="checked"{{end}} value="collaborator">
|
|
<label for="trust_model_collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.long"}}</label>
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<div class="ui radio checkbox">
|
|
<input type="radio" name="trust_model" id="trust_model_committer" {{if eq .Repository.TrustModel.String "committer"}}checked="checked"{{end}} value="committer">
|
|
<label for="trust_model_committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer.long"}}</label>
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.committer.desc"}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<div class="ui radio checkbox">
|
|
<input type="radio" name="trust_model" id="trust_model_collaboratorcommitter" {{if eq .Repository.TrustModel.String "collaboratorcommitter"}}checked="checked"{{end}} value="collaboratorcommitter">
|
|
<label for="trust_model_collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label>
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
{{if .IsAdmin}}
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "repo.settings.admin_settings"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<form class="ui form" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="admin">
|
|
<div class="field">
|
|
<div class="ui checkbox">
|
|
<input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
|
|
<label>{{ctx.Locale.Tr "repo.settings.admin_enable_health_check"}}</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="divider"></div>
|
|
<form class="ui form" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="admin_index">
|
|
{{if .CodeIndexerEnabled}}
|
|
<h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
|
|
<div class="inline fields">
|
|
<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
|
|
<span class="field">
|
|
{{if .CodeIndexerStatus}}
|
|
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
|
|
<span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span>
|
|
</a>
|
|
{{else}}
|
|
<span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
|
|
{{end}}
|
|
</span>
|
|
<div class="field">
|
|
<button class="ui primary button" name="request_reindex_type" value="code">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
|
|
<div class="inline fields">
|
|
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
|
|
<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
|
|
{{end}}
|
|
<span class="field">
|
|
{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
|
|
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.StatsIndexerStatus.CommitSha}}">
|
|
<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
|
|
</a>
|
|
{{else}}
|
|
<span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
|
|
{{end}}
|
|
</span>
|
|
<div class="field">
|
|
<button class="ui primary button" name="request_reindex_type" value="stats">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .Permission.IsOwner}}
|
|
<h4 class="ui top attached error header">
|
|
{{ctx.Locale.Tr "repo.settings.danger_zone"}}
|
|
</h4>
|
|
<div class="ui attached error danger segment">
|
|
<div class="flex-list">
|
|
{{if .Repository.IsMirror}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_desc"}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{ctx.Locale.Tr "repo.settings.convert"}}</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div>
|
|
<div class="flex-item-body">
|
|
{{if .RepoTransfer}}
|
|
{{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "repo.settings.transfer_desc"}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
{{if .RepoTransfer}}
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="cancel_transfer">
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_abort"}}</button>
|
|
</form>
|
|
{{else}}
|
|
<button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{ctx.Locale.Tr "repo.settings.transfer"}}</button>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{if .Permission.CanRead $.UnitTypeWiki}}
|
|
{{if ne $.Repository.GetWikiBranchName .DefaultWikiBranchName}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main_desc" .DefaultWikiBranchName}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#rename-wiki-branch-modal">{{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main"}}</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.delete"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.delete_desc"}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button>
|
|
</div>
|
|
</div>
|
|
{{if not .Repository.IsMirror}}
|
|
<div class="flex-item tw-items-center">
|
|
<div class="flex-item-main">
|
|
{{if .Repository.IsArchived}}
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.unarchive.header"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.unarchive.text"}}</div>
|
|
{{else}}
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.archive.header"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.archive.text"}}</div>
|
|
{{end}}
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
|
|
{{if .Repository.IsArchived}}
|
|
{{ctx.Locale.Tr "repo.settings.unarchive.button"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "repo.settings.archive.button"}}
|
|
{{end}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{template "repo/settings/layout_footer" .}}
|
|
|
|
{{if .Permission.IsOwner}}
|
|
{{if .Repository.IsMirror}}
|
|
<div class="ui small modal" id="convert-mirror-repo-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.convert"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
{{ctx.Locale.Tr "repo.settings.convert_notices_1"}}
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="convert">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.settings.enter_repo_name"}}
|
|
<span class="text red">{{.Repository.FullName}}</span>
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label>
|
|
<input name="repo_name" required maxlength="100">
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_confirm"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
|
|
<div class="ui small modal" id="convert-fork-repo-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.convert_fork"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
{{ctx.Locale.Tr "repo.settings.convert_fork_notices_1"}}
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="convert_fork">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.settings.enter_repo_name"}}
|
|
<span class="text red">{{.Repository.FullName}}</span>
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label>
|
|
<input name="repo_name" required>
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_fork_confirm"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div class="ui small modal" id="transfer-repo-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.transfer"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
{{ctx.Locale.Tr "repo.settings.transfer_notices_1"}} <br>
|
|
{{ctx.Locale.Tr "repo.settings.transfer_notices_2"}} <br>
|
|
{{ctx.Locale.Tr "repo.settings.transfer_notices_3"}}
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="transfer">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.settings.enter_repo_name"}}
|
|
<span class="text red">{{.Repository.FullName}}</span>
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label>
|
|
<input name="repo_name" required>
|
|
</div>
|
|
<div class="required field">
|
|
<label for="new_owner_name">{{ctx.Locale.Tr "repo.settings.transfer_owner"}}</label>
|
|
<input id="new_owner_name" name="new_owner_name" required>
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_perform"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="ui small modal" id="delete-repo-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.delete"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
{{ctx.Locale.Tr "repo.settings.delete_notices_1"}}<br>
|
|
{{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName}}
|
|
{{if .Repository.NumForks}}<br>
|
|
{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
|
|
{{end}}
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="delete">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.settings.enter_repo_name"}}
|
|
<span class="text red">{{.Repository.FullName}}</span>
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label for="repo_name_to_delete">{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label>
|
|
<input id="repo_name_to_delete" name="repo_name" required>
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}}
|
|
<div class="ui small modal" id="delete-wiki-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.wiki_delete"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
{{ctx.Locale.Tr "repo.settings.delete_notices_1"}}<br>
|
|
{{ctx.Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name}}
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="delete-wiki">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.settings.enter_repo_name"}}
|
|
<span class="text red">{{.Repository.FullName}}</span>
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label>
|
|
<input name="repo_name" required>
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{if ne $.Repository.GetWikiBranchName .DefaultWikiBranchName}}
|
|
<div class="ui small modal" id="rename-wiki-branch-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
<ul>
|
|
<li>{{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main_notices_1"}}</li>
|
|
<li>{{ctx.Locale.Tr "repo.settings.wiki_rename_branch_main_notices_2" .Repository.Name}}</li>
|
|
</ul>
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="rename-wiki-branch">
|
|
<div class="field">
|
|
<label>
|
|
{{ctx.Locale.Tr "repo.settings.enter_repo_name"}}
|
|
<span class="text red">{{.Repository.FullName}}</span>
|
|
</label>
|
|
</div>
|
|
<div class="required field">
|
|
<label>{{ctx.Locale.Tr "repo.settings.confirmation_string"}}</label>
|
|
<input name="repo_name" required>
|
|
</div>
|
|
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_branch_rename"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{if not .Repository.IsMirror}}
|
|
<div class="ui g-modal-confirm modal" id="archive-repo-modal">
|
|
<div class="header">
|
|
{{if .Repository.IsArchived}}
|
|
{{ctx.Locale.Tr "repo.settings.unarchive.header"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "repo.settings.archive.header"}}
|
|
{{end}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message">
|
|
{{if .Repository.IsArchived}}
|
|
{{ctx.Locale.Tr "repo.settings.unarchive.text"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "repo.settings.archive.text"}}
|
|
{{end}}
|
|
</div>
|
|
<form action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
|
|
<input type="hidden" name="repo_id" value="{{.Repository.ID}}">
|
|
<div class="text right actions">
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
<button class="ui red button">
|
|
{{if .Repository.IsArchived}}
|
|
{{ctx.Locale.Tr "repo.settings.unarchive.button"}}
|
|
{{else}}
|
|
{{ctx.Locale.Tr "repo.settings.archive.button"}}
|
|
{{end}}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{template "repo/settings/push_mirror_sync_modal" .}}
|