<%- include("partials/header") %>

<div class="container">
  <div>
    <h1 style="text-align: center; margin-top: 50px">
      Edit <%=campground.name%>
    </h1>
  </div>

  <div style="width: 30%; margin: 25px auto">
    <form
      action="/campgrounds/<%=campground._id%>/edit?_method=PUT"
      method="POST"
      enctype="multipart/form-data"
    >
      <div class="form-group">
        <input
          class="form-control"
          type="text"
          name="name"
          value="<%=campground.name%>"
          placeholder="Enter campsite name"
        />
      </div>
      <div class="form-group">
        <input
          class="form-control"
          type="text"
          name="location"
          value="<%=campground.location%>"
          placeholder="Enter campsite location"
        />
      </div>
      <div class="form-group">
        <input
          class="form-control"
          type="number"
          min="0.0"
          step="0.01"
          name="price"
          placeholder="Enter Price"
          value="<%=campground.price%>"
        />
      </div>
      <div class="form-group">
        <input
          class="form-control"
          type="file"
          name="image"
          value="<%=campground.image%>"
          accept="image/*"
          required
          placeholder="Enter Image"
        />
      </div>
      <div class="form-group">
        <input
          class="form-control"
          type="text"
          name="description"
          value="<%=campground.description%>"
          placeholder="Description"
        />
      </div>
      <div class="form-group">
        <button class="btn btn-primary btn-lg btn-block">Submit</button>
      </div>
    </form>
    <a href="/campgrounds">Go back</a>
  </div>
</div>

<%- include("partials/footer") %>
