{% load inventree_extras %}
{% load i18n %}

{% setting_object key as setting %}
<tr>
    <td><b>{{ setting.name }}</b></td>
    <td>
        {% if setting.is_bool %}
        <div>
            <input fieldname='{{ setting.key }}' class='slidey' type='checkbox' data-offstyle='warning' data-onstyle='success' data-size='small' data-toggle='toggle' disabled autocomplete='off' {% if setting.as_bool %}checked=''{% endif %}>
        </div>
        {% else %}
        {% if setting.value %}
        <b>{{ setting.value }}</b>{{ setting.units }}</td>
        {% else %}
        <i>{% trans "No value set" %}</i>
        {% endif %}
        {% endif %}
    <td>
        {{ setting.description }}
    </td>
    <td>
        <div class='btn-group float-right'>
            <button class='btn btn-default btn-glyph btn-edit-setting' pk='{{ setting.pk }}' setting='{{ key }}' title='{% trans "Edit setting" %}'>
                <span class='fas fa-edit icon-green'></span>
            </button>
        </div>
    </td>
</tr>