fortunes_tmpl.nim 396 B

1234567891011121314151617
  1. #! stdtmpl | standard
  2. #import lib/escape
  3. #import model
  4. #proc fortunes_tmpl*(fortunes: openArray[TFortune]): string =
  5. # result = ""
  6. <!DOCTYPE html>
  7. <html>
  8. <head><title>Fortunes</title></head>
  9. <body>
  10. <table>
  11. <tr><th>id</th><th>message</th></tr>
  12. #for fortune in items(fortunes):
  13. <tr><td>${fortune.id}</td><td>${escape(fortune.message)}</td></tr>
  14. #end for
  15. </table>
  16. </body>
  17. </html>