<div class="header">
  <div class="header-inner">
    <div class="options">
      <div class="dropdown">
        <%= link_to 'javascript:void(0)', class: 'dropdown-toggle', data: { name: name.downcase, toggle: 'dropdown'} do %>
          <i class="fa fa-plus"> </i>
        <% end %>

        <ul class="dropdown-menu pull-right" role="menu">
          <li>
            <%= link_to 'Empty (no template)',
              new_path,
              :tabindex => '-1',
              :data => {
                :category_id => category_id,
                :title       => "Add #{name.singularize}",
              } %>
          </li>

          <li class="divider"></li>

          <% if NoteTemplate.all.any? %>
            <% NoteTemplate.all.each do |template| %>
              <li>
                <%= link_to template.name, "#{new_path}?template=#{template.id}", tabindex: '-1' %>
              </li>
            <% end %>
          <% else %>
            <li class="disabled"><a href="javascript:void(0)" >(no templates defined)</a></li>
          <% end -%>

        </ul>
      </div>
    </div>
    <h3><%= name %></h3>
  </div>
</div>

<div id="<%= name.downcase %>" class="note-list">
  <% if collection.any? %>
    <%= render collection %>
  <% end %>
  <div class="list-item">
    <div class="note placeholder <%= 'hide' if collection.any? %>">(nothing yet)</div>
  </div>
</div>
