Download this file
| 1 | {{/* fonts — GET /fonts, a person's own font library. |
| 2 | |
| 3 | A plain form: the file field takes several files, the answer is the |
| 4 | page itself with what was added and what was refused, and nothing |
| 5 | needs a script. Each family's name is its sample, set in a face of |
| 6 | it the page loads from /fonts/files/{ref} (library.go). */}} |
| 7 | {{define "content"}}{{$L := localizer $}} |
| 8 | {{template "page-header" dict "L" $L "Title" .Title}} |
| 9 | |
| 10 | <div rst-box rst-stack> |
| 11 | <p>{{.Intro}}</p> |
| 12 | </div> |
| 13 | |
| 14 | {{if .Added}}<div rst-box><p role="status">{{.Added}}</p></div>{{end}} |
| 15 | {{if .Refused}} |
| 16 | <div rst-box> |
| 17 | <ul role="alert"> |
| 18 | {{range .Refused}}<li>{{.}}</li>{{end}} |
| 19 | </ul> |
| 20 | </div> |
| 21 | {{end}} |
| 22 | |
| 23 | {{if .Families}} |
| 24 | {{with .SampleCSS}}<style>{{.}}</style>{{end}} |
| 25 | <div rst-list> |
| 26 | {{range .Families}} |
| 27 | <div rst-row> |
| 28 | <span rst-row-main> |
| 29 | <span slides-font-sample="{{.Sample}}">{{.Name}}</span> |
| 30 | <small rst-row-sub>{{.Styles}}{{if .StyleNames}}: {{.StyleNames}}{{end}}</small> |
| 31 | {{if .NoPictures}}<small rst-row-sub>{{.NoPictures}}</small>{{end}} |
| 32 | </span> |
| 33 | <a rst-btn="ghost" class="rst-danger" href="{{.DeleteHref}}" aria-label="{{.DeleteAria}}">{{.DeleteLabel}}</a> |
| 34 | </div> |
| 35 | {{end}} |
| 36 | </div> |
| 37 | {{else}} |
| 38 | <div rst-box> |
| 39 | <p>{{.Empty}}</p> |
| 40 | </div> |
| 41 | {{end}} |
| 42 | |
| 43 | <div rst-box> |
| 44 | {{if .Available}} |
| 45 | <form method="post" action="{{.Action}}" enctype="multipart/form-data" rst-form> |
| 46 | <div rst-field> |
| 47 | <label rst-field-label for="fonts-file">{{.Label}}</label> |
| 48 | <input rst-input id="fonts-file" name="file" type="file" multiple required |
| 49 | accept=".ttf,.otf,.woff,.woff2" aria-describedby="fonts-file-hint"> |
| 50 | <small rst-field-hint id="fonts-file-hint">{{.Hint}}</small> |
| 51 | </div> |
| 52 | <p>{{.Rights}}</p> |
| 53 | {{template "form-foot" dict "L" $L "Submit" .Submit}} |
| 54 | </form> |
| 55 | {{else}} |
| 56 | <p>{{.Unavailable}}</p> |
| 57 | {{end}} |
| 58 | </div> |
| 59 | {{end}} |
| 60 | |