
{% comment %}
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="gutters: true, splitter:true">

<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top', href: '{% url "freeadmin_plugins_available_datagrid" %}'" style="height: 50%">
</div>

<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'" style="height: 50%">

<div style="background-color: #eee; padding: 3px; border-bottom: 1px solid #ccc;">
{% trans "Installed" %}
</div>
{% endcomment %}

<table class="grid">
    <thead class="header">
        <tr>
            <td>{% trans "Plugin name" %}</td>
            <td>{% trans "Version" %}</td>
            <td>{% trans "PBI" %}</td>
            <td>{% trans "Jail" %}</td>
            <td>{% trans "Service status" %}</td>
            <td>{% trans "Actions" %}</td>
        </tr>
    </thead>
{% for p in plugins %}
      <tr>
           <td>
               <img src="{% url "plugin_installed_icon" plugin_name=p.plugin_name oid=p.id %}" width="16" heigth="16" /> &nbsp;
               {{ p.plugin_name|capfirst }}
           </td>
           <td>
               {{ p.plugin_version }}
           </td>
           <td>
               {{ p.plugin_pbiname }}
           </td>
           <td>
               {% if p.service.jail_status %}
               {{ p.plugin_jail }}
               {% else %}
               <p style="margin:10px;"><span style="color: red;">{{ p.plugin_jail }}</span></p>
               {% endif %} 

           </td>
           <td>
                <img src="{{ STATIC_URL }}images/ui/buttons/{% if p.service.status == "RUNNING" %}on{% else %}off{% endif %}.png" onClick="togglePluginService(this, '{{ p.plugin_name|escapejs }}', {{ p.id|escapejs }})" status="{% if p.service.status == "RUNNING" %}on{% else %}off{% endif %}" style="cursor: pointer;">
           </td>
           <td>
		{% if p.update_available %}
                <button id="btn_Plugins_{{ p.id }}_Update" data-dojo-type="dijit.form.Button" type="button" >
                  {% trans "Update" %}
                  <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
                      editObject('{% trans "Update plugin"|force_escape|force_escape %}', '{% url "plugin_update" oid=p.id %}', [this,]);
                  </script>
                </button>
		{% endif %}

                <button id="btn_Plugins_{{ p.id }}_Delete" data-dojo-type="dijit.form.Button" type="button">
                  {% trans "Delete" %}
                  <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
                      editObject('{% trans "Delete plugin"|force_escape|force_escape %}', '{% url "freeadmin_plugins_plugins_delete" oid=p.id %}', [this,]);
                  </script>
                </button>
           </td>
      </tr>
{% empty %}
      <tr>
        <td colspan="6">
            {% trans "No available plugins services" %}
        </td>
      </tr>
{% endfor %}
</table>

</div>

</div>
