{% if details %}
<div style="float:left; width:500px; margin:10px; margin-bottom:20px">
  <table class="dashboard" style="width:100%">
    <tr>
      <td><b>Name</b></td>
      <td>{{ computing.name }}</td>
    </tr>
    <tr>
      <td><b>Description</b></td>
      <td>{{ computing.description }}</td>
    </tr>
    <tr>
      <td><b>Owner</b></td>
      <td>{% if computing.user %}{{ computing.user.email }}{% else %}Platform{% endif %}</td>
    </tr>
    <tr>
      <td><b>Group</b></td>
      <td>{{ computing.group }}</td>
    </tr>
    <tr>
      <td><b>Type</b></td>
      <td>{{ computing.type }}</td>
    </tr>
    <tr>
      <td><b>Access mode</b></td>
      <td>{{ computing.access_mode }}</td>
    </tr>
    <tr>
      <td><b>Auth mode</b></td>
      <td>{{ computing.auth_mode }}</td>
    </tr>
    <tr>
      <td><b>WMS</b></td>
      <td>{{ computing.wms }}</td>
    </tr>
    <tr>
      <td><b>Arch</b></td>
      <td>{{ computing.arch }}</td>
    </tr>
    <tr>
      <td><b>Container engines</b></td>
      <td>{{ computing.container_engines_json }}</td>
    </tr>
    <tr>
      <td><b>Supported archs</b></td>
      <td>{{ computing.supported_archs_json }}</td>
    </tr>
    <tr>
      <td><b>Emulated archs</b></td>
      <td>{{ computing.emulated_archs_json }}</td>
    </tr>
    <tr>
      <td><b>Storages</b></td>
      <td>
        {% if not computing.storages.all %}
          none
        {% else %}
          {% for storage in computing.storages.all %}
            {% if storage.bind_path %}
              {{ storage.name }} @ <code>{{ storage.bind_path }}</code><br/>
            {% endif %}
          {% endfor %}
        {% endif %}
      </td>
    </tr>
    {% if computing.user == data.user or data.user.is_staff %}
    <tr>
      <td><b>Conf</b></td>
      <td><pre style="font-size:0.9em">{{ computing.conf_json }}</pre></td>
    </tr>
    {% endif %}
    {% if computing.user == data.user or data.user.is_staff %}
    <tr>
      <td><b>Actions</b></td>
      <td>
        <a href="/edit_computing/?uuid={{ computing.uuid }}">Edit</a>
        &nbsp;|&nbsp;
        <a href="/computing/?action=delete&uuid={{ computing.uuid }}" onclick="return confirm('Are you sure you want to delete this computing resource?');">Delete</a>
        &nbsp;|&nbsp;
        <a href="/computing/?action=duplicate&uuid={{ computing.uuid }}" onclick="return confirm('Duplicate this computing resource?');">Duplicate</a>
      </td>
    </tr>
    {% endif %}
  </table>
</div>
{% else %}
{% load computing_helpers %}
{% is_computing_configured computing request.user as computing_configured %}
{# insert an "if false" here below to let unconfigured computing to show up with a greyed out "choose" button #}
{% if container and not computing_configured %}
{% else%}
<div style="width:300px; float:left; border: #e0e0e0 solid 1px; margin:10px; background:#f8f8f8; margin-bottom:15px;">
  <div style="padding:10px; margin-top:5px; text-align:center; border-bottom: #e0e0e0 solid 1px; ">
    <a href="/computing/?uuid={{ computing.uuid }}&details=True">{{ computing.name }}</a>
  </div>
  {% if not computing_configured %}
  <div style="width:298px; float:left; margin:0; margin-bottom:5px; padding:2px; background: gary; color:black; text-align:center; border-bottom: #e0e0e0 solid 1px;">
    <i class="fa fa-info-circle"></i> Not configured <!-- style="color:#337ab7" -->
  </div>
  {% endif %}
  <div style="padding:10px;">
    {% if computing.description %}
    <div class="description-box" title="{{ computing.description }}">
      {{ computing.description }}
    </div>
    {% else %}
    <br/>
    {% endif %}
    <div class="image-version-box">
      <b>Type:</b> {{ computing.type }} <font style="font-size:0.9em">({{ computing.arch }})</font>
      <br/>
      {% if computing.storages.all %}
      <b>Storages:</b>
      <br/>
      {% for storage in computing.storages.all %}
      {% if storage.bind_path %}
      &nbsp; {{  storage.name }} @ <code>{{  storage.bind_path }}</code><br/>
      {% endif %}
      {% endfor %}
      {% endif %}
      <!-- <b>Access:</b> {{ computing.access_mode }}<br/>
      <b>Owner:</b> {% if computing.user %}{{ computing.user }}{% else %}Platform{% endif %}<br/>
      <b>Engines:</b>
      {% for engine in computing.container_engines %}
      {{ engine | title }}
      {% if engine == 'docker' %}
      <img src="/static/img/docker-logo.svg" style="height:18px; width:18px; margin-bottom:2px" />
      {% elif engine == 'singularity' %}
      <img src="/static/img/singularity-logo.svg" style="height:18px; width:18px; margin-bottom:2px" />
      {% else %}
      {% endif %}
      {% endfor %}-->
    </div>
    {% if container %}
    <div style="margin:0px; margin-top:2px; text-align:center; padding:5px">
      {% if computing_configured %}
      <form action="/new_task/" method="POST">
      {% csrf_token %}
      <input type="hidden" name="step" value="{{ data.next_step }}" />
      <input type="hidden" name="task_container_uuid" value="{{container.uuid}}">
      <input type="hidden" name="task_container_arch" value="{{container_arch}}">
      <input type="hidden" name="task_computing_uuid" value="{{computing.uuid}}">
      <input type="submit" value="Choose" class="btn btn-connect">
      </form>
      {% else %}
      <input type="submit" value="Choose" class="btn btn-connect" disabled>
      {% endif %}
    </div>
    {% endif %}
  </div>
</div>
{% endif %}
{% endif %}
