| 1 | {{define "title"}}{{copy "preferences.title"}}{{end}} |
| 2 | {{define "content"}}{{template "region:preferences" .}}{{end}} |
| 3 | {{define "region:preferences"}} |
| 4 | <section id="preferences" rst-stack {{.Live.Attrs .Preferences.Topic}}> |
| 5 | <h1>{{copy "preferences.title"}}</h1> |
| 6 | <p equipo-muted>{{copy "preferences.team_rule"}}</p> |
| 7 | {{with .Preferences.Source}} |
| 8 | <article equipo-card rst-stack><h2>{{copy "preferences.source"}}</h2><p equipo-preference-text>{{.Body}}</p></article> |
| 9 | {{else}} |
| 10 | {{range .Preferences.Items}} |
| 11 | <article equipo-card rst-stack> |
| 12 | <span equipo-preference-status>{{copy .StatusKey}}</span> |
| 13 | <p equipo-preference-text>{{.Text}}</p> |
| 14 | {{if .SourceURL}}<a href="{{.SourceURL}}">{{copy "preferences.source"}}</a>{{else}}<p equipo-muted>{{copy "preferences.source_unavailable"}}</p>{{end}} |
| 15 | <form equipo-form method="post" action="/preferences/{{.ID}}"> |
| 16 | <input type="hidden" name="request_id" value="{{.RequestID}}"> |
| 17 | <input type="hidden" name="revision" value="{{.Revision}}"> |
| 18 | <label>{{copy "preferences.correct"}}<textarea rst-input name="text" required maxlength="8192">{{.Text}}</textarea></label> |
| 19 | <button rst-btn type="submit">{{if eq .Status "inferred"}}{{copy "preferences.confirm"}}{{else}}{{copy "preferences.correct"}}{{end}}</button> |
| 20 | </form> |
| 21 | <form equipo-form method="post" action="/preferences/{{.ID}}/delete"> |
| 22 | <input type="hidden" name="request_id" value="{{.DeleteRequestID}}"> |
| 23 | <input type="hidden" name="revision" value="{{.Revision}}"> |
| 24 | <button rst-btn type="submit">{{copy "preferences.delete"}}</button> |
| 25 | </form> |
| 26 | </article> |
| 27 | {{end}} |
| 28 | <form equipo-form method="post" action="/preferences"> |
| 29 | <input type="hidden" name="request_id" value="{{.Preferences.RequestID}}"> |
| 30 | <input type="hidden" name="revision" value="0"> |
| 31 | <label>{{copy "preferences.title"}}<textarea rst-input name="text" required maxlength="8192"></textarea></label> |
| 32 | <button rst-btn type="submit">{{copy "preferences.confirm"}}</button> |
| 33 | </form> |
| 34 | {{end}} |
| 35 | </section> |
| 36 | {{end}} |
| 37 | |