{{ define "library/publisher.html" }}
{{ template "header.html" .}}
{{ template "library/menu.html" .}}
<ul class="nav nav-tabs">
    <li role="presentation"><a href="/library/book">Books</a></li>
    <li role="presentation"><a href="/library/author">Authors</a></li>
    <li role="presentation" class="active"><a href="/library/publisher">Publishers</a></li>
</ul>
<div class="panel-body">
  {{ if .ErrorTitle}}
  <p class="bg-danger">
    {{.ErrorTitle}}: {{.ErrorMessage}}
  </p>
  {{end}}
  <form action="/library/publisher/validate" method="POST">
    <div class="form-group">
      <label for="name">Name</label>
      {{ if .payload.Name }}
        <input type="text" class="form-control" id="name" name="name" value={{.payload.Name}}>
      {{ else }}
        <input type="text" class="form-control" id="name" name="name" placeholder="Name">
      {{ end }}
    </div>
    <input type="hidden" name="publisherid" id="publisherid" value={{.payload.ID.Hex}}>
    <button type="submit" class="btn btn-primary" name="action" value={{.action}}>{{.action}}</button>
    {{ if eq .action "Save" }}
      <button type="submit" class="btn btn-primary" name="action" value="Delete">Delete</button>
    {{ end }}
  </form>
</div>
{{ template "footer.html" .}}
{{ end }}
