summaryrefslogtreecommitdiffstats
path: root/templates/repo/settings/units/overview.tmpl
blob: a851c66d5abb954f320d27605e7a41495bfb9b97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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>