<div class="row">
  <div class="col-xs-12">
    <div class="page-header">
      <h1>Notes</h1>
    </div>

    <% if @notes.empty? %>
        <p>No Notes</p>
    <% else %>

        <%= link_to 'New Note', new_note_path, class: 'btn btn-default' %>

        <br/>

        <table class="table table-condensed table-hover">
          <thead>
          <tr>
            <th>Note</th>
            <th>Date</th>
            <th></th>
          </tr>
          </thead>

          <tbody>
          <% decorate(@notes, NoteDecorator).each do |note| %>
              <tr>
                <td><%= note.content %></td>
                <td><%= note.created_at %></td>
                <td>
                  <%= link_to note, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-xs btn-danger' do %>
                      <span class="glyphicon glyphicon-remove"></span>
                  <% end %>
                </td>
              </tr>
          <% end %>
          </tbody>
        </table>
    <% end %>

    <br/>

    <%= link_to 'New Note', new_note_path, class: 'btn btn-default' %>


  </div>
</div>

