writeMagicMessage renders the post-action / error page. Cream surface, inline brand mark up top, big editorial-italic title, ember CTA back to the dashboard.
(w http.ResponseWriter, status int, title, body string)
| 639 | // inline brand mark up top, big editorial-italic title, ember CTA back |
| 640 | // to the dashboard. |
| 641 | func writeMagicMessage(w http.ResponseWriter, status int, title, body string) { |
| 642 | setMagicHeaders(w, status) |
| 643 | writeLoftHead(w, title) |
| 644 | fmt.Fprintf(w, `<div class="result"> |
| 645 | <span class="eyebrow">%s</span> |
| 646 | <h1>%s</h1> |
| 647 | <p>%s</p> |
| 648 | <p><a class="btn btn-primary" href="/dashboard">Open the dashboard</a></p> |
| 649 | </div> |
| 650 | </div> |
| 651 | </body> |
| 652 | </html> |
| 653 | `, |
| 654 | html.EscapeString(bannerEyebrowFor(status)), |
| 655 | html.EscapeString(title), |
| 656 | // `body` is sometimes a pre-escaped fragment (the validation-error |
| 657 | // path runs html.EscapeString itself before calling us). Don't |
| 658 | // double-escape. |
| 659 | body, |
| 660 | ) |
| 661 | } |
| 662 | |
| 663 | // bannerEyebrowFor returns a short uppercase status word that sits above |
| 664 | // the result page's title — "Done" / "Pending" / "Error" depending on |
no test coverage detected