Refactor "org teams" page and help new users to "add member" to an org (#37051)
* Fix #22054 * Replace #34593, #27800 * And refactor legacy code, fix various problems --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -7,9 +7,11 @@
|
||||
{{template "org/team/sidebar" .}}
|
||||
<div class="ui ten wide column">
|
||||
{{template "org/team/navbar" .}}
|
||||
{{$hasTopAttachedSegment := false}}
|
||||
{{$canAddRemove := and $.IsOrganizationOwner (not $.Team.IncludesAllRepositories)}}
|
||||
{{if $canAddRemove}}
|
||||
<div class="ui top attached segment tw-flex tw-flex-wrap tw-gap-2">
|
||||
{{$hasTopAttachedSegment = true}}
|
||||
<div class="ui top attached segment flex-text-block tw-flex-wrap">
|
||||
<form class="ui form ignore-dirty tw-flex-1 tw-flex" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/add" method="post">
|
||||
<div data-global-init="initSearchRepoBox" data-uid="{{.Org.ID}}" class="ui search">
|
||||
<div class="ui input">
|
||||
@@ -24,7 +26,11 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="ui{{if not $canAddRemove}} top{{end}} attached segment">
|
||||
{{if $.Team.IncludesAllRepositories}}
|
||||
{{$hasTopAttachedSegment = true}}
|
||||
<div class="ui top attached segment">{{ctx.Locale.Tr "org.teams.all_repositories"}}</div>
|
||||
{{end}}
|
||||
<div class="ui {{if not $hasTopAttachedSegment}}top{{end}} attached segment">
|
||||
<div class="flex-list">
|
||||
{{range $.TeamRepos}}
|
||||
<div class="flex-item tw-items-center">
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
</div>
|
||||
{{if eq .Team.LowerName "owners"}}
|
||||
<div class="item">
|
||||
{{ctx.Locale.Tr "org.teams.owners_permission_desc"}}
|
||||
<p>{{ctx.Locale.Tr "org.teams.owners_permission_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "org.teams.owners_permission_suggestion"}}</p>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="item">
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
{{if .IsOrganizationOwner}}
|
||||
<div class="flex-text-block tw-justify-end">
|
||||
<div class="flex-text-block">
|
||||
<div class="tw-flex-1">{{ctx.Locale.Tr "org.teams.manage_team_member_prompt"}}</div>
|
||||
<a class="ui primary button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{ctx.Locale.Tr "org.create_new_team"}}</a>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
|
||||
Reference in New Issue
Block a user