<div class="form-row">
    <div class="form-item">
        <label>Title</label>
        <input type="text" name="title" value="<%= book.title %>">
    </div>
    <div class="form-item">
        <label>Topic</label>
        <select name="topic">
            <% topics.forEach(topic => { %>
                <% if (topic.id===book.topic) { %>
                    <option selected label="<%= topic.type %>" value="<%= topic.id %>">
                        <% } else { %>
                    <option label="<%= topic.type %>" value="<%= topic.id %>">
                        <% } %>
                            <% }) %>
        </select>
    </div>
</div>

<div class="form-row">
    <div class="form-item">
        <label>Author</label>
        <select name="author">
            <% authors.forEach(author => { %>
                <% if (author.id===book.author) { %>
                    <option selected label="<%= author.fullName %>" value="<%= author.id %>">
                        <% } else { %>
                    <option label="<%= author.fullName %>" value="<%= author.id %>">
                        <% } %>
                            <% }) %>
        </select>
    </div>
    <div class="form-item">
        <label>ISBN</label>
        <input type="number" name="ISBN" value="<%= book.ISBN %>">
    </div>
</div>

<div class="form-row">
    <div class="form-item">
        <label>Publish Date</label>
        <input type="date" name="publishDate" value="<%= book.publishDate == null ? '' :
        book.publishDate.toISOString().split('T')[0] %>">
    </div>
    <div class="form-item">
        <label>Page Count</label>
        <input type="number" name="pageCount" min="1" value="<%= book.pageCount %>">
    </div>
</div>

<div class="form-row">
    <div class="form-item form-item-no-grow">
        <label>Cover</label>
        <input type="file" name="cover" class="book-cover filepond">
    </div>
    <div class="form-item">
        <label>Description</label>
        <textarea name="description"><%= book.description %></textarea>
    </div>
</div>
