<!DOCTYPE html>
<html lang="en">

<head>
  <%- include('includes/head', { title: 'Update post' }) %>
  <link rel="stylesheet" href="/styles/forms.css">
</head>

<body>
  <%- include('includes/header') %>
  <main>
    <h1>Update post</h1>
    <form action="/posts/<%= post.id %>/update" method="POST">
      <div class="form-control">
        <label for="title">Title</label>
        <input type="text" id="title" name="title" value="<%= post.title %>" required>
      </div>
      <div class="form-control">
        <label for="summary">Summary</label>
        <input type="text" id="summary" name="summary" value="<%= post.summary %>" required maxlength="255">
      </div>
      <div class="form-control">
        <label for="content">Post Content</label>
        <textarea id="content" name="content" required rows="5"><%= post.body %></textarea>
      </div>
      <button class="btn">Update Post</button>
    </form>
  </main>
</body>

</html>