{% extends "base.html" %}
{% load static %}

{% block content %}

<div class="row">
  <div class="col-md-12 col-sm-12">

    <article>
      <h2> Edit Post </h2>

      {{form.errors}}

      <!-- Submit Form -->
      <form class="form-horizontal"
	    action="{{post.get_absolute_url}}edit" method="post">{% csrf_token %}
        <fieldset>
          <div class="form-group">
	    <!-- Title -->
            <div class="col-lg-12">
	      {{form.title}}
            </div>
	  </div>

          <div class="form-group">	    
	    <!-- Url -->
            <div class="col-lg-12">
	      {{form.url}}
            </div>
          </div>

          <div class="form-group">
	    <!-- Description -->
            <div class="col-lg-12">
	      {{form.body}}
            </div>
          </div>

          <div class="form-group">	    
	    <!-- Url -->
            <div class="col-lg-12">
              <input type="text" class="form-control"
		     name="tags" placeholder="Tags (HTML, Python, Django)"
		     value="{{post_tags}}">
            </div>
          </div>

	  
          <div class="form-group">
	    

	    <!-- Description -->
            <div class="col-lg-3">
	      <select name="post_category" class="form-control">
		<option value="">Category</option>
		{% for category in categories %}
		<option value="{{category.slug}}">{{category.title}}</option>
		{% endfor %}
	      </select>
	    </div>
            <div class="col-lg-3">
	      {{form.post_type}}		
	    </div>
            <div class="col-lg-3">
	      {{form.post_level}}				
	    </div>
            <div class="col-lg-3">
	      {{form.post_price}}				
	    </div>
	    
	  </div>

	  <a href="{{post.get_absolute_url}}delete"
		  class="btn btn-danger left">
	    Delete
	  </a>

	  <button type="submit"
		  class="btn btn-primary right">
	    Submit
	  </button>
	</fieldset>
      </form>
    </article>
  </div>
</div>  
{% endblock %}
