2023-04-23 15:51:21 +05:30
|
|
|
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}}
|
|
|
|
<div class="repo-setting-content">
|
2017-03-16 04:09:38 +05:30
|
|
|
<h4 class="ui top attached header">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.settings.collaboration"}}
|
2017-03-16 04:09:38 +05:30
|
|
|
</h4>
|
2017-04-23 06:25:02 +05:30
|
|
|
{{if .Collaborators}}
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="flex-list">
|
|
|
|
{{range .Collaborators}}
|
2024-03-23 01:21:29 +05:30
|
|
|
<div class="flex-item tw-items-center">
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="flex-item-leading">
|
2023-08-10 08:49:39 +05:30
|
|
|
<a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 32}}</a>
|
2023-08-01 03:43:42 +05:30
|
|
|
</div>
|
|
|
|
<div class="flex-item-main">
|
|
|
|
<div class="flex-item-title">
|
|
|
|
{{template "shared/user/name" .}}
|
2016-03-06 04:38:42 +05:30
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="flex-item-trailing">
|
|
|
|
<div class="flex-text-block">
|
|
|
|
{{svg "octicon-shield-lock"}}
|
|
|
|
<div class="ui inline dropdown access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{printf "%d" .Collaboration.Mode}}">
|
2023-09-25 18:12:40 +05:30
|
|
|
<div class="text">{{if eq .Collaboration.Mode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
|
|
<div class="menu">
|
2023-09-25 14:26:50 +05:30
|
|
|
<div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}</div>
|
|
|
|
<div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{ctx.Locale.Tr "repo.settings.collaboration.write"}}</div>
|
|
|
|
<div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{ctx.Locale.Tr "repo.settings.collaboration.read"}}</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-22 16:51:06 +05:30
|
|
|
<button class="ui red tiny button inline delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
|
2023-08-01 03:43:42 +05:30
|
|
|
</button>
|
|
|
|
</div>
|
2017-03-16 04:09:38 +05:30
|
|
|
</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
2017-03-16 04:09:38 +05:30
|
|
|
</div>
|
2017-04-23 06:25:02 +05:30
|
|
|
{{end}}
|
2017-03-16 04:09:38 +05:30
|
|
|
<div class="ui bottom attached segment">
|
|
|
|
<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
2024-03-22 19:15:10 +05:30
|
|
|
<div id="search-user-box" class="ui search input tw-align-middle">
|
2024-03-15 04:54:59 +05:30
|
|
|
<input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" autofocus required>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_collaborator"}}</button>
|
2017-03-16 04:09:38 +05:30
|
|
|
</form>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
2019-09-24 01:38:03 +05:30
|
|
|
|
2019-09-24 07:00:40 +05:30
|
|
|
{{if .RepoOwnerIsOrganization}}
|
2019-09-24 01:38:03 +05:30
|
|
|
<h4 class="ui top attached header">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.settings.teams"}}
|
2019-09-24 01:38:03 +05:30
|
|
|
</h4>
|
2023-04-24 12:18:43 +05:30
|
|
|
{{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}}
|
2019-09-24 01:38:03 +05:30
|
|
|
{{if .Teams}}
|
2023-08-01 03:43:42 +05:30
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="flex-list">
|
|
|
|
{{range $t, $team := .Teams}}
|
|
|
|
<div class="flex-item">
|
|
|
|
<div class="flex-item-main">
|
|
|
|
<a class="flex-item-title text primary" href="{{AppSubUrl}}/org/{{$.OrgName|PathEscape}}/teams/{{.LowerName|PathEscape}}">
|
|
|
|
{{.Name}}
|
|
|
|
</a>
|
|
|
|
<div class="flex-item-body flex-text-block">
|
|
|
|
{{svg "octicon-shield-lock"}}
|
2023-09-25 18:12:40 +05:30
|
|
|
{{if eq .AccessMode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{ctx.Locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
|
2023-08-01 03:43:42 +05:30
|
|
|
</div>
|
|
|
|
{{if or (eq .AccessMode 1) (eq .AccessMode 2)}}
|
|
|
|
{{$first := true}}
|
2023-09-25 14:26:50 +05:30
|
|
|
<div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}">
|
|
|
|
Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{ctx.Locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
|
2023-08-01 03:43:42 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
2019-09-24 01:38:03 +05:30
|
|
|
</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
{{if $allowedToChangeTeams}}
|
2023-09-25 14:26:50 +05:30
|
|
|
<div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
|
2024-04-22 16:51:06 +05:30
|
|
|
<button class="ui red tiny button inline delete-button {{if .IncludesAllRepositories}}disabled{{end}}" data-url="{{$.Link}}/team/delete" data-id="{{.ID}}">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
|
2023-08-01 03:43:42 +05:30
|
|
|
</button>
|
2019-09-24 01:38:03 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2023-08-01 03:43:42 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
2019-09-24 01:38:03 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
<div class="ui bottom attached segment">
|
|
|
|
{{if $allowedToChangeTeams}}
|
|
|
|
<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
2024-03-22 19:15:10 +05:30
|
|
|
<div id="search-team-box" class="ui search input tw-align-middle" data-org-name="{{.OrgName}}">
|
2024-03-15 04:54:59 +05:30
|
|
|
<input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" autofocus required>
|
2019-09-24 01:38:03 +05:30
|
|
|
</div>
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button>
|
2019-09-24 01:38:03 +05:30
|
|
|
</form>
|
|
|
|
{{else}}
|
|
|
|
<div class="item">
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.settings.change_team_access_not_allowed"}}
|
2019-09-24 01:38:03 +05:30
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2019-09-24 07:00:40 +05:30
|
|
|
{{end}}
|
2014-08-07 16:10:05 +05:30
|
|
|
</div>
|
2016-03-06 04:38:42 +05:30
|
|
|
|
2023-04-24 16:38:59 +05:30
|
|
|
<div class="ui g-modal-confirm delete modal">
|
2023-04-23 14:54:19 +05:30
|
|
|
<div class="header">
|
2021-03-22 09:34:19 +05:30
|
|
|
{{svg "octicon-trash"}}
|
2023-09-25 14:26:50 +05:30
|
|
|
{{ctx.Locale.Tr "repo.settings.collaborator_deletion"}}
|
2016-03-06 04:38:42 +05:30
|
|
|
</div>
|
|
|
|
<div class="content">
|
2023-09-25 14:26:50 +05:30
|
|
|
<p>{{ctx.Locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
|
2016-03-06 04:38:42 +05:30
|
|
|
</div>
|
2023-04-23 14:54:19 +05:30
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2016-03-06 04:38:42 +05:30
|
|
|
</div>
|
2023-04-23 15:51:21 +05:30
|
|
|
|
|
|
|
{{template "repo/settings/layout_footer" .}}
|