{% if order.status == 'active' %}
<h2 class="text-center">{{ order.title }}</h2>

        <div class="alert alert-info text-center">
            <h4>{% trans 'License details' %}</h4>
			<ul class="list-group">
				<li class="list-group-item">
					<h4 class="list-group-item-heading">{% trans 'Key' %}</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">{% trans 'Valid IPs' %}</h4>
						<p class="list-group-item-text">
						{% for ip in service.ips %}{{ ip }} <br/>
                        {% else %}{% trans 'All ips' %}
                        {% endfor %}
						</p>
					</li>
				{% endif %}
				{% if service.validate_host %}
					<li class="list-group-item">
						<h4 class="list-group-item-heading">{% trans 'Valid Domains' %}</h4>
						<p class="list-group-item-text">
						{% for host in service.hosts %}{{ host }} <br/>
                        {% else %}{% trans 'All hosts' %}
                        {% endfor %}
						</p>
					</li>
				{% endif %}
				{% if service.validate_version %}
					<li class="list-group-item">
						<h4 class="list-group-item-heading">{% trans 'Valid Versions' %}</h4>
						<p class="list-group-item-text">
						{% for version in service.versions %}{{ version }} <br/>
                        {% else %}{% trans 'All versions' %}
                        {% endfor %}
						</p>
					</li>
				{% endif %}
				{% if service.validate_path %}
					<li class="list-group-item">
						<h4 class="list-group-item-heading">{% trans 'Valid Install paths' %}</h4>
						<p class="list-group-item-text">
						{% for path in service.paths %}{{ path }} <br/>
                        {% else %}{% trans 'All paths' %}
                        {% endfor %}
						</p>
					</li>
				{% endif %}
			</ul>
        </div>
   
	<div class="alert alert-warning text-center">
            <h4>{% trans 'Reset license' %}</h4>
            <p>{% trans 'You can reset your license parameters if you have changed your server' %}</p>
            <p><button class="btn btn-warning" type="button" id="license-reset">{% trans 'Reset' %}</button></p>
	</div>
        

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