2023-04-23 13:21:21 +03:00
|
|
|
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}}
|
|
|
|
<div class="repo-setting-content">
|
2017-03-16 01:39:38 +03:00
|
|
|
<h4 class="ui top attached header">
|
2022-06-27 23:58:46 +03:00
|
|
|
{{.locale.Tr "repo.settings.collaboration"}}
|
2017-03-16 01:39:38 +03:00
|
|
|
</h4>
|
2017-04-23 03:55:02 +03:00
|
|
|
{{if .Collaborators}}
|
2023-08-01 01:13:42 +03:00
|
|
|
<div class="ui attached segment">
|
|
|
|
<div class="flex-list">
|
|
|
|
{{range .Collaborators}}
|
|
|
|
<div class="flex-item flex-item-center">
|
|
|
|
<div class="flex-item-leading">
|
|
|
|
<a href="{{.HomeLink}}">{{avatar $.Context . 32}}</a>
|
|
|
|
</div>
|
|
|
|
<div class="flex-item-main">
|
|
|
|
<div class="flex-item-title">
|
|
|
|
{{template "shared/user/name" .}}
|
2016-03-06 02:08:42 +03:00
|
|
|
</div>
|
2015-12-08 01:30:52 +03:00
|
|
|
</div>
|
2023-08-01 01:13:42 +03:00
|
|
|
<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}}">
|
|
|
|
<div class="text">{{if eq .Collaboration.Mode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
|
|
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
|
|
<div class="menu">
|
|
|
|
<div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{$.locale.Tr "repo.settings.collaboration.admin"}}</div>
|
|
|
|
<div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{$.locale.Tr "repo.settings.collaboration.write"}}</div>
|
|
|
|
<div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{$.locale.Tr "repo.settings.collaboration.read"}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button class="ui red tiny button inline text-thin delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
|
|
|
{{$.locale.Tr "repo.settings.delete_collaborator"}}
|
|
|
|
</button>
|
|
|
|
</div>
|
2017-03-16 01:39:38 +03:00
|
|
|
</div>
|
2023-08-01 01:13:42 +03:00
|
|
|
{{end}}
|
|
|
|
</div>
|
2017-03-16 01:39:38 +03:00
|
|
|
</div>
|
2017-04-23 03:55:02 +03:00
|
|
|
{{end}}
|
2017-03-16 01:39:38 +03:00
|
|
|
<div class="ui bottom attached segment">
|
|
|
|
<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
|
|
|
|
{{.CsrfTokenHtml}}
|
|
|
|
<div class="inline field ui left">
|
2017-10-03 06:27:48 +03:00
|
|
|
<div id="search-user-box" class="ui search">
|
2017-03-16 01:39:38 +03:00
|
|
|
<div class="ui input">
|
2022-06-27 23:58:46 +03:00
|
|
|
<input class="prompt" name="collaborator" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
|
2015-12-08 01:30:52 +03:00
|
|
|
</div>
|
2017-03-16 01:39:38 +03:00
|
|
|
</div>
|
2015-12-08 01:30:52 +03:00
|
|
|
</div>
|
2022-06-27 23:58:46 +03:00
|
|
|
<button class="ui green button">{{.locale.Tr "repo.settings.add_collaborator"}}</button>
|
2017-03-16 01:39:38 +03:00
|
|
|
</form>
|
2015-12-08 01:30:52 +03:00
|
|
|
</div>
|
2019-09-23 23:08:03 +03:00
|
|
|
|
2019-09-24 04:30:40 +03:00
|
|
|
{{if .RepoOwnerIsOrganization}}
|
2019-09-23 23:08:03 +03:00
|
|
|
<h4 class="ui top attached header">
|
2022-06-27 23:58:46 +03:00
|
|
|
{{$.locale.Tr "repo.settings.teams"}}
|
2019-09-23 23:08:03 +03:00
|
|
|
</h4>
|
2023-04-24 09:48:43 +03:00
|
|
|
{{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}}
|
2019-09-23 23:08:03 +03:00
|
|
|
{{if .Teams}}
|
2023-08-01 01:13:42 +03:00
|
|
|
<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"}}
|
|
|
|
{{if eq .AccessMode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
|
|
|
|
</div>
|
|
|
|
{{if or (eq .AccessMode 1) (eq .AccessMode 2)}}
|
|
|
|
{{$first := true}}
|
|
|
|
<div class="flex-item-body" data-tooltip-content="{{$.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}}{{$.locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2019-09-23 23:08:03 +03:00
|
|
|
</div>
|
2023-08-01 01:13:42 +03:00
|
|
|
{{if $allowedToChangeTeams}}
|
|
|
|
<div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{$.locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
|
|
|
|
<button class="ui red tiny button inline text-thin delete-button {{if .IncludesAllRepositories}}disabled{{end}}" data-url="{{$.Link}}/team/delete" data-id="{{.ID}}">
|
|
|
|
{{$.locale.Tr "repo.settings.delete_collaborator"}}
|
|
|
|
</button>
|
2019-09-23 23:08:03 +03:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2023-08-01 01:13:42 +03:00
|
|
|
{{end}}
|
|
|
|
</div>
|
2019-09-23 23:08:03 +03:00
|
|
|
</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}}
|
|
|
|
<div class="inline field ui left">
|
2019-10-01 08:32:28 +03:00
|
|
|
<div id="search-team-box" class="ui search" data-org="{{.OrgName}}">
|
2019-09-23 23:08:03 +03:00
|
|
|
<div class="ui input">
|
2022-06-27 23:58:46 +03:00
|
|
|
<input class="prompt" name="team" placeholder="{{$.locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
|
2019-09-23 23:08:03 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-27 23:58:46 +03:00
|
|
|
<button class="ui green button">{{$.locale.Tr "repo.settings.add_team"}}</button>
|
2019-09-23 23:08:03 +03:00
|
|
|
</form>
|
|
|
|
{{else}}
|
|
|
|
<div class="item">
|
2022-06-27 23:58:46 +03:00
|
|
|
{{$.locale.Tr "repo.settings.change_team_access_not_allowed"}}
|
2019-09-23 23:08:03 +03:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2019-09-24 04:30:40 +03:00
|
|
|
{{end}}
|
2014-08-07 14:40:05 +04:00
|
|
|
</div>
|
2016-03-06 02:08:42 +03:00
|
|
|
|
2023-04-24 14:08:59 +03:00
|
|
|
<div class="ui g-modal-confirm delete modal">
|
2023-04-23 12:24:19 +03:00
|
|
|
<div class="header">
|
2021-03-22 07:04:19 +03:00
|
|
|
{{svg "octicon-trash"}}
|
2022-06-27 23:58:46 +03:00
|
|
|
{{.locale.Tr "repo.settings.collaborator_deletion"}}
|
2016-03-06 02:08:42 +03:00
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-27 23:58:46 +03:00
|
|
|
<p>{{.locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
|
2016-03-06 02:08:42 +03:00
|
|
|
</div>
|
2023-04-23 12:24:19 +03:00
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2016-03-06 02:08:42 +03:00
|
|
|
</div>
|
2023-04-23 13:21:21 +03:00
|
|
|
|
|
|
|
{{template "repo/settings/layout_footer" .}}
|