{% load button from filters %}
<div class="text-right py-2">
    {% if create or edit and object %}
    <!--edit-->
    {% button 'submit' %}
    {% elif duplicate %}
    <!--duplicate-->
    <button type="submit" class="btn btn-success"><span class="fas fa-check"></span> Create Duplicate</button>
    {% else %}
    <!--detail view-->
    <div class="btn-group">
        {% button 'edit' url='asset_update' pk=object.asset_id %}
        {% button 'duplicate' url='asset_duplicate' pk=object.asset_id %}
        <a type="button" class="btn btn-info" href="{% url 'asset_audit' object.asset_id %}"><span class="fas fa-certificate"></span> Audit</a>
        <a type="button" class="btn btn-primary" href="{% url 'generate_label' object.asset_id %}"><span class="fas fa-barcode"></span> Generate Label</a>
    </div>
    {% endif %}
    {% if create or edit or duplicate %}
    <br>
    <button type="reset" class="btn btn-link" onclick="
    {% if duplicate %}
        {% url 'asset_detail' previous_asset_id %}
    {% else %}
        history.back()
    {% endif %}">Cancel</button>
    {% endif %}
</div>
