{% load conversation_tags %}

{% if conversation.stopped %}
    <button
     class="btn btn-primary action" 
     data-action='activate'
     data-url="{% conversation_screen conversation 'start' %}">
        Activate
    </button>

    <button
     class="btn btn-primary action" 
     data-action='archive'
     data-url="{% conversation_screen conversation 'archive' %}">
        Archive
    </button>
    
{% elif conversation.running %}
    <button
     class="btn btn-primary action" 
     data-action='stop'
     data-url="{% conversation_screen conversation 'stop' %}">
     Deactivate
    </button>
{% else %}
    {# TODO: Figure out what to put here. #}
    <button
     class="btn btn-primary action" 
     data-action='stop'
     data-url="{% conversation_screen conversation 'stop' %}">
     In transition: attempt to stop
    </button>
{% endif %}

{% load conversation_tags %}

{% if not conversation.archived %}
    {% if conversation.stopped %}
        <button
         class="btn btn-primary action" 
         data-action='activate'
         data-url="{% conversation_screen conversation 'start' %}">
            Activate
        </button>
    {% elif conversation.running %}
        <button
         class="btn btn-primary action" 
         data-action='stop'
         data-url="{% conversation_screen conversation 'stop' %}">
            Deactivate
        </button>
    {% endif %}

    <button
     class="btn btn-primary action" 
     data-action='archive'
     data-url="{% conversation_screen conversation 'archive' %}">
        Archive
    </button>

{% endif %}

Improve conversation action template logic
Improve conversation action template logic
