fix(ui): section headers with dividers, icons on all settings navbar items #435
@@ -1,17 +1,14 @@
|
||||
{{template "repo/settings/layout_head" (dict "pageClass" "repository settings advanced")}}
|
||||
<div class="user-main-content twelve wide column">
|
||||
{{/* FIXME: need to split the "Advance Settings" by units, there are too many options here */}}
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.advanced_settings"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" method="post">
|
||||
<input type="hidden" name="action" value="advanced">
|
||||
|
||||
{{/* ── Code ── */}}
|
||||
<details class="tw-mb-2" open>
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-code" 16}} {{ctx.Locale.Tr "repo.code"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-code" 16}} {{ctx.Locale.Tr "repo.code"}}</h5>
|
||||
{{$isCodeEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeCode}}
|
||||
{{$isCodeGlobalDisabled := ctx.Consts.RepoUnitTypeCode.UnitGlobalDisabled}}
|
||||
<div class="inline field">
|
||||
@@ -19,14 +16,11 @@
|
||||
<input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.code.desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{/* ── Wiki ── */}}
|
||||
<details class="tw-mb-2">
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-book" 16}} {{ctx.Locale.Tr "repo.wiki"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<div class="ui divider"></div>
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-book" 16}} {{ctx.Locale.Tr "repo.wiki"}}</h5>
|
||||
{{$isInternalWikiEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeWiki}}
|
||||
{{$isExternalWikiEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeExternalWiki}}
|
||||
{{$isWikiEnabled := or $isInternalWikiEnabled $isExternalWikiEnabled}}
|
||||
@@ -38,7 +32,6 @@
|
||||
<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}}>
|
||||
@@ -70,14 +63,11 @@
|
||||
<input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{/* ── Issues ── */}}
|
||||
<details class="tw-mb-2">
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-issue-opened" 16}} {{ctx.Locale.Tr "repo.issues"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<div class="ui divider"></div>
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-issue-opened" 16}} {{ctx.Locale.Tr "repo.issues"}}</h5>
|
||||
{{$isIssuesEnabled := or (.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeIssues) (.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeExternalTracker)}}
|
||||
{{$isIssuesGlobalDisabled := ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
||||
{{$isExternalTrackerGlobalDisabled := ctx.Consts.RepoUnitTypeExternalTracker.UnitGlobalDisabled}}
|
||||
@@ -88,7 +78,6 @@
|
||||
<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}}>
|
||||
@@ -175,14 +164,11 @@
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{/* ── Projects ── */}}
|
||||
<details class="tw-mb-2">
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-project" 16}} {{ctx.Locale.Tr "repo.projects"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<div class="ui divider"></div>
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-project" 16}} {{ctx.Locale.Tr "repo.projects"}}</h5>
|
||||
{{$isProjectsEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeProjects}}
|
||||
{{$isProjectsGlobalDisabled := ctx.Consts.RepoUnitTypeProjects.UnitGlobalDisabled}}
|
||||
{{$projectsUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeProjects}}
|
||||
@@ -192,7 +178,6 @@
|
||||
<input class="enable-system" name="enable_projects" type="checkbox" data-target="#projects_box" {{if $isProjectsEnabled}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.projects_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field {{if not $isProjectsEnabled}} disabled{{end}} tw-pl-4" id="projects_box">
|
||||
<p>
|
||||
{{ctx.Locale.Tr "repo.settings.projects_mode_desc"}}
|
||||
@@ -221,14 +206,11 @@
|
||||
<div class="item" data-value="all">{{ctx.Locale.Tr "repo.settings.projects_mode_all"}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{/* ── Releases ── */}}
|
||||
<details class="tw-mb-2">
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-tag" 16}} {{ctx.Locale.Tr "repo.releases"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<div class="ui divider"></div>
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-tag" 16}} {{ctx.Locale.Tr "repo.releases"}}</h5>
|
||||
{{$isReleasesEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeReleases}}
|
||||
{{$isReleasesGlobalDisabled := ctx.Consts.RepoUnitTypeReleases.UnitGlobalDisabled}}
|
||||
<div class="inline field">
|
||||
@@ -236,7 +218,6 @@
|
||||
<input class="enable-system" name="enable_releases" type="checkbox" data-target="#releases_visibility_box" {{if $isReleasesEnabled}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.releases_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field tw-pl-4{{if not $isReleasesEnabled}} disabled{{end}}" id="releases_visibility_box">
|
||||
<div class="inline field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.unit_visibility"}}</label>
|
||||
@@ -246,15 +227,11 @@
|
||||
</select>
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.unit_visibility_releases_help"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{/* ── Packages ── */}}
|
||||
<details class="tw-mb-2">
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-package" 16}} {{ctx.Locale.Tr "repo.packages"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<div class="ui divider"></div>
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-package" 16}} {{ctx.Locale.Tr "repo.packages"}}</h5>
|
||||
{{$isPackagesEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePackages}}
|
||||
{{$isPackagesGlobalDisabled := ctx.Consts.RepoUnitTypePackages.UnitGlobalDisabled}}
|
||||
<div class="inline field">
|
||||
@@ -262,15 +239,12 @@
|
||||
<input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "repo.settings.packages_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{if not .IsMirror}}
|
||||
{{/* ── Pull Requests ── */}}
|
||||
<details class="tw-mb-2">
|
||||
<summary class="tw-cursor-pointer tw-font-bold tw-py-2">{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls"}}</summary>
|
||||
<div class="tw-pl-4 tw-pb-2">
|
||||
<div class="tw-mb-4">
|
||||
<div class="ui divider"></div>
|
||||
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2">{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls"}}</h5>
|
||||
{{$pullRequestEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}}
|
||||
{{$pullRequestGlobalDisabled := ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
|
||||
{{$prUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypePullRequests}}
|
||||
@@ -323,7 +297,6 @@
|
||||
<label>{{ctx.Locale.Tr "repo.pulls.merge_manually"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<p>
|
||||
{{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}}
|
||||
@@ -408,10 +381,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div class="field tw-mt-4">
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
|
||||
</div>
|
||||
|
||||
@@ -1,43 +1,9 @@
|
||||
<div class="flex-container-nav">
|
||||
<div class="ui fluid vertical menu">
|
||||
<div class="header item">{{ctx.Locale.Tr "repo.settings"}}</div>
|
||||
<div class="header item">{{svg "octicon-gear"}} {{ctx.Locale.Tr "repo.settings"}}</div>
|
||||
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
|
||||
{{ctx.Locale.Tr "repo.settings.options"}}
|
||||
{{svg "octicon-settings"}} {{ctx.Locale.Tr "repo.settings.options"}}
|
||||
</a>
|
||||
{{if or .Repository.IsPrivate .Permission.HasAnyUnitPublicAccess}}
|
||||
<a class="{{if .PageIsSettingsPublicAccess}}active {{end}}item" href="{{.RepoLink}}/settings/public_access">
|
||||
{{ctx.Locale.Tr "repo.settings.public_access"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration">
|
||||
{{ctx.Locale.Tr "repo.settings.collaboration"}}
|
||||
</a>
|
||||
{{if not DisableWebhooks}}
|
||||
<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks">
|
||||
{{ctx.Locale.Tr "repo.settings.hooks"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeCode}}
|
||||
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
|
||||
{{ctx.Locale.Tr "repo.settings.branches"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
|
||||
{{ctx.Locale.Tr "repo.settings.tags"}}
|
||||
</a>
|
||||
{{if .SignedUser.CanEditGitHook}}
|
||||
<a class="{{if .PageIsSettingsGitHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks/git">
|
||||
{{ctx.Locale.Tr "repo.settings.githooks"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{.RepoLink}}/settings/keys">
|
||||
{{ctx.Locale.Tr "repo.settings.deploy_keys"}}
|
||||
</a>
|
||||
{{if .LFSStartServer}}
|
||||
<a class="{{if .PageIsSettingsLFS}}active {{end}}item" href="{{.RepoLink}}/settings/lfs">
|
||||
{{ctx.Locale.Tr "repo.settings.lfs"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsAdvanced}}active {{end}}item" href="{{.RepoLink}}/settings/advanced">
|
||||
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings.advanced_settings"}}
|
||||
</a>
|
||||
@@ -46,6 +12,40 @@
|
||||
{{svg "octicon-key"}} {{ctx.Locale.Tr "repo.settings.licensing_section"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if or .Repository.IsPrivate .Permission.HasAnyUnitPublicAccess}}
|
||||
<a class="{{if .PageIsSettingsPublicAccess}}active {{end}}item" href="{{.RepoLink}}/settings/public_access">
|
||||
{{svg "octicon-eye"}} {{ctx.Locale.Tr "repo.settings.public_access"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration">
|
||||
{{svg "octicon-people"}} {{ctx.Locale.Tr "repo.settings.collaboration"}}
|
||||
</a>
|
||||
{{if not DisableWebhooks}}
|
||||
<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks">
|
||||
{{svg "octicon-webhook"}} {{ctx.Locale.Tr "repo.settings.hooks"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeCode}}
|
||||
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
|
||||
{{svg "octicon-git-branch"}} {{ctx.Locale.Tr "repo.settings.branches"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
|
||||
{{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.settings.tags"}}
|
||||
</a>
|
||||
{{if .SignedUser.CanEditGitHook}}
|
||||
<a class="{{if .PageIsSettingsGitHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks/git">
|
||||
{{svg "octicon-terminal"}} {{ctx.Locale.Tr "repo.settings.githooks"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{.RepoLink}}/settings/keys">
|
||||
{{svg "octicon-key-asterisk"}} {{ctx.Locale.Tr "repo.settings.deploy_keys"}}
|
||||
</a>
|
||||
{{if .LFSStartServer}}
|
||||
<a class="{{if .PageIsSettingsLFS}}active {{end}}item" href="{{.RepoLink}}/settings/lfs">
|
||||
{{svg "octicon-file-binary"}} {{ctx.Locale.Tr "repo.settings.lfs"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables .PageIsActionsSettingsGeneral}}open{{end}}>
|
||||
<summary>{{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}}</summary>
|
||||
<div class="menu">
|
||||
|
||||
Reference in New Issue
Block a user