index.eta 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <% layout("/sk/layout", { title: "stanice" }) %>
  2. <%~ include("/sk/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 %> stanice</h2>
  18. <a role="button" class="primary" href="/panel/stations/add"><%~ addIcon %> pridať</a>
  19. </div>
  20. <% if (it.meteostanice?.length) { %>
  21. <table>
  22. <tr>
  23. <th>meno</th>
  24. <th>popis</th>
  25. <th>vytvorená</th>
  26. </tr>
  27. <% for (const meteostanica of it.meteostanice) { %>
  28. <tr>
  29. <td><a href="/panel/stations/<%= meteostanica.id %>"><%= meteostanica.name %></a></td>
  30. <td><%= meteostanica?.description ?? `` %></td>
  31. <td><%= meteostanica.timestamp %></td>
  32. </tr>
  33. <% } %>
  34. </table>
  35. <% } else { %>
  36. <p>žiadne stanice. :(</p>
  37. <% } %>