{# html snippet for creating entry modals dynamically #}
{# all the modals have the same id because their contents are destroyed #}
{# after each use #}
{# modal id is 'ajaxModal' #}

<!--div class="modal fade" id="ajaxModal" role="dialog"-->
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" 
                data-dismiss="modal">&times;
            </button>
            <h4>
                {{ entry.date }}:
                {{ entry.time }} - 
                {{ entry.time_end }}: 
                {{ entry.customer }}
            </h4>
        </div>
        <div class="modal-body">
            <div class="container">
                {% if entry.customer %}
                    <div class="row">
                        <div class="col-xs-2">
                            Customer Notes:
                        </div>
                        <div class="col-xs-10">
<textarea disabled rows="5">{{ entry.customer.notes }}</textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <p></p>
                        </div>
                    </div>
                {% endif %}
                <div class="row">
                    <div class="col-xs-2">
                        Treatment: 
                    </div>
                    <div class="col-xs-10">
                        {{ entry.treatment }}
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-2">
                        Resource: 
                    </div>
                    <div class="col-xs-10">
                        {{ entry.resource }}
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-2">
                        Entry Notes:
                    </div>
                    <div class="col-xs-10">
                        <textarea disabled rows="5">{{ entry.notes }}</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            {% if request.user.is_staff %}
                <button 
                    type="button" 
                    class="btn btn-danger" 
                    onclick=
"next_url('{% url 'diary:entry_admin' pk=entry.pk action='delete' %}?next={{ redirect_url }}');"
                    >
                    Delete
                </button>
            {% endif %}
            {% if enable_no_show_button %}
                <button 
                    type="button" 
                    class="btn btn-warning" 
                    onclick=
"next_url('{% url 'diary:entry_admin' pk=entry.pk action='no_show' %}?next={{ redirect_url }}');"
                    >
                    No-Show
                </button>
            {% endif %}
            {% if enable_edit_buttons %}
                <button 
                    type="button" 
                    class="btn btn-warning" 
                    onclick=
"next_url('{% url 'diary:entry_admin' pk=entry.pk action='cancel' %}?next={{ redirect_url }}');"
                    >
                    Cancel
                </button>
            {% endif %}
            {% if entry.customer %}
                {% if enable_history_button %}
                    <button 
                        type="button" 
                        class="btn btn-default" 
                        onclick=
"next_url('{% url 'diary:history' pk=entry.customer.pk %}?next={{ redirect_url }}');"
                        >
                        History
                    </button>
                {% endif %}
                <button 
                    type="button" 
                    class="btn btn-default" 
                    onclick=
"next_url('{% url 'diary:customer_edit' pk=entry.customer.pk %}?next={{ redirect_url }}');"
                    >
                    Personal
                </button>
                <button 
                    type="button" 
                    class="btn btn-default" 
                    onclick=
"next_url('{% url 'diary:entry_new_customer' slug=book_ahead_datetime_slug customer_pk=entry.customer.pk %}?next={{ redirect_url }}');"
                    >
                    Book Ahead
                </button>
            {% endif %}
            {% if enable_edit_buttons %}
                <button 
                    type="button" 
                    class="btn btn-default" 
                    onclick=
"next_url('{% url 'diary:entry' pk=entry.pk %}?next={{ redirect_url }}');"
                    >
                    Edit Entry
                </button>
            {% endif %}
            <button 
                type="button" 
                class="btn btn-default" 
                data-href="#"
                data-dismiss="modal"
                >
                Close
            </button>
        </div>
    </div>
</div>
<!--/div-->

