mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 12:53:57 +01:00
Locales, field & action
This commit is contained in:
parent
fdcff3cc43
commit
9dcdf8d828
4 changed files with 29 additions and 9 deletions
|
@ -136,6 +136,8 @@ type Repository struct {
|
||||||
OriginalURL string `xorm:"VARCHAR(2048)"`
|
OriginalURL string `xorm:"VARCHAR(2048)"`
|
||||||
DefaultBranch string
|
DefaultBranch string
|
||||||
WikiBranch string
|
WikiBranch string
|
||||||
|
// TODO: Create own table out of this field
|
||||||
|
FederationRepos string
|
||||||
|
|
||||||
NumWatches int
|
NumWatches int
|
||||||
NumStars int
|
NumStars int
|
||||||
|
|
|
@ -1991,6 +1991,7 @@ settings.collaboration.undefined=Nicht definiert
|
||||||
settings.hooks=Webhooks
|
settings.hooks=Webhooks
|
||||||
settings.githooks=Git-Hooks
|
settings.githooks=Git-Hooks
|
||||||
settings.basic_settings=Grundeinstellungen
|
settings.basic_settings=Grundeinstellungen
|
||||||
|
settings.federation_settings=Federation-Einstellungen
|
||||||
settings.mirror_settings=Mirror-Einstellungen
|
settings.mirror_settings=Mirror-Einstellungen
|
||||||
settings.mirror_settings.docs=Richte Dein Repository so ein, dass es automatisch Commits, Tags und Branches mit einem anderen Repository synchronisieren kann.
|
settings.mirror_settings.docs=Richte Dein Repository so ein, dass es automatisch Commits, Tags und Branches mit einem anderen Repository synchronisieren kann.
|
||||||
settings.mirror_settings.docs.disabled_pull_mirror.instructions=Richte Dein Projekt so ein, dass es automatisch Commits, Tags und Branches in ein anderes Repository pusht. Pull-Mirrors wurden von Deinem Website-Administrator deaktiviert.
|
settings.mirror_settings.docs.disabled_pull_mirror.instructions=Richte Dein Projekt so ein, dass es automatisch Commits, Tags und Branches in ein anderes Repository pusht. Pull-Mirrors wurden von Deinem Website-Administrator deaktiviert.
|
||||||
|
|
|
@ -2042,6 +2042,7 @@ settings.collaboration.undefined = Undefined
|
||||||
settings.hooks = Webhooks
|
settings.hooks = Webhooks
|
||||||
settings.githooks = Git Hooks
|
settings.githooks = Git Hooks
|
||||||
settings.basic_settings = Basic Settings
|
settings.basic_settings = Basic Settings
|
||||||
|
settings.federation_settings=Federation Settings
|
||||||
settings.mirror_settings = Mirror Settings
|
settings.mirror_settings = Mirror Settings
|
||||||
settings.mirror_settings.docs = Set up your repository to automatically synchronize commits, tags and branches with another repository.
|
settings.mirror_settings.docs = Set up your repository to automatically synchronize commits, tags and branches with another repository.
|
||||||
settings.mirror_settings.docs.disabled_pull_mirror.instructions = Set up your project to automatically push commits, tags and branches to another repository. Pull mirrors have been disabled by your site administrator.
|
settings.mirror_settings.docs.disabled_pull_mirror.instructions = Set up your project to automatically push commits, tags and branches to another repository. Pull mirrors have been disabled by your site administrator.
|
||||||
|
|
|
@ -63,11 +63,35 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
/* TODO: get true/false from settings */
|
||||||
|
{{$showFederationSettings := true}}
|
||||||
|
{{if $showFederationSettings}}
|
||||||
|
<h4 class="ui top attached header">
|
||||||
|
{{ctx.Locale.Tr "repo.settings.federation_settings"}}
|
||||||
|
</h4>
|
||||||
|
<div class="ui attached segment">
|
||||||
|
<form class="ui form" method="post">
|
||||||
|
{{.CsrfTokenHtml}}
|
||||||
|
<input type="hidden" name="action" value="federation">
|
||||||
|
|
||||||
|
/* TODO: implement Err_FederationRepos somewhere */
|
||||||
|
<div class="field {{if .Err_FederationRepos}}error{{end}}">
|
||||||
|
/* TODO: internationalize text */
|
||||||
|
<label for="federation_repos">Federation Repositories</label>
|
||||||
|
<input id="federation_repos" name="federation_repos" value="{{.Repository.FederationRepos}}" data-repo-name="{{.Repository.FederationRepos}}">
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
|
||||||
{{/* These variables exist to make the logic in the Settings window easier to comprehend and are not used later on. */}}
|
{{/* 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)}}
|
{{$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. */}}
|
{{/* .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)}}
|
{{$showMirrorSettings := and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (or $newMirrorsPartiallyEnabled .Repository.IsMirror .PullMirror .PushMirrors)}}
|
||||||
{{$showFederationSettings := true}}
|
|
||||||
{{$newMirrorsEntirelyEnabled := and (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}}
|
{{$newMirrorsEntirelyEnabled := and (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}}
|
||||||
{{$onlyNewPushMirrorsEnabled := and (not .DisableNewPushMirrors) .DisableNewPullMirrors}}
|
{{$onlyNewPushMirrorsEnabled := and (not .DisableNewPushMirrors) .DisableNewPullMirrors}}
|
||||||
{{$onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors (not .DisableNewPullMirrors)}}
|
{{$onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors (not .DisableNewPullMirrors)}}
|
||||||
|
@ -75,14 +99,6 @@
|
||||||
{{$modifyBrokenPullMirror := and .Repository.IsMirror (not .PullMirror)}}
|
{{$modifyBrokenPullMirror := and .Repository.IsMirror (not .PullMirror)}}
|
||||||
{{$isWorkingPullMirror := .PullMirror}}
|
{{$isWorkingPullMirror := .PullMirror}}
|
||||||
|
|
||||||
{{if $showFederationSettings}}
|
|
||||||
<h4 class="ui top attached header">
|
|
||||||
Federation
|
|
||||||
</h4>
|
|
||||||
<div class="ui attached segment">
|
|
||||||
Repositories federated with the current one.
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{if $showMirrorSettings}}
|
{{if $showMirrorSettings}}
|
||||||
<h4 class="ui top attached header">
|
<h4 class="ui top attached header">
|
||||||
|
|
Loading…
Reference in a new issue