edit.eta 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <% layout("/en/layout", { title: `edit station` }) %>
  2. <%~ include("/en/panel/partials/navbar") %>
  3. <div>
  4. <h2><%= it.meteostanica.name %> - edit</h2>
  5. <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.stations?.errors)?.(it?.errorDetails) %>
  6. <% if (typeof errorValue === "string") { %>
  7. <span class="error"><%= errorValue %></span>
  8. <% } %>
  9. <form action="/en/panel/stations/<%= it.meteostanica.id %>/edit" method="post">
  10. <div>
  11. <label for="name">name</label>
  12. <input type="text" id="name" name="name" placeholder="cool station" value="<%= it.meteostanica.name %>">
  13. </div>
  14. <br>
  15. <div>
  16. <label for="description">description</label>
  17. <textarea id="description" name="description" placeholder="cool station"><%= it.meteostanica.description %></textarea>
  18. </div>
  19. <br>
  20. <div>
  21. <label for="owner">owner</label>
  22. <input type="text" id="owner" name="owner" placeholder="your@email.com" value="<%= it.meteostanica.owner %>">
  23. </div>
  24. <br>
  25. <div class="cf-turnstile" data-sitekey="<%= it.siteKey %>"></div>
  26. <br>
  27. <button type="submit">save</button>
  28. <a href="/en/panel/stations/<%= it.meteostanica.id %>">&lt;&lt; go back</a>
  29. </form>
  30. </div>
  31. <script
  32. src="https://challenges.cloudflare.com/turnstile/v0/api.js"
  33. async
  34. defer
  35. ></script>