| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-org-profile shithub-org-team"> |
| 3 | <header class="shithub-org-profile-head shithub-org-team-view-head"> |
| 4 | <div class="shithub-org-team-breadcrumb"> |
| 5 | <a href="/{{ .Org.Slug }}">{{ if .Org.DisplayName }}{{ .Org.DisplayName }}{{ else }}{{ .Org.Slug }}{{ end }}</a> |
| 6 | <span>/</span> |
| 7 | <a href="/{{ .Org.Slug }}/teams">Teams</a> |
| 8 | </div> |
| 9 | <div class="shithub-org-team-title-row"> |
| 10 | <div class="shithub-org-team-avatar" aria-hidden="true">{{ octicon "people" }}</div> |
| 11 | <div> |
| 12 | <h1>{{ .TeamDisplayName }}</h1> |
| 13 | <p class="shithub-meta">@{{ .Org.Slug }}/{{ .Team.Slug }}</p> |
| 14 | </div> |
| 15 | <span class="shithub-pill{{ if .TeamIsSecret }} shithub-pill-private{{ end }}">{{ if .TeamIsSecret }}{{ octicon "lock" }} Secret{{ else }}{{ octicon "eye" }} Visible{{ end }}</span> |
| 16 | </div> |
| 17 | {{ if .Team.Description }}<p class="shithub-org-team-description">{{ .Team.Description }}</p>{{ else }}<p class="shithub-org-team-description shithub-muted">No description provided.</p>{{ end }} |
| 18 | {{ with .Notice }}<p class="shithub-flash shithub-flash-notice" role="status">{{ . }}</p>{{ end }} |
| 19 | {{ with .SecretTeamWritesDisabledMessage }}<p class="shithub-flash shithub-flash-notice" role="status">{{ . }}</p>{{ end }} |
| 20 | </header> |
| 21 | |
| 22 | <div class="shithub-org-team-view-layout"> |
| 23 | <main class="shithub-org-team-view-main"> |
| 24 | <nav class="shithub-org-team-tabs" aria-label="Team"> |
| 25 | <a href="#members" class="is-selected">{{ octicon "person" }} Members <span>{{ len .Members }}</span></a> |
| 26 | <a href="#repositories">{{ octicon "repo" }} Repositories <span>{{ len .Repos }}</span></a> |
| 27 | <a href="#child-teams">{{ octicon "people" }} Child teams <span>{{ len .ChildTeams }}</span></a> |
| 28 | </nav> |
| 29 | |
| 30 | <section id="members" class="shithub-org-team-panel"> |
| 31 | <div class="shithub-org-team-panel-head"> |
| 32 | <div> |
| 33 | <h2>Members</h2> |
| 34 | <p>{{ len .Members }} member{{ if ne (len .Members) 1 }}s{{ end }} belong directly to this team.</p> |
| 35 | </div> |
| 36 | </div> |
| 37 | {{ if .Members }} |
| 38 | <ol class="shithub-org-team-member-list"> |
| 39 | {{ range .Members }} |
| 40 | <li class="shithub-org-team-member-row"> |
| 41 | <img src="/avatars/{{ .Username }}" alt="" width="40" height="40"> |
| 42 | <div> |
| 43 | <a href="/{{ .Username }}">{{ if .DisplayName }}{{ .DisplayName }}{{ else }}{{ .Username }}{{ end }}</a> |
| 44 | <p>@{{ .Username }} · {{ .Role }} · joined {{ relativeTime .AddedAt.Time }}</p> |
| 45 | </div> |
| 46 | {{ if $.IsOwner }} |
| 47 | <form method="POST" action="/{{ $.Org.Slug }}/teams/{{ $.Team.Slug }}/members"> |
| 48 | <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 49 | <input type="hidden" name="user_id" value="{{ .UserID }}"> |
| 50 | <input type="hidden" name="action" value="remove"> |
| 51 | <button type="submit" class="shithub-button shithub-button-danger">Remove</button> |
| 52 | </form> |
| 53 | {{ end }} |
| 54 | </li> |
| 55 | {{ end }} |
| 56 | </ol> |
| 57 | {{ else }} |
| 58 | <div class="shithub-org-empty"><h3>No team members yet.</h3></div> |
| 59 | {{ end }} |
| 60 | </section> |
| 61 | |
| 62 | <section id="repositories" class="shithub-org-team-panel"> |
| 63 | <div class="shithub-org-team-panel-head"> |
| 64 | <div> |
| 65 | <h2>Repositories</h2> |
| 66 | <p>Repository access granted directly to this team.</p> |
| 67 | </div> |
| 68 | </div> |
| 69 | {{ if .Repos }} |
| 70 | <ol class="shithub-org-team-repo-list"> |
| 71 | {{ range .Repos }} |
| 72 | <li class="shithub-org-team-repo-row"> |
| 73 | <div class="shithub-org-team-repo-main"> |
| 74 | <span class="shithub-org-team-repo-icon">{{ octicon "repo" }}</span> |
| 75 | <div> |
| 76 | <a href="/{{ $.Org.Slug }}/{{ .RepoName }}">{{ $.Org.Slug }}/{{ .RepoName }}</a> |
| 77 | {{ if eq .Visibility "private" }}<span class="shithub-pill shithub-pill-private">Private</span>{{ else }}<span class="shithub-pill">Public</span>{{ end }} |
| 78 | <p>{{ .Role }} access · granted {{ relativeTime .AddedAt.Time }}</p> |
| 79 | </div> |
| 80 | </div> |
| 81 | {{ if $.IsOwner }} |
| 82 | <form method="POST" action="/{{ $.Org.Slug }}/teams/{{ $.Team.Slug }}/repos"> |
| 83 | <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 84 | <input type="hidden" name="repo_id" value="{{ .RepoID }}"> |
| 85 | <input type="hidden" name="action" value="remove"> |
| 86 | <button type="submit" class="shithub-button shithub-button-danger">Remove</button> |
| 87 | </form> |
| 88 | {{ end }} |
| 89 | </li> |
| 90 | {{ end }} |
| 91 | </ol> |
| 92 | {{ else }} |
| 93 | <div class="shithub-org-empty"><h3>No repositories yet.</h3></div> |
| 94 | {{ end }} |
| 95 | </section> |
| 96 | |
| 97 | <section id="child-teams" class="shithub-org-team-panel"> |
| 98 | <div class="shithub-org-team-panel-head"> |
| 99 | <div> |
| 100 | <h2>Child teams</h2> |
| 101 | <p>Child teams inherit repository permissions from this team.</p> |
| 102 | </div> |
| 103 | </div> |
| 104 | {{ if .ChildTeams }} |
| 105 | <ol class="shithub-org-team-list shithub-org-team-list-compact"> |
| 106 | {{ range .ChildTeams }} |
| 107 | <li class="shithub-org-team-row"> |
| 108 | <div class="shithub-org-team-row-icon" aria-hidden="true">{{ octicon "people" }}</div> |
| 109 | <div class="shithub-org-team-row-main"> |
| 110 | <div class="shithub-org-team-row-title"> |
| 111 | <a href="{{ .Path }}">{{ .DisplayName }}</a> |
| 112 | <span class="shithub-meta">@{{ $.Org.Slug }}/{{ .Slug }}</span> |
| 113 | </div> |
| 114 | <div class="shithub-org-team-row-meta"> |
| 115 | <span>{{ octicon "person" }} {{ .MemberCount }} member{{ if ne .MemberCount 1 }}s{{ end }}</span> |
| 116 | <span>{{ octicon "repo" }} {{ .RepoCount }} repositor{{ if eq .RepoCount 1 }}y{{ else }}ies{{ end }}</span> |
| 117 | </div> |
| 118 | </div> |
| 119 | </li> |
| 120 | {{ end }} |
| 121 | </ol> |
| 122 | {{ else }} |
| 123 | <div class="shithub-org-empty"><h3>No child teams.</h3></div> |
| 124 | {{ end }} |
| 125 | </section> |
| 126 | </main> |
| 127 | |
| 128 | <aside class="shithub-org-team-manage" aria-label="Team management"> |
| 129 | {{ if .IsOwner }} |
| 130 | {{ if .CanExpandTeam }} |
| 131 | <section class="shithub-org-team-manage-box"> |
| 132 | <h2>Add member</h2> |
| 133 | {{ if .MemberCandidates }} |
| 134 | <form method="POST" action="/{{ .Org.Slug }}/teams/{{ .Team.Slug }}/members"> |
| 135 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 136 | <label><span>Organization member</span> |
| 137 | <select name="user_id" required> |
| 138 | <option value="">Select member</option> |
| 139 | {{ range .MemberCandidates }}<option value="{{ .ID }}">{{ if .DisplayName }}{{ .DisplayName }} · {{ end }}@{{ .Username }}</option>{{ end }} |
| 140 | </select> |
| 141 | </label> |
| 142 | <label><span>Role</span> |
| 143 | <select name="role"> |
| 144 | <option value="member" selected>Member</option> |
| 145 | <option value="maintainer">Maintainer</option> |
| 146 | </select> |
| 147 | </label> |
| 148 | <button type="submit" class="shithub-button shithub-button-primary">Add member</button> |
| 149 | </form> |
| 150 | {{ else }} |
| 151 | <p class="shithub-muted">All organization members are already on this team.</p> |
| 152 | {{ end }} |
| 153 | </section> |
| 154 | |
| 155 | <section class="shithub-org-team-manage-box"> |
| 156 | <h2>Add repository</h2> |
| 157 | {{ if .RepoCandidates }} |
| 158 | <form method="POST" action="/{{ .Org.Slug }}/teams/{{ .Team.Slug }}/repos"> |
| 159 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 160 | <label><span>Repository</span> |
| 161 | <select name="repo_id" required> |
| 162 | <option value="">Select repository</option> |
| 163 | {{ range .RepoCandidates }}<option value="{{ .ID }}">{{ $.Org.Slug }}/{{ .Name }} ({{ .Visibility }})</option>{{ end }} |
| 164 | </select> |
| 165 | </label> |
| 166 | <label><span>Role</span> |
| 167 | <select name="role"> |
| 168 | <option value="read">Read</option> |
| 169 | <option value="triage">Triage</option> |
| 170 | <option value="write" selected>Write</option> |
| 171 | <option value="maintain">Maintain</option> |
| 172 | <option value="admin">Admin</option> |
| 173 | </select> |
| 174 | </label> |
| 175 | <button type="submit" class="shithub-button shithub-button-primary">Add repository</button> |
| 176 | </form> |
| 177 | {{ else }} |
| 178 | <p class="shithub-muted">Every organization repository is already linked to this team.</p> |
| 179 | {{ end }} |
| 180 | </section> |
| 181 | {{ end }} |
| 182 | {{ end }} |
| 183 | |
| 184 | <section class="shithub-org-team-manage-box"> |
| 185 | <h2>Team visibility</h2> |
| 186 | <p>{{ if .TeamIsSecret }}Secret teams are visible to team members and organization owners.{{ else }}Visible teams can be found and mentioned by organization members.{{ end }}</p> |
| 187 | </section> |
| 188 | </aside> |
| 189 | </div> |
| 190 | </section> |
| 191 | {{- end }} |