{% extends "base.html" %}
{% block content %}
  <form class= "ui form" method="post" action="{% url 'knowledgebase:save-article' article.slug %}">
    {% csrf_token %}
    <h1>
      Title: <input class="required field" type="text" name="title" value="{{ article.title }}"></input>
    </h1>
    {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
    <button class="ui right floated button">Save</button>
    Description: <textarea class="required field" type="text" name="description" rows="2">{{ article.description }}</textarea>
    <div class="segment">
    Category: <select class="required field" type="dropdown" name="category">
      <option value="nx" {% if article.category == 'nx' %}selected{% endif %}>Nginx</option>
      <option value="ot" {% if article.category == 'ot' %}selected{% endif %}>Other</option>
    </select>
    </div>
    <div class="ui inverted divider"></div>
    <textarea class="required field" name="content" >{{ article.content }}</textarea>
    {% autoescape off %}{{ article.content }}{% endautoescape %}
  </form>
{% endblock content %}
