{% extends '../layouts/default.html' %}


{% block main %}

<div class="container pb-sm-40">
  <h1>{{ title }}</h1>
</div>
{% endblock %}

{% block content %}
  {% if document.isNew %}
    {% set action = '/documents' %}
  {% else %}
    {% set action = '/documents/' + document._id %}
  {% endif %}

  <div class="container pb-sm-40">
      <div class="section-title">
       <div class="row">
    <div class="col-md-8">
      <form method="post" action="{{ action }}" enctype="multipart/form-data" role="form" class="form-horizontal">
        <input type="hidden" name="_csrf" value="{{ csrf_token }}">
        {% if not document.isNew %}
          <input type="hidden" name="_method" value="PUT">
        {% endif %}
        <div id="name" class="form-group">
        <label for="title">Döküman Adı Giriniz: </label>
        <input type="text" name="name" placeholder="Document Name" value="{{ document.name }}" placeholder="Enter the name" class="form-control" id="name">
        </div>  
        <button type="submit" class="btn btn-success">Save</button>
        &nbsp;
        <button href="/documents" class="btn btn-danger">Cancel</button>   
        
      </form>
    </div>    
  </div>        
      </div>
    </div>

 
  
{% endblock %}
