{% include '@dashnex/header.twig' %}

<header class="dashnex-frame-header" id="dnc-page-header">
	<h3 class="pull-left">Licenses</h3>
	<div class="dashnex-frame-primary-actions">
	</div>

	<div class="clearfix"></div>

	<div class="dashnex-frame-container">

	</div>
</header>

<table class="table table-bordered dashnex-frame-rounded-container dashnex-table">
      <tbody>
      {% for id, details in plugins %}
		<tr>
			<td>
	          	<h4><img src="{% if details.logo is defined %}{{ asset( details.logo.namespace, details.logo.path ) }}{% else %}{{ asset( 'dashnex', 'img/default.png' ) }}{% endif %}" class="dashnex-productIcon" height="30" width="30">{{ details.name }}
	          	{% if details.valid %}
					<span class="label label-success">Valid</span>
				{% else %}
					<span class="label label-danger">Invalid</span>
				{% endif %}</h4>
	          	<p>{{ details.description }}</p>
	          	{% if not details.valid %}
					<button class="btn btn-info license" data-code="{{ id }}">License</button>
					<img src="{{ asset( 'dashnex', 'img/small_loading.gif' ) }}" data-code="{{ id }}" class="hide" />
				{% endif %}
          	</td>
		</tr>
		{% for id, upgrade_details in details.upgrades %}
			<tr class="dashnex-rowInner">
				<td>
		          	<h4>{{ upgrade_details.name }}
		          	{% if upgrade_details.valid %}
						<span class="label label-success">Valid</span>
					{% else %}
						<span class="label label-danger">Invalid</span>
					{% endif %}</h4>
		          	<p>{{ upgrade_details.description }}</p>
		          	{% if not upgrade_details.valid %}
						<button class="btn btn-info license" data-code="{{ id }}">License</button>
						<img src="{{ asset( 'dashnex', 'img/small_loading.gif' ) }}" data-code="{{ id }}" class="hide" />
					{% endif %}
		        </td>
			</tr>
		{% endfor %}
	  {% else %}
		<tr>
			<td>No DashNex plugins are installed/activated on your blog.  Install/Activate them via the Plugins screen then come back here.</td>
		</tr>
	  {% endfor %}
      </tbody>
</table>
<div class="dashnex-frame-popover">
	<div class="dashnex-frame-popover-arrow"></div>
	<h3 class="dashnex-frame-popover-title">Help!</h3>
	<div class="dashnex-frame-popover-content">
		<p><a id="show-support-modal-btn" href="#">I need to email support.</a></p>
	</div>
</div>

{% include '@dashnex/modal/support.twig' %}
