{{ define "content" }}

<div class="container">

  {{if .Options.Get "update"}}
  <ol class="breadcrumb">
    <li><a href="/subjects">Materie</a></li>
    <li><a href="/subjects/{{.Data.Subject.ID}}">{{.Data.Subject.Name}}</a></li>
    <li class="active"><a href="#">Aggiorna materia</a></li>
  </ol>  
  {{else}}  
  <ol class="breadcrumb">
    <li><a href="/subjects">Materie</a></li>
    <li class="active"><a href="#">Aggiungi</a></li>
  </ol>
  {{end}}

  {{if .Options.Get "update"}}
  <h1 class="karmen-info-header">Aggiorna la materia "{{.Data.Subject.Name}}"</h1>
  {{else}}
  <h1 class="karmen-info-header">Crea una nuova materia</h1>
  {{end}}

  {{if .Options.Get "update"}}
  <form id="form_subjects_add_update" action="/subjects/{{.Data.Subject.ID}}/update" method="POST" role="form" data-toggle="validator">
  {{else}}
  <form id="form_subjects_add_update" action="/subjects/add/" method="POST" role="form" data-toggle="validator">
  {{end}}  
    
    <div class="form-group has-feedback">
      <label class="control-label" for="subject_name">Nome</label>
      <input type="text" name="Name" class="form-control" id="subject_name" placeholder="Nome" {{if .Options.Get "update"}} value="{{.Data.Subject.Name}}" {{end}} required>
    </div>
        
    <div class="form-group">
      <button type="submit" class="btn btn-primary">Salva</button>
      {{if .Options.Get "update"}}
      <a href="/subjects/{{.Data.Subject.ID}}?{{query "tpl_layout" "base" "tpl_content" "subjects_show"}}" class="btn btn-default">Annulla</a>
      {{else}}
      <a href="/subjects/?{{query "tpl_layout" "base" "tpl_content" "subjects"}}" class="btn btn-default">Annulla</a>
      {{end}}
    </div>
    
  </form>

  
</div>

{{ end }}
