index.eta 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. <div class="table-wrapper">
  22. <table>
  23. <tr>
  24. <th>meno</th>
  25. <th>popis</th>
  26. <th>vlastník</th>
  27. <th>vytvorená</th>
  28. </tr>
  29. <% for (const meteostanica of it.meteostanice) { %>
  30. <tr>
  31. <td><a href="/panel/stations/<%= meteostanica.id %>"><%= meteostanica.name %></a></td>
  32. <td><%= meteostanica?.description ?? `` %></td>
  33. <td><%= meteostanica.owner %></td>
  34. <td><%= meteostanica.timestamp %></td>
  35. </tr>
  36. <% } %>
  37. </table>
  38. </div>
  39. <% } else { %>
  40. <p>žiadne stanice. :(</p>
  41. <% } %>