summaryrefslogtreecommitdiffstats
path: root/templates/org/team/repositories.tmpl
blob: f5d68ce41633d5d0000db26d17c85f8224a604ed (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
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content organization teams">
	{{template "org/header" .}}
	<div class="ui container">
		{{template "base/alert" .}}
		<div class="ui stackable grid">
			{{template "org/team/sidebar" .}}
			<div class="ui ten wide column">
				{{template "org/team/navbar" .}}
				{{$canAddRemove := and $.IsOrganizationOwner (not $.Team.IncludesAllRepositories)}}
				{{if $canAddRemove}}
					<div class="ui attached segment tw-flex tw-flex-wrap tw-gap-2">
						<form class="ui form ignore-dirty tw-flex-1 tw-flex" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/add" method="post">
							{{.CsrfTokenHtml}}
							<div id="search-repo-box" data-uid="{{.Org.ID}}" class="ui search">
								<div class="ui input">
									<input class="prompt" name="repo_name" placeholder="{{ctx.Locale.Tr "search.repo_kind"}}" autocomplete="off" required>
								</div>
							</div>
							<button class="ui primary button tw-ml-2">{{ctx.Locale.Tr "add"}}</button>
						</form>
						<div class="tw-inline-block">
							<button class="ui primary button link-action" data-modal-confirm="{{ctx.Locale.Tr "org.teams.add_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/addall">{{ctx.Locale.Tr "add_all"}}</button>
							<button class="ui red button link-action" data-modal-confirm="{{ctx.Locale.Tr "org.teams.remove_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/removeall">{{ctx.Locale.Tr "remove_all"}}</button>
						</div>
					</div>
				{{end}}
				<div class="ui attached segment">
					<div class="flex-list">
						{{range .Team.Repos}}
							<div class="flex-item tw-items-center">
								<div class="flex-item-leading">
									{{template "repo/icon" .}}
								</div>
								<div class="flex-item-main">
									<a class="flex-item-title text primary" href="{{$.Org.HomeLink}}/{{.Name | PathEscape}}">
										{{$.Org.Name}}/{{.Name}}
									</a>
								</div>
								<div class="flex-item-trailing">
									{{if $canAddRemove}}
										<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/remove">
											{{$.CsrfTokenHtml}}
											<button type="submit" class="ui red small button" name="repoid" value="{{.ID}}">{{ctx.Locale.Tr "remove"}}</button>
										</form>
									{{end}}
								</div>
							</div>
						{{else}}
							<div class="flex-item">
								<span class="text grey tw-italic">{{ctx.Locale.Tr "org.teams.repos.none"}}</span>
							</div>
						{{end}}
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

{{template "base/footer" .}}