| 1 | {{/* §8.10's correction page. Each radio button's value is an opaque |
| 2 | handle, never a value or a span; the POST re-runs the ruled search |
| 3 | and accepts the choice only if it is still this person's. */}} |
| 4 | {{define "content"}} |
| 5 | <section rst-correct rst-stack> |
| 6 | <h1>Is this wrong?</h1> |
| 7 | <p rst-muted>For “{{.Query}}”. Pick the right one, or “None of these”, and say why if you like. It is saved for you to look at later under <a href="/reports">Reports</a>.</p> |
| 8 | {{/* §4.1's loud withholding, as on the search page: without it a list |
| 9 | missing a passage nobody could check reads as the whole list. */}} |
| 10 | {{if .Notices}} |
| 11 | <div rst-callout rst-tone="warning" rst-withheld> |
| 12 | <div rst-callout-body>{{range .Notices}}<p>{{.}}</p>{{end}}</div> |
| 13 | </div> |
| 14 | {{end}} |
| 15 | {{if .Gone}} |
| 16 | <div rst-callout rst-tone="warning" role="alert"><div rst-callout-body><p>That page has changed — please look again.</p></div></div> |
| 17 | {{end}} |
| 18 | {{if not .Kinds}} |
| 19 | <p rst-muted>Nothing here to correct for this search.</p> |
| 20 | {{end}} |
| 21 | {{range $k := .Kinds}} |
| 22 | <form method="post" action="/facts/correct" rst-correct-form rst-stack rst-section> |
| 23 | <input type="hidden" name="q" value="{{$.Query}}"> |
| 24 | <input type="hidden" name="kind" value="{{.Kind}}"> |
| 25 | <fieldset> |
| 26 | <legend>{{.Noun}}</legend> |
| 27 | {{range .Items}} |
| 28 | <label rst-correct-option> |
| 29 | <input type="radio" name="choice" value="{{.Handle}}" required> |
| 30 | <span rst-correct-value{{if or (eq $k.Kind "phone") (eq $k.Kind "eircode") (eq $k.Kind "vat")}} rst-nowrap{{end}}>{{.Span}}</span> |
| 31 | {{if .Shown}}<span rst-fact-chip>shown</span>{{end}} |
| 32 | <span rst-muted>{{if .Label}}{{.Label}}{{else}}no label{{end}} · {{.Title}}{{if .Trail}} › {{.Trail}}{{end}}</span> |
| 33 | </label> |
| 34 | {{end}} |
| 35 | <label rst-correct-option> |
| 36 | <input type="radio" name="choice" value="none" required> |
| 37 | <span>None of these</span> |
| 38 | </label> |
| 39 | </fieldset> |
| 40 | <label for="note-{{.Kind}}">Why? (optional)</label> |
| 41 | <textarea id="note-{{.Kind}}" name="note" rows="3"></textarea> |
| 42 | <div rst-actions><button rst-btn="primary" type="submit">Send</button> <a href="/?q={{$.Query}}">Back to the search</a></div> |
| 43 | </form> |
| 44 | {{end}} |
| 45 | </section> |
| 46 | {{end}} |
| 47 | |