| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <% layout("/en/layout", { title: `edit station` }) %>
- <%~ include("/en/panel/partials/navbar") %>
- <% const backIcon = `
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m12 19l-7-7l7-7m7 7H5" />
- </svg>
- ` %>
- <% const editIcon = `
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
- <path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
- <path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" />
- </g>
- </svg>
- ` %>
- <% const errorIcon = `
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01" />
- </svg>
- ` %>
- <% const saveIcon = `
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
- <path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" />
- <path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7M7 3v4a1 1 0 0 0 1 1h7" />
- </g>
- </svg>
- ` %>
- <div class="container-row">
- <a role="button" href="/en/panel/stations/<%= it.meteostanica.id %>"><%~ backIcon %></a>
- <h2><%~ editIcon %> edit <%= it.meteostanica.name %></h2>
- </div>
- <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.stations?.errors)?.(it?.errorDetails) %>
- <% if (typeof errorValue === "string") { %>
- <div class="message error">
- <p class="messageText"><%~ errorIcon %> <%= errorValue %></p>
- </div>
- <% } %>
- <form action="/en/panel/stations/<%= it.meteostanica.id %>/edit" method="post">
- <div>
- <label for="name">name</label>
- <input type="text" id="name" name="name" placeholder="cool station" value="<%= it.meteostanica.name %>">
- </div>
- <div>
- <label for="description">description</label>
- <textarea id="description" name="description" placeholder="the coolest one"><%= it.meteostanica.description %></textarea>
- </div>
- <div>
- <label for="owner">owner</label>
- <input type="text" id="owner" name="owner" placeholder="your@email.com" value="<%= it.meteostanica.owner %>">
- </div>
- <div>
- <label for="subowners">subowners</label>
- <small>emails separated by a comma</small>
- <textarea id="subowners" name="subowners" placeholder="subowner@email.com[,subowner2@email.com]"><%= JSON.parse(it.meteostanica?.subowners)?.length ? JSON.parse(it.meteostanica?.subowners).join(',') : "" %></textarea>
- </div>
- <div class="cf-turnstile" data-sitekey="<%= it.siteKey %>"></div>
- <button type="submit" class="primary"><%~ saveIcon %> save</button>
- </form>
- <script
- src="https://challenges.cloudflare.com/turnstile/v0/api.js"
- async
- defer
- ></script>
|