{% load static %} 
{% include "header.html" %}
{% include "navigation.html" with main_path='/main/' %}

<br/>
<br/>

<div class="container">
  <div class="dashboard">
    <div class="span8 offset2">
      <h1><a href="/containers">Container List</a> {% if data.container %}&gt; {{ data.container.id }} {% endif %} </h1>
      <hr/>

      {% if data.container %}
      <table class="dashboard">

       <tr>
        <td><b>ID</b></td>
        <td>{{ data.container.id }}</td>
       </tr>

       <tr>
        <td><b>Image</b></td>
        <td>{{ data.container.image }}</td>
       </tr>

       <tr>
        <td><b>Type</b></td>
        <td>{{ data.container.type }}</td>
       </tr>

       <tr>
        <td><b>Owner</b></td>
        <td>{% if data.container.user %}{{data.container.user}}{% else %}Platform{% endif %}</td>
       </tr>

       <tr>
        <td><b>Registry</b></td>
        <td>{{ data.container.registry }}</td>
       </tr>

       <tr>
        <td><b>Service port(s)</b></td>
        <td>{{ data.container.service_ports}}</td>
       </tr>

      </table>
      <br />
      
      {% else %}
      
      {% for container in data.platform_containers %}
      
      <table class="dashboard">

       <tr>
        <td><b>ID</b></td>
        <td><a href="?uuid={{ container.uuid }}">{{ container.id }}</a></td>
       </tr>

       <tr>
        <td><b>Image</b></td>
        <td>{{ container.image }}</td>
       </tr>

       <tr>
        <td><b>Type</b></td>
        <td>{{ container.type }}</td>
       </tr>

       <tr>
        <td><b>Owner</b></td>
        <td>Platform</td>
       </tr>

       <tr>
        <td><b>Registry</b></td>
        <td>{{ container.registry }}</td>
       </tr>

       <tr>
        <td><b>Service port(s)</b></td>
        <td>{{ container.service_ports}}</td>
       </tr>

      </table>
      <br />
      {% endfor %}


      {% for container in data.user_containers %}
      <table class="dashboard">

       <tr>
        <td><b>ID</b></td>
        <td><a href="?uuid={{ container.uuid }}">{{ container.id }}</a></td>
       </tr>

       <tr>
        <td><b>Image</b></td>
        <td>{{ container.image }}</td>
       </tr>

       <tr>
        <td><b>Type</b></td>
        <td>{{ container.type }}</td>
       </tr>

       <tr>
        <td><b>Owner</b></td>
        <td>{{container.user}}</td>
       </tr>

       <tr>
        <td><b>Registry</b></td>
        <td>{{ container.registry }}</td>
       </tr>

       <tr>
        <td><b>Service port(s)</b></td>
        <td>{{ container.service_ports}}</td>
       </tr>

       <tr>
        <td><b>Operations</b></td>
        <td><a href="?action=delete&uuid={{ container.uuid }}">Delete</a></td>
       </tr>

      </table>
      <br />
      {% endfor %}    
      
      <br />
      <a href="/add_container">Add new...</a>
      
      {% endif %}
      <br />
      <br />
      <br />
      <br />

    </div>
  </div>
</div>

{% include "footer.html" %}





