index.eta 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <% layout("/en/layout", { title: "stations" }) %>
  2. <%~ include("/en/panel/partials/navbar") %>
  3. <% const staniceIcon = `
  4. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  5. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  6. <path d="M16.247 7.761a6 6 0 0 1 0 8.478m2.828-11.306a10 10 0 0 1 0 14.134m-14.15 0a10 10 0 0 1 0-14.134m2.828 11.306a6 6 0 0 1 0-8.478" />
  7. <circle cx="12" cy="12" r="2" />
  8. </g>
  9. </svg>
  10. ` %>
  11. <% const addIcon = `
  12. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  13. <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7-7v14" />
  14. </svg>
  15. ` %>
  16. <div class="container-row">
  17. <h2><%~ staniceIcon %> stations</h2>
  18. <a role="button" class="primary" href="/en/panel/stations/add"><%~ addIcon %> add</a>
  19. </div>
  20. <% if (it.meteostanice?.length) { %>
  21. <div class="table-wrapper">
  22. <table>
  23. <tr>
  24. <th>name</th>
  25. <th>description</th>
  26. <th>created</th>
  27. </tr>
  28. <% for (const meteostanica of it.meteostanice) { %>
  29. <tr>
  30. <td><a href="/en/panel/stations/<%= meteostanica.id %>"><%= meteostanica.name %></a></td>
  31. <td><%= meteostanica?.description ?? `` %></td>
  32. <td><%= meteostanica.timestamp %></td>
  33. </tr>
  34. <% } %>
  35. </table>
  36. </div>
  37. <% } else { %>
  38. <p>no stations. :(</p>
  39. <% } %>