{% extends "pyfarm/user_interface/layout.html" %}
{% block title %}Software{% endblock %}
{% block software_nb_class %}active{% endblock %}
{% block content %}

<table class="table table-striped table-bordered" style="margin-top:20px;">
  <tr>
    <th></th>
    <th>
      Software
    </th>
    <th>
      Versions
    </th>
  </tr>
  {% for software_item in software %}
  <tr>
    <td>
      <form style="display: inline;" role="form" method="POST" action="{{ url_for('delete_single_software_ui', software_id=software_item.id) }}">
        <label for="delete-software-{{software_item.id}}-submit" class="clickable-icon" title="Delete software"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></label>
        <input id="delete-software-{{software_item.id}}-submit" type="submit" class="hidden" onclick="return confirm('Are you sure you want to delete this software?');"/>
      </form>
    </td>
    <td>
      <a href="{{ url_for('single_software_ui', software_id=software_item.id) }}">
        {{ software_item.software }}
      </a>
    </td>
    <td>
      {% for version in software_item.versions %}
      <nobr>{{ version.version }}</nobr>
      {% endfor %}
    </td>
  </tr>
  {% endfor %}
</table>

<form method="POST" action="{{ url_for('add_single_software_ui') }}" class="form-inline" role="form">
  <label for="software">Software</label>
  <input type="text" class="form-control" id="software" name="software" placeholder="Software"/>
  <input type="submit" class="btn" value="Add"/>
</form>
{% endblock %}
