list.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <html>
  2. <head>
  3. <title>gildas.ch</title>
  4. <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
  5. <style>
  6. body {
  7. font-family: 'Roboto', sans-serif;
  8. }
  9. h2 {
  10. font-size: 1.2em;
  11. color: #757575;
  12. }
  13. ul {
  14. list-style-type: none;
  15. display: flex;
  16. flex-wrap: wrap;
  17. padding: 0;
  18. }
  19. li {
  20. width: 240px;
  21. height: 400px;
  22. display: grid;
  23. grid-template-rows: 320px 80px;
  24. box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  25. margin: 10px;
  26. }
  27. li .poster {
  28. justify-self: center;
  29. align-self: center;
  30. }
  31. li .metadata {
  32. padding: 10px;
  33. }
  34. li img {
  35. max-width: 240px;
  36. max-height: 320px;
  37. }
  38. h3 {
  39. margin-bottom: 5px;
  40. margin-top: 5px;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <h2>Movies</h2>
  46. <ul>
  47. {{ range $m := .Movies }}
  48. <li>
  49. <div class="poster">
  50. <img src="{{ $m.Poster }}" title="{{ $m.Title }}" alt="{{ $m.Title }}" />
  51. </div>
  52. <div class="metadata">
  53. <h3>{{ $m.Title }}</h3>
  54. <div>{{ $m.Director }}</div>
  55. </div>
  56. </li>
  57. {{ end }}
  58. </ul>
  59. <h2>Add a movie</h2>
  60. <div>
  61. <form method="get">
  62. <p>Search by title: <input type="text" name="title" /> <input type="submit" /></p>
  63. </form>
  64. <form method="post">
  65. <p>Add OMBD JSON movie:<br />
  66. <textarea name="omdb_json" style="width:500px;height:140px;"></textarea>
  67. <input type="submit" />
  68. </p>
  69. </form>
  70. </div>
  71. </body>
  72. </html>