{% if order.status == 'active' %}
<h2 class="text-center">{{ order.title }}</h2>
<div class="alert alert-info text-center">
    <h4>{{ 'License details'|trans }}</h4>
    <ul class="list-group">
        <li class="list-group-item">
            <h4 class="list-group-item-heading">{{ 'Key'|trans }}</h4>
            <p class="list-group-item-text">{{ service.license_key }}</p>
        </li>
        {% if service.validate_ip %}
            <li class="list-group-item">
                <h4 class="list-group-item-heading">{{ 'Valid IPs'|trans }}</h4>
                <p class="list-group-item-text">
                {% for ip in service.ips %}{{ ip }} <br>
                {% else %}{{ 'All ips'|trans }}
                {% endfor %}
                </p>
            </li>
        {% endif %}
        {% if service.validate_host %}
            <li class="list-group-item">
                <h4 class="list-group-item-heading">{{ 'Valid Domains'|trans }}</h4>
                <p class="list-group-item-text">
                {% for host in service.hosts %}
                    {{ host }} <br>
                {% else %}
                    {{ 'All hosts'|trans }}
                {% endfor %}
                </p>
            </li>
        {% endif %}
        {% if service.validate_version %}
            <li class="list-group-item">
                <h4 class="list-group-item-heading">{{ 'Valid Versions'|trans }}</h4>
                <p class="list-group-item-text">
                {% for version in service.versions %}{{ version }} <br>
                {% else %}{{ 'All versions'|trans }}
                {% endfor %}
                </p>
            </li>
        {% endif %}
        {% if service.validate_path %}
            <li class="list-group-item">
                <h4 class="list-group-item-heading">{{ 'Valid Install paths'|trans }}</h4>
                <p class="list-group-item-text">
                {% for path in service.paths %}{{ path }} <br>
                {% else %}{{ 'All paths'|trans }}
                {% endfor %}
                </p>
            </li>
        {% endif %}
    </ul>
</div>

<div class="alert alert-warning text-center">
    <h4>{{ 'Reset license'|trans }}</h4>
    <p>{{ 'You can reset your license parameters if you have changed your server'|trans }}</p>
    <p><button class="btn btn-warning" type="button" id="license-reset">{{ 'Reset'|trans }}</button></p>
</div>

<script>
$(function() {
    $('#license-reset').bind('click', function(event) {
        if (confirm("{{ 'Are you sure?'|trans }}")) {
            bb.post('client/servicelicense/reset', { order_id: {{ order.id }} }, function(result) {
                boxbilling.message("{{ 'License was reset'|trans }}");
            });
        }
    });
});
</script>
{% endif %}