diff options
author | Daniel Baumann <daniel@debian.org> | 2024-10-18 20:33:49 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-10-18 20:33:49 +0200 |
commit | dd136858f1ea40ad3c94191d647487fa4f31926c (patch) | |
tree | 58fec94a7b2a12510c9664b21793f1ed560c6518 /templates/repo/settings/units | |
parent | Initial commit. (diff) | |
download | forgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.tar.xz forgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.zip |
Adding upstream version 9.0.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to '')
-rw-r--r-- | templates/repo/settings/units.tmpl | 13 | ||||
-rw-r--r-- | templates/repo/settings/units/issues.tmpl | 102 | ||||
-rw-r--r-- | templates/repo/settings/units/overview.tmpl | 62 | ||||
-rw-r--r-- | templates/repo/settings/units/pulls.tmpl | 132 | ||||
-rw-r--r-- | templates/repo/settings/units/wiki.tmpl | 51 |
5 files changed, 360 insertions, 0 deletions
diff --git a/templates/repo/settings/units.tmpl b/templates/repo/settings/units.tmpl new file mode 100644 index 0000000..66ed035 --- /dev/null +++ b/templates/repo/settings/units.tmpl @@ -0,0 +1,13 @@ +{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}} +<div class="user-main-content twelve wide column"> + <form class="ui form" method="post" action="{{.RepoLink}}/settings/units"> + {{.CsrfTokenHtml}} + {{template "repo/settings/units/overview" .}} + {{template "repo/settings/units/issues" .}} + {{if not .IsMirror}} + {{template "repo/settings/units/pulls" .}} + {{end}} + {{template "repo/settings/units/wiki" .}} + </form> +</div> +{{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/units/issues.tmpl b/templates/repo/settings/units/issues.tmpl new file mode 100644 index 0000000..b4217dd --- /dev/null +++ b/templates/repo/settings/units/issues.tmpl @@ -0,0 +1,102 @@ +<h4 class="ui top attached header" id="issues"> + {{ctx.Locale.Tr "repo.issues"}} +</h4> +<div class="ui attached segment"> + {{$isIssuesEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeIssues) (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}} + {{$isIssuesGlobalDisabled := .UnitTypeIssues.UnitGlobalDisabled}} + {{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}} + {{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.issues"}}</label> + <div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.issues_desc"}}</label> + </div> + </div> + <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box"> + <div class="field"> + <div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system-radio" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.use_internal_issue_tracker"}}</label> + </div> + </div> + <div class="field tw-pl-4 {{if (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box"> + {{if .Repository.CanEnableTimetracker}} + <div class="field"> + <div class="ui checkbox"> + <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled $.Context}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.enable_timetracker"}}</label> + </div> + </div> + <div class="field {{if not (.Repository.IsTimetrackerEnabled $.Context)}}disabled{{end}}" id="only_contributors"> + <div class="ui checkbox"> + <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime $.Context}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label> + </div> + </div> + {{end}} + <div class="field"> + <div class="ui checkbox"> + <input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled $.Context)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.issues.dependency.setting"}}</label> + </div> + </div> + <div class="ui checkbox"> + <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{if .Repository.CloseIssuesViaCommitInAnyBranch}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label> + </div> + </div> + <div class="field"> + <div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system-radio" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.use_external_issue_tracker"}}</label> + </div> + </div> + <div class="field tw-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box"> + <div class="field"> + <label for="external_tracker_url">{{ctx.Locale.Tr "repo.settings.external_tracker_url"}}</label> + <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}"> + <p class="help">{{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}</p> + </div> + <div class="field"> + <label for="tracker_url_format">{{ctx.Locale.Tr "repo.settings.tracker_url_format"}}</label> + <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="https://github.com/{user}/{repo}/issues/{index}"> + <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_url_format_desc"}}</p> + </div> + <div class="inline fields"> + <label for="issue_style">{{ctx.Locale.Tr "repo.settings.tracker_issue_style"}}</label> + <div class="field"> + <div class="ui radio checkbox"> + {{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}} + {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}} + <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="numeric" {{if eq $externalTrackerStyle "numeric"}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label> + </div> + </div> + <div class="field"> + <div class="ui radio checkbox"> + <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq $externalTrackerStyle "alphanumeric"}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label> + </div> + </div> + <div class="field"> + <div class="ui radio checkbox"> + <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="regexp" {{if eq $externalTrackerStyle "regexp"}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label> + </div> + </div> + </div> + <div class="field {{if ne $externalTrackerStyle "regexp"}}disabled{{end}}" id="tracker-issue-style-regex-box"> + <label for="external_tracker_regexp_pattern">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label> + <input id="external_tracker_regexp_pattern" name="external_tracker_regexp_pattern" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerRegexpPattern}}"> + <p class="help">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_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> +</div> diff --git a/templates/repo/settings/units/overview.tmpl b/templates/repo/settings/units/overview.tmpl new file mode 100644 index 0000000..a851c66 --- /dev/null +++ b/templates/repo/settings/units/overview.tmpl @@ -0,0 +1,62 @@ +<h4 class="ui top attached header" id="overview"> + {{ctx.Locale.Tr "repo.settings.units.overview"}} +</h4> +<div class="ui attached segment"> + {{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}} + {{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.code"}}</label> + <div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}> + <label>{{ctx.Locale.Tr "repo.code.desc"}}</label> + </div> + </div> + + {{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}} + {{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.projects"}}</label> + <div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_projects" type="checkbox" {{if $isProjectsEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.projects_desc"}}</label> + </div> + </div> + + {{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}} + {{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.releases"}}</label> + <div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_releases" type="checkbox" {{if $isReleasesEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.releases_desc"}}</label> + </div> + </div> + + {{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}} + {{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.packages"}}</label> + <div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.packages_desc"}}</label> + </div> + </div> + + {{if .EnableActions}} + {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}} + {{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "actions.actions"}}</label> + <div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_actions" type="checkbox" {{if $isActionsEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.actions_desc"}}</label> + </div> + </div> + {{end}} + + <div class="divider"></div> + + <div class="field"> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> + </div> +</div> diff --git a/templates/repo/settings/units/pulls.tmpl b/templates/repo/settings/units/pulls.tmpl new file mode 100644 index 0000000..4e9c53e --- /dev/null +++ b/templates/repo/settings/units/pulls.tmpl @@ -0,0 +1,132 @@ +<h4 class="ui top attached header" id="pulls"> + {{ctx.Locale.Tr "repo.pulls"}} +</h4> +<div class="ui attached segment"> + {{$pullRequestEnabled := .Repository.UnitEnabled $.Context $.UnitTypePullRequests}} + {{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}} + {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.pulls"}}</label> + <div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.pulls_desc"}}</label> + </div> + </div> + <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box"> + <div class="field"> + <p> + {{ctx.Locale.Tr "repo.settings.merge_style_desc"}} + </p> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_fast_forward_only" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowFastForwardOnly)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowManualMerge)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.pulls.merge_manually"}}</label> + </div> + </div> + + <div class="field"> + <p> + {{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}} + </p> + <div class="ui dropdown selection"> + <select name="pulls_default_merge_style"> + <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</option> + <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option> + <option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option> + <option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</option> + <option value="fast-forward-only" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "fast-forward-only")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}</option> + </select>{{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="default text"> + {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}} + {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}} + {{end}} + {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}} + {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}} + {{end}} + {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}} + {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}} + {{end}} + {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}} + {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}} + {{end}} + {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "fast-forward-only")}} + {{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}} + {{end}} + </div> + <div class="menu"> + <div class="item" data-value="merge">{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</div> + <div class="item" data-value="rebase">{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div> + <div class="item" data-value="rebase-merge">{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div> + <div class="item" data-value="squash">{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</div> + <div class="item" data-value="fast-forward-only">{{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}</div> + </div> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="default_allow_maintainer_edit" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultAllowMaintainerEdit)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label> + </div> + </div> + </div> + + <div class="divider"></div> + <div class="field"> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> + </div> +</div> diff --git a/templates/repo/settings/units/wiki.tmpl b/templates/repo/settings/units/wiki.tmpl new file mode 100644 index 0000000..23df294 --- /dev/null +++ b/templates/repo/settings/units/wiki.tmpl @@ -0,0 +1,51 @@ +<h4 class="ui top attached header" id="wiki"> + {{ctx.Locale.Tr "repo.wiki"}} +</h4> +<div class="ui attached segment"> + {{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}} + {{$isWikiGlobalDisabled := .UnitTypeWiki.UnitGlobalDisabled}} + {{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}} + {{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}} + <div class="inline field"> + <label>{{ctx.Locale.Tr "repo.wiki"}}</label> + <div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.wiki_desc"}}</label> + </div> + </div> + <div class="field{{if not $isWikiEnabled}} disabled{{end}}" id="wiki_box"> + <div class="field"> + <div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system-radio" name="enable_external_wiki" type="radio" value="false" data-context="#globally_writeable_checkbox" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.use_internal_wiki"}}</label> + </div> + </div> + {{if (not .Repository.IsPrivate)}} + <div class="field {{if (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}disabled{{end}}" id="globally_writeable_checkbox"> + <div class="field tw-pl-4"> + <div class="ui checkbox"> + <input name="globally_writeable_wiki" type="checkbox" {{if .Permission.IsGloballyWriteable $.UnitTypeWiki}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.wiki_globally_editable"}}</label> + </div> + </div> + </div> + {{end}} + <div class="field"> + <div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}> + <input class="enable-system-radio" name="enable_external_wiki" type="radio" value="true" data-context="#globally_writeable_checkbox" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.use_external_wiki"}}</label> + </div> + </div> + <div class="field tw-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box"> + <label for="external_wiki_url">{{ctx.Locale.Tr "repo.settings.external_wiki_url"}}</label> + <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}"> + <p class="help">{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}</p> + </div> + </div> + + <div class="divider"></div> + + <div class="field"> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> + </div> +</div> |