<%- include('layout', { title: 'Artikel bearbeiten - ' + item.name }) %>

<% override body %>
    <h2>Artikel bearbeiten: <%= item.name %></h2>
    
    <form action="/items/<%= item.id %>", method="POST">
        <div class="form-group">
            <label for="name">Name:</label>
            <input type="text" id="name" name="name" required autofocus
                   value="<%= item.name %>">
        </div>
        <div class="form-group">
            <label for="price">Preis (€):</label>
            <input type="number" id="price" name="price" step="0.01" min="0.01" required
                   value="<%= item.price.toFixed(2) %>">
        </div>
        <div class="form-group">
            <label for="description">Beschreibung (optional):</label>
            <input type="text" id="description" name="description"
                   value="<%= item.description || '' %>">
        </div>
        <button type="submit" class="btn">Speichern</button>
        <a href="/items" class="btn secondary">Abbrechen</a>
    </form>
    
    <% if (error) { %>
        <div class="error"><%= error %></div>
    <% } %>
<% end %>
