{{ define "content" }}

<div class="container">

  {{if .Update}}
  <ol class="breadcrumb">
    <li><a href="/subjects">Materie</a></li>
    <li><a href="/subjects/{{.Subject.ID}}">{{.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 .Update}}
  <h1 class="karmen-info-header">Aggiorna la materia "{{.Subject.Name}}"</h1>
  {{else}}
  <h1 class="karmen-info-header">Crea una nuova materia</h1>
  {{end}}
  
  <form action="{{.SubmitUrl}}" method="POST" role="form" data-toggle="validator">
    
    <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 .Update}} value="{{.Subject.Name}}" {{end}} required>
    </div>
        
    <div class="form-group">
      <button type="submit" class="btn btn-primary">Salva</button>
      {{if .Update}}
      <a href="/subjects/{{.Subject.ID}}" class="btn btn-default">Annulla</a>
      {{else}}
      <a href="/subjects" class="btn btn-default">Annulla</a>
      {{end}}
    </div>
    
  </form>

  
</div>

{{ end }}
