{% 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:600px">
    
           <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_id" >
              <!-- <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.id}}">{{container.image}} (platform)</option> -->
              {% endfor %}
              {% for container in data.user_containers %}
              <option value="{{container.id}}">{{container.image}} (user)</option> -->
              {% endfor %}              
              
              </select>
              &nbsp; | <a href="/add_container">Add new...</a>          
            </td>
           </tr>
           
           <tr>
            <td><b>Computing resource</b></td><td>
              <select name="task_compute" >
              <option value="local" selected>Local</option>
              <option value="demoremote">Demo remote</option>
              <option value="demoslurm">Demo Slurm cluster</option>
              </select>
              &nbsp; | <a href="/add_compute">Add new...</a>
            </td>
           </tr>
                      
           <tr><td colspan=2>
           <table><tr><td  style="border: 1px solid lightgray;" >
           I understand that files saved or modified and not explicitly saved to a persistent share, including system packages, 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">tasks list</a>.
        

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

{% include "footer.html" %}






