
<div class="modal fade" id="restore-modal" tabindex="-1" role="dialog" aria-labelledby="Restore" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Restore Tree</h4>
            </div>
            <div class="modal-body">
                <h4>Commits ({{commits_info|length}})</h4>
                    <pre>{% for commits in commits_info %}<span>'{{commits.0}}'({{commits.1}})</span><br><small>{{commits.2}}</small> <br><br>{% endfor %}</pre>
                <h4>Files</h4>
                <pre>{% spaceless %}
                    {% if files_added %}
                        <h5><span class="label label-success">New</span></h5>
                        {% for file in files_added  %}
                            <span>{{file}}</span><br>
                        {% endfor %}
                    {% endif %}
                    {% if files_modified %}
                        <h5><span class="label label-warning">Modified</span></h5>
                        {% for file in files_modified  %}
                            <span>{{file}}</span><br>
                        {% endfor %}
                    {% endif %}
                    {% if files_removed %}
                        <h5><span class="label label-danger">Removed</span></h5>
                        {% for file in files_removed  %}
                            <span>{{file}}</span><br>
                        {% endfor %}
                    {% endif %}
                {% endspaceless %}</pre> 
            </div>
            <div class="modal-footer">
                <form action="{% url 'ftpdeploy_service_restore' service.pk %}" method="post" id="restore-form">
                    <input type="hidden" name="payload" value="{{payload}}">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Restore</button>
                </form>
            </div>
        </div>
    </div>
</div>