{% load bootstrap3 pluralize %}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">


<input type="hidden" class="maced" id="{{ item_name }}-hidden" name="{{ item_name }}_id" value="" />

<tr class="maced" id="{{ item_name }}-tr" {% if should_hide %} style="display: none" {% endif %}>
    <th class="maced" id="{{ item_name }}-row-name-th"> {{ item_html_name }}: </th>

    <td class="maced">
        <select class="maced {{ item_html_class_name }} form-control disableable" id="{{ item_name }}-select" {% if should_disable %} disabled {% endif %}>
            {% if allow_empty %} <option class="maced" value=""></option> {% endif %}
            {% for item in items %}
                <option class="maced" value="{{ item.id }}" {% if item.id == item_id %} selected {% endif %}> {{ item }} </option>
            {% endfor %}
        </select>

        <div class="maced" style="color: Green">
            <b class="maced" id="{{ item_name }}-success-b">  </b>
        </div>
    </td>

    <td class="maced">
        <div class="maced btn-group">
            <div class="maced btn-group-vertical">
                {% if not should_remove_add %}
                    <button type="button" class="maced btn btn-success disableable" id="add-{{ item_name }}-button"
                        data-original-title="Add New {{ item_html_name }}" data-toggle="modal"
                        data-target="#add-{{ item_name }}-modal">
                        {% bootstrap_icon "plus" %} Add New {{ item_html_name }}
                    </button>
                {% endif %}

                {% if not should_remove_clone %}
                    <button type="button" class="maced btn btn-primary disableable" id="clone-{{ item_name }}-button"
                        data-original-title="Clone {{ item_html_name }}" data-toggle="modal"
                        data-target="#clone-{{ item_name }}-modal" disabled>
                        {% bootstrap_icon "duplicate" %} Clone {{ item_html_name }}
                    </button>
                {% endif %}

                {% if not should_remove_edit %}
                    <button type="button" class="maced btn btn-info disableable" id="edit-{{ item_name }}-button"
                        data-original-title="Edit {{ item_html_name }}" data-toggle="modal"
                        data-target="#edit-{{ item_name }}-modal">
                        {% bootstrap_icon "edit" %} Edit {{ item_html_name }}
                    </button>
                {% endif %}
            </div>

            <div class="maced btn-group-vertical">
                {% if not should_remove_merge %}
                    <button type="button" class="maced btn btn-warning disableable" id="merge-{{ item_name }}-button"
                        data-original-title="Merge {{ item_html_name }}" data-toggle="modal"
                        data-target="#merge-{{ item_name }}-modal">
                        {% bootstrap_icon "resize-small" %} Merge {{ item_html_name|pluralize|default:item_html_name }}
                    </button>
                {% endif %}

                {% if not should_remove_delete %}
                    <button type="button" class="maced btn btn-danger disableable" id="delete-{{ item_name }}-button"
                        data-original-title="Delete {{ item_html_name }}" data-toggle="modal"
                        data-target="#delete-{{ item_name }}-modal">
                        {% bootstrap_icon "trash" %} Delete {{ item_html_name }}
                    </button>
                {% endif %}

                {% if not should_remove_info %}
                    <button type="button" class="maced btn btn-secondary disableable" id="info-{{ item_name }}-button"
                        data-original-title="{{ item_html_name }} Info" data-toggle="modal"
                        data-target="#info-{{ item_name }}-modal" disabled>
                        {% bootstrap_icon "list-alt" %} {{ item_html_name }} Info
                    </button>
                {% endif %}
            </div>
        </div>
    </td>
</tr>
