{{define "title"}}{{printf "Inbucket for %v" .name}}{{end}}
{{$name := .name}}

{{define "script"}}
<script src="/public/mailbox.js" type="text/javascript" charset="utf-8"></script>
<script>
var selected = "{{.selected}}";
var mailbox = "{{.name}}";

$(document).ready(function() {
  $('#nav-mail').addClass("active");
  onDocumentReady();
});
</script>
<script type="text/html" id="list-entry-template">
  <button data-id="id" type="button" class="message-list-entry list-group-item">
    <div class="row">
      <div class="col-sm-4 col-md-12 text-primary" data-content-text="subject"
        data-format="subject"/>
      <div class="col-sm-4 col-md-12 small" data-content-text="from"/>
      <div class="col-sm-4 col-md-12 small" data-content="date" data-format="date"/>
    </div>
  </button>
</script>
{{end}}

{{define "content"}}
<div class="panel panel-info">
  <div class="panel-heading mailbox-header">
    <span class="glyphicon glyphicon-inbox" aria-hidden="true"></span>
    {{.name}}
  </div>
</div>
<div class="col-md-3">
  <div class="input-group">
    <input id="message-search"
           type="search"
           class="form-control"
           placeholder="search"
           data-toggle="tooltip"
           data-placement="top"
           title="Search Sender and Subject"/>
    <div class ="input-group-btn">
      <button class="btn btn-default"
              type="button"
              data-toggle="tooltip"
              data-placement="top"
              title="Clear&nbsp;Search"
              onclick="clearMessageSearch()">
        <span class="glyphicon glyphicon-remove-circle"></span>
      </button>
      <button class="btn btn-default"
              type="button"
              data-toggle="tooltip"
              data-placement="top"
              title="Refresh&nbsp;List"
              onclick="loadList()">
        <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
      </button>
      <button class="btn btn-default"
              type="button"
              data-toggle="tooltip"
              data-placement="top"
              title="Delete&nbsp;Mailbox"
              onclick="deleteMailbox()">
        <span class="glyphicon glyphicon-trash"></span>
      </button>
    </div>
  </div>
  <div id="message-list-wrapper">
    <div id="message-list" class="list-group"></div>
  </div>
</div>
<div id="message-container" class="col-md-9">
  <div id="message-content">
    <p>Select a message at left, or enter a different username into the box on upper right.</p>
  </div>
</div>
{{end}}

