<%  # local params:
    # label
    # value
    # options =>
    #   :remove => url for a remove constraint link
    #   :classes => array of classes to add to container span
    options ||= {}
%>

<span class="btn-group appliedFilter constraint <%= options[:classes].join(" ") if options[:classes] %>">
  <span class="constraint-value btn btn-sm btn-warning btn-disabled">
    <% unless label.blank? %>
      <span class="filterName"><%= label %></span>
    <% end %>
    <% unless value.blank? %>
      <%= content_tag :span, value, class: 'filterValue', title: value %>
    <% end %>
  </span>
  <% unless options[:remove].blank? %>
    <% accessible_remove_label = content_tag :span, class: 'sr-only' do
        if label.blank?
          t('blacklight.search.filters.remove.value', value: value)
        else
          t('blacklight.search.filters.remove.label_value', label: label, value: value)
        end
      end
    %>

    <%= link_to(content_tag(:span, '', class: 'glyphicon glyphicon-remove') + accessible_remove_label,
			options[:remove], class: 'btn btn-warning btn-sm remove dropdown-toggle'
		) %>
  <%- end -%>
</span>
