{% extends "signalbox:admin/change_form.html" %}

{% block coltype %}colMS{% endblock %}


{% block object-tools-items %}

    {% if not original.observations and original.condition %}
        <a class='btn' href='{% url 'add_observations_for_membership' object_id %}'>Add observations for this user</a>
    {% endif %}

    {% if not original.condition %}
    <a class='btn' href='{% url 'randomise_membership' object_id %}'>Randomise this user now</a>
    {% endif %}


    {% if original %}
    <a class="btn" href= "{% url 'participant_overview' original.user.id %}">User details</a>

    <a class='btn' href='{% url 'dateshift_membership' object_id %}'>Shift observation times</a>

    {% endif %}

{% endblock %}


{% block sidebar %}
<div class="span3">
    {% if original %}
        <h4>Participant: {{original.user }}</h4>
        <p><a class="btn btn-info" href="{% url 'participant_overview' original.user.id %}">Overview</a></p>
        <hr>
    {% endif %}

    {% if original.study.ad_hoc_scripts.all %}
    <h4>Add additional observations</h4>
            <table class="table">
                {% for i in original.study.ad_hoc_scripts.all %}
                <tr>
                    <td>{{i.name}}</td>
                    <td><a class="btn btn-mini btn-primary" href="{% url 'use_ad_hoc_script' original.id i.id %}">Use script</a>
                    </td>
                </tr>
                {% endfor %}
            </table>

            {% endif %}
</div>
{% endblock %}



