{% 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>New Task</h1> 
      <hr>

      {% if not data.created %}

          <h3>Choose a name and a type for your new Task.</h3> 
          
          <br/>
          
          <form action="/create_task/" method="POST">
          {% csrf_token %}

          <table class="dashboard" style="max-width:700px">
    
           <tr>
            <td><b>Task name </b></td>
            <td>
             <input type="text" name="task_name" value="" placeholder="" size="23" required />
            </td>
           </tr>

           <!--
           <tr>
            <td><b>Task user</b></td>
            <td>
             <input type="text" name="name" value="" placeholder="metauser" size="23" disabled />
            </td>
           </tr>-->
           
           <!--<tr>
            <td><b>Task password</b></td>
            <td>
             <input type="password" name="password" value="" placeholder="" size="23" disabled />
            </td>
           </tr> -->

           <tr>
            <td><b>Task container</b></td><td>
              <select name="task_container_uuid" >
              <!-- <option value="metadesktop" selected>Meta Desktop</option>
              <option value="astroccok">Astrocook</option>
              <option value="gadgetviewer">Gadget Viewer</option> -->
              {% for container in data.platform_containers %}
              <option value="{{container.uuid}}">{{container.image}} ({{container.type}})</option> -->
              {% endfor %}
              {% for container in data.user_containers %}
              <option value="{{container.uuid}}">{{container.image}} ({{container.type}})</option> -->
              {% endfor %}              
              
              </select>
              &nbsp; | <a href="/add_container">Add new...</a>          
            </td>
           </tr>
           
           <tr>
            <td><b>Computing resource</b></td><td>
              <select name="task_computing" >
              <option value="local" selected>Local</option>
              <option value="demoremote">Demo remote</option>
              <option value="demoslurm">Demo Slurm cluster</option>
              </select>
              &nbsp; | <a href="/add_computing">Add new...</a>
            </td>
           </tr>

           <!-- <tr>
            <td><b>Run using</b></td><td>
              <select name="run_using" >
              <option value="docker" selected>Docker</option>
              <option value="singularity">Singularity</option>
              </select>
            </td>
           </tr>  -->
                     
           <tr><td colspan=2>
           <table><tr><td  style="border: 1px solid lightgray;" >
           I understand that files saved or modified in this container, if not explicitly saved to a persistent storage, will be LOST when the task ends.
           </td><td  style="border: 1px solid lightgray;" >
           <input class="form-check-input" type="checkbox" value="" id="invalidCheck" required>
           </td></table>
           </td></tr>
           <tr>
           <td colspan=2 align=center style="padding:20px">
           <input type="submit" value="Create">
           </td>
           </tr>
          </table>
          </form>

          <br/>          
          <br/>
          <br/>
          <br/>
          <br/>
          <br/>
          <br/>
          <br/>
          <br/>
          



 
      {% else %}
        Ok, task created. Go back to your <a href="/tasks">task list</a>.
        

      {% endif %} 
  
      <br/>
      <br/>
      <br/>
      <br/>
      <br/>
      <br/>
      
    </div>
  </div>
</div>

{% include "footer.html" %}






