<%- include('layout', { title: 'Neuen Artikel anlegen' }) %>

<% override body %>
    <h2>Neuen Artikel anlegen</h2>
    
    <form action="/items" method="POST">
        <div class="form-group">
            <label for="name">Name:</label>
            <input type="text" id="name" name="name" required autofocus 
                   value="<%= locals.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="<%= locals.price || '' %>">
        </div>
        <div class="form-group">
            <label for="description">Beschreibung (optional):</label>
            <input type="text" id="description" name="description"
                   value="<%= locals.description || '' %>">
        </div>
        <button type="submit" class="btn">Artikel anlegen</button>
        <a href="/items" class="btn secondary">Abbrechen</a>
    </form>
    
    <% if (error) { %>
        <div class="error"><%= error %></div>
    <% } %>
<% end %>
