|
8 | 8 | <div class="eleven wide column"> |
9 | 9 | <div class="ui two column stackable grid"> |
10 | 10 | {{if or .IsGroupAdmin .IsGroupOwner}} |
11 | | - |
12 | | - <div class="one column row"> |
13 | | - <div class="column"> |
14 | | - <form class="ui form ignore-dirty tw-flex tw-flex-wrap tw-gap-2" action="{{$.OrgGroupLink}}/teams/add" |
15 | | - method="post"> |
16 | | - {{.CsrfTokenHtml}} |
17 | | - <input type="hidden" name="uid" value="{{.SignedUser.ID}}"> |
18 | | - <div id="search-team-box" data-search-url="{{$.OrgLink}}/-/search_team_candidates" |
19 | | - class="ui search tw-mr-2 tw-flex-grow"> |
20 | | - <div class="ui input fluid"> |
21 | | - <input class="prompt" name="tname" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" |
22 | | - autocomplete="off" required> |
23 | | - </div> |
| 11 | + <div class="one column row"> |
| 12 | + <div class="column"> |
| 13 | + <form class="ui form ignore-dirty tw-flex tw-flex-wrap tw-gap-2" action="{{$.OrgGroupLink}}/teams/add" |
| 14 | + method="post"> |
| 15 | + {{.CsrfTokenHtml}} |
| 16 | + <input type="hidden" name="uid" value="{{.SignedUser.ID}}"> |
| 17 | + <div id="search-team-box" data-search-url="{{$.OrgLink}}/-/search_team_candidates" class="ui search tw-mr-2 tw-flex-grow"> |
| 18 | + <div class="ui input fluid"> |
| 19 | + <input class="prompt" name="tname" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" required> |
24 | 20 | </div> |
25 | | - <button class="ui primary button">{{ctx.Locale.Tr "group.teams.add"}}</button> |
26 | | - </form> |
27 | | - </div> |
| 21 | + </div> |
| 22 | + <button class="ui primary button">{{ctx.Locale.Tr "group.teams.add"}}</button> |
| 23 | + </form> |
28 | 24 | </div> |
| 25 | + </div> |
29 | 26 | {{end}} |
30 | 27 | {{range .Teams}} |
31 | | - <div class="column"> |
32 | | - <div class="ui top attached header"> |
33 | | - <a class="text black" |
34 | | - href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.Name}}</strong></a> |
35 | | - <div class="ui right"> |
36 | | - <a class="ui primary tiny button" |
37 | | - href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{ctx.Locale.Tr "view"}}</a> |
38 | | - |
39 | | - {{if .IsMember ctx $.SignedUser.ID}} |
40 | | - <form> |
41 | | - <button class="ui red tiny button delete-button" data-modal-id="leave-team" |
42 | | - data-url="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/leave" |
43 | | - data-datauid="{{$.SignedUser.ID}}" |
44 | | - data-name="{{.Name}}">{{ctx.Locale.Tr "org.teams.leave"}}</button> |
45 | | - </form> |
46 | | - {{else if $.IsOrganizationOwner}} |
47 | | - <form method="post" action="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/join"> |
48 | | - {{$.CsrfTokenHtml}} |
49 | | - <button type="submit" class="ui primary tiny button" name="uid" |
50 | | - value="{{$.SignedUser.ID}}">{{ctx.Locale.Tr "org.teams.join"}}</button> |
51 | | - </form> |
52 | | - {{end}} |
| 28 | + <div class="column"> |
| 29 | + <div class="ui top attached header"> |
| 30 | + <a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.Name}}</strong></a> |
| 31 | + <div class="ui right"> |
| 32 | + <a class="ui primary tiny button" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{ctx.Locale.Tr "view"}}</a> |
| 33 | + {{if .IsMember ctx $.SignedUser.ID}} |
| 34 | + <form> |
| 35 | + <button class="ui red tiny button delete-button" data-modal-id="leave-team" |
| 36 | + data-url="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/leave" |
| 37 | + data-datauid="{{$.SignedUser.ID}}" |
| 38 | + data-name="{{.Name}}">{{ctx.Locale.Tr "org.teams.leave"}}</button> |
| 39 | + </form> |
| 40 | + {{else if $.IsOrganizationOwner}} |
| 41 | + <form method="post" action="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/join"> |
| 42 | + {{$.CsrfTokenHtml}} |
| 43 | + <button type="submit" class="ui primary tiny button" name="uid" value="{{$.SignedUser.ID}}">{{ctx.Locale.Tr "org.teams.join"}}</button> |
| 44 | + </form> |
| 45 | + {{end}} |
53 | 46 |
|
54 | | - {{if and (or $.IsGroupAdmin $.IsGroupOwner) (not .IsOwnerTeam)}} |
55 | | - <form> |
56 | | - <button class="ui red tiny button delete-button" data-modal-id="remove-team" |
57 | | - data-url="{{$.OrgGroupLink}}/teams/{{.LowerName | PathEscape}}/remove" |
58 | | - data-datauid="{{$.SignedUser.ID}}" |
59 | | - data-name="{{.Name}}">{{ctx.Locale.Tr "group.teams.remove"}}</button> |
60 | | - </form> |
61 | | - {{end}} |
62 | | - </div> |
63 | | - </div> |
64 | | - <div class="ui attached segment members"> |
65 | | - {{range .Members}} |
66 | | - {{template "shared/user/avatarlink" dict "user" .}} |
| 47 | + {{if and (or $.IsGroupAdmin $.IsGroupOwner) (not .IsOwnerTeam)}} |
| 48 | + <form> |
| 49 | + <button class="ui red tiny button delete-button" data-modal-id="remove-team" |
| 50 | + data-url="{{$.OrgGroupLink}}/teams/{{.LowerName | PathEscape}}/remove" |
| 51 | + data-datauid="{{$.SignedUser.ID}}" |
| 52 | + data-name="{{.Name}}">{{ctx.Locale.Tr "group.teams.remove"}}</button> |
| 53 | + </form> |
67 | 54 | {{end}} |
68 | 55 | </div> |
69 | | - <div class="ui bottom attached header"> |
70 | | - <p class="team-meta"><a class="muted" |
71 | | - href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{.NumMembers}} {{ctx.Locale.Tr "org.lower_members"}}</a> |
72 | | - · <a class="muted" |
73 | | - href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories">{{.NumRepos}} {{ctx.Locale.Tr "org.lower_repositories"}}</a> |
74 | | - </p> |
75 | | - </div> |
76 | 56 | </div> |
| 57 | + <div class="ui attached segment members"> |
| 58 | + {{range .Members}} |
| 59 | + {{template "shared/user/avatarlink" dict "user" .}} |
| 60 | + {{end}} |
| 61 | + </div> |
| 62 | + <div class="ui bottom attached header"> |
| 63 | + <p class="team-meta"><a class="muted" |
| 64 | + href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{.NumMembers}} {{ctx.Locale.Tr "org.lower_members"}}</a> |
| 65 | + · <a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories">{{.NumRepos}} {{ctx.Locale.Tr "org.lower_repositories"}}</a> |
| 66 | + </p> |
| 67 | + </div> |
| 68 | + </div> |
77 | 69 | {{end}} |
78 | 70 | </div> |
79 | 71 | </div> |
|
0 commit comments