<div class="tag-input">
  <%= f.input :tag_list, as: :hidden %>
  Tag:
  <button class="btn dropdown-toggle" data-toggle="dropdown">
    <% if @issue.tags.any? %>
      <span class="tag" style="color: <%= @issue.tags.first.color %>">
        <i class="icon fa fa-tag"></i>
        <%= @issue.tags.first.display_name %>
      </span>
    <% else %>
      <span class="tag" style="color: #555">
        <i class='fa fa-tags'> </i>
        No tag
      </span>
    <% end %>
    <span class="caret"></span>
  </button>
  <ul class="dropdown-menu">
    <li>
      <%= link_to 'javascript:void(0)', class: 'js-taglink',  style: "color: #555", data: { tag: "" } do %>
        <i class="icon fa fa-tag"></i>
        No tag
      <% end %>
    </li>
    <% @tags.each do |tag| %>
    <li>
      <%= link_to 'javascript:void(0)', class: 'js-taglink',  style: "color: #{ tag.color }", data: { tag: h(tag.name) } do %>
        <i class="icon fa fa-tag"></i>
        <%= h(tag.display_name) %>
      <% end %>
    </li>
    <% end %>
  </ul>
</div>
