<!DOCTYPE html>
<html>
  <head>
    <title>Administration</title>
    <link rel="stylesheet" href="/css/admin.css">
    <link rel="stylesheet" href="/css/admin-new-post.css">
    <link rel="preconnect" href="https://fonts.gstatic.com">
		<link href='https://fonts.googleapis.com/css?family=Average|Montserrat' rel='stylesheet' type='text/css'>
  </head>
  <body>
    <header>
      <h3><a href="/admin">Admin</a></h3>
      <div class="right-header">
        <a href="/admin/logout">Logout</a>
      </div>
    </header>
    <main>
      <h2>Admin</h2>
        <div class="list-header">
          <h3>New Post</h3>
        </div>
        <div id="create-new-post">
          <form enctype="multipart/form-data" action="/admin/post/{{ .Post.ID }}/edit" method="POST">
            <fieldset>
              <legend>New Post</legend>
              <label for="title">Title</label>
              <input type="text" name="title" value="{{ .Post.Title }}">
              <label for="subject">Subject</label>
              <select name="subject">
                <option value="Programming" 
                {{ if eq .Post.Subject "Programming" }} 
                  selected
                {{ end }}
                >Programming</option>
                <option value="Pentesting"
                {{ if eq .Post.Subject "Pentesting" }} 
                  selected
                {{ end }}
                >Pentesting</option>
              </select>
              <label for="intro">Intro</label>
              <textarea name="intro" rows="6">{{ .Post.Intro }}</textarea><br/><br/>
              <label for="body">Body: </label>
              <textarea name="body" rows="20">{{ .Post.Body }}</textarea><br/><br/>
              <label for="img">Main Image: </label>
              <input type="file" id="img" name="img" accept="image/*">
              <label for="files">More files:</label>
              <input type="file" id="files" name="files" multiple><br><br>
              <input type="submit" value="Submit">
            </fieldset>
          </form>
        </div>
    </main>
  </body>
</html>

