| 1 | {{define "view"}}page teams{{end}} |
| 2 | {{define "content"}} |
| 3 | <div equipo-settings-layout data-section="teams"> |
| 4 | {{template "settings-nav" .}} |
| 5 | <section equipo-settings-body equipo-settings-section id="teams" data-teams> |
| 6 | {{template "settings-head" (dict "Title" "teams.title" "Lede" "teams.lede")}} |
| 7 | <section equipo-sp-group aria-labelledby="teams-current-h"> |
| 8 | <div equipo-sp-group-head><h2 id="teams-current-h">{{copy "teams.current"}}</h2></div> |
| 9 | <div equipo-sp-card><div equipo-sp-row equipo-team-row data-team-current> |
| 10 | <span equipo-team-mark aria-hidden="true">{{icon "users"}}</span> |
| 11 | <div equipo-sp-label><p equipo-sp-title><a equipo-row-link equipo-current-team href="/work">{{.TeamName}}</a></p><p equipo-sp-desc>{{hostOf .Origin}}</p></div> |
| 12 | <span equipo-sp-control>{{with .Teams.CurrentNeeds}}{{if gt (deref .) 0}}<a equipo-team-needs href="/tasks?needs=you" data-team-needs>{{copy "nav.needs-you"}} <b>{{deref .}}</b></a>{{end}}{{else}}<span equipo-sp-desc data-team-needs-unknown>{{copy "teams.counts_unknown"}}</span>{{end}}</span> |
| 13 | </div></div> |
| 14 | </section> |
| 15 | {{$request := .Teams.RequestID}}{{$origin := .Origin}} |
| 16 | <section equipo-sp-group aria-labelledby="teams-list-h"> |
| 17 | <div equipo-sp-group-head><h2 id="teams-list-h">{{copy "teams.remembered"}}</h2></div> |
| 18 | {{if .Teams.Links}}<ul equipo-sp-card role="list" data-team-list data-forgotten="{{copy "teams.forgotten"}}" data-none="{{copy "teams.none"}}"> |
| 19 | {{range .Teams.Links}}<li equipo-sp-row equipo-team-row data-team-row data-team-name="{{.Name}}"> |
| 20 | <span equipo-team-mark aria-hidden="true">{{icon "users"}}</span> |
| 21 | <div equipo-sp-label><p equipo-sp-title><a equipo-row-link href="{{if eq .Origin $origin}}/work{{else}}{{.Origin}}{{end}}" rel="noreferrer">{{.Name}}</a></p> |
| 22 | <p equipo-sp-desc equipo-team-facts><span>{{hostOf .Origin}}</span>{{if .LastSignedInAt}}<time datetime="{{.LastSignedInAt.Format "2006-01-02T15:04:05Z07:00"}}" title="{{.LastSignedInAt.UTC.Format "2006-01-02 15:04 UTC"}}">{{printf (copy "teams.last_signin_ago") (agoText .LastSignedInAt)}}</time>{{else}}<span>{{copy "teams.last_signin_unknown"}}</span>{{end}}{{if ne .Origin $origin}}<span>{{copy "teams.remote_unavailable"}}</span>{{end}}</p></div> |
| 23 | <form method="post" action="/teams/links/{{.ID}}/forget" equipo-sp-control data-team-forget-form><input type="hidden" name="request_id" value="{{$request}}-{{.ID}}"><input type="hidden" name="revision" value="{{.Revision}}"><button type="submit" rst-btn data-quiet equipo-team-forget data-team-forget aria-label="{{copy "teams.forget_short"}} {{.Name}}">{{copy "teams.forget_short"}}</button></form> |
| 24 | </li>{{end}} |
| 25 | </ul> |
| 26 | <template data-team-undo-template><li equipo-sp-row equipo-team-gone data-team-forgotten><p equipo-sp-label role="status" data-team-gone-text></p><span equipo-sp-control><button type="button" rst-btn data-quiet data-team-undo>{{copy "teams.undo"}}</button></span></li></template> |
| 27 | {{else}}<p equipo-sp-empty data-empty-state="teams.none">{{copy "teams.none"}}</p>{{end}} |
| 28 | <details equipo-team-add data-team-add> |
| 29 | <summary rst-btn>{{icon "plus"}}<span>{{copy "teams.add_open"}}</span></summary> |
| 30 | <form method="post" action="/teams/links" equipo-team-add-form> |
| 31 | <input type="hidden" name="request_id" value="{{.Teams.RequestID}}"><input type="hidden" name="revision" value="0"> |
| 32 | <label equipo-team-field data-field="address"><span>{{copy "teams.origin"}}</span><input rst-input type="url" name="origin" inputmode="url" autocomplete="url" placeholder="https://" required data-team-origin></label> |
| 33 | <label equipo-team-field data-field="name"><span>{{copy "teams.name"}}</span><input rst-input name="name" maxlength="160" required data-team-name></label> |
| 34 | <p equipo-sp-desc>{{copy "teams.add_help"}}</p> |
| 35 | <p equipo-team-add-actions><button rst-btn="primary" type="submit" data-team-remember>{{copy "teams.add"}}</button></p> |
| 36 | </form> |
| 37 | </details> |
| 38 | </section> |
| 39 | </section> |
| 40 | </div> |
| 41 | {{end}} |
| 42 | |