{{ define "content" }}

<div class="container">

  <nav aria-label="breadcrumb">
  {{if .Options.Get "update"}}
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="/documents?{{query "tpl_layout" "base" "tpl_content" "documents"}}">Documento</a></li>
    <li class="breadcrumb-item active"><a href="#">Aggiorna documento</a></li>
  </ol>
  </nav>
  
  {{else}}
  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="/documents?{{query "tpl_layout" "base" "tpl_content" "documents"}}">Documento</a></li>
      <li class="breadcrumb-item active"><a href="#">Aggiungi</a></li>
    </ol>
  </nav>
  {{end}}

 {{if .Options.Get "update"}}
  <div class="karmen-info-header">
    <div class="row">
      <div class="col-md-8">
	<h1>Aggiorna document</h1>
      </div>
    </div>
  </div>
  
  {{else}}
  <h1 class="karmen-info-header">Crea nuovo documento</h1>
  {{end}}

  {{if .Options.Get "update"}}
  <form id="form_documents_add_update" action="/documents/{{.Data.ID}}/update" method="POST" role="form" data-toggle="validator">
  {{else}}
  <form id="form_documents_add_update" action="/documents/add/" method="POST" role="form" data-toggle="validator">
  {{end}}

    <div class="form-group has-feedback">
      <label class="control-label" for="document_name">Nome</label>
      <input type="text" name="Name" class="form-control" id="document_name" placeholder="Nome" {{if .Options.Get "update"}} value="{{.Data.Name}}" {{end}} required>
    </div>

    <div class="form-group has-feedback">
      <label class="control-label" for="document_cloud_path">Cartella di lavoro remota</label>
      <input type="text" name="CloudPath" class="form-control" id="document_cloud_path" placeholder="Documents/" {{if .Options.Get "update"}} value="{{.Data.CloudPath}}" {{end}} required>
    </div>

    <div class="form-group">
      <button type="submit" class="btn btn-primary">Salva</button>
      {{if .Options.Get "update"}}
      <a href="/documents/{{.Data.ID}}?{{query "tpl_layout" "base" "tpl_content" "documents_show"}}" class="btn btn-default">Annulla</a>
      {{else}}
      <a href="/documents?{{query "tpl_layout" "base" "tpl_content" "documents"}}" class="btn btn-default">Annulla</a>
      {{end}}
    </div>
    
  </form>

</div>

{{ end }}
