{% extends "layout.html" %}
{% block title %}Update your account{% endblock %}
{% block head %}
  {{ super() }}
  <script src="{{ url_for('static', filename='js/scripts/account.js') }}" type="text/javascript" charset="utf-8"></script>
  <link href="{{ url_for('static', filename='css/jqueryTabs.css', _external=False) }}" rel="stylesheet" type="text/css" media="screen" />
  <script src="{{ url_for('static', filename='js/jquery/jqueryTabs.js') }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}
{% block body %}
<h2>Web runner parameters</h2><br/>
<div id="tabContainer">
  <ul>
    <li><a href="#tab1" class="active">Your personal information</a></li>
    {% if params %}
    <li><a href="#tab2">Build & Run configuration</a></li>
    <li><a href="#tab3">Add user</a></li>
    {% endif %}
  </ul><!-- //Tab buttons -->
  <div class="tabDetails">
    <div id="tab1" class="tabContents">
      <form class="account">
        <div class='form'>
          <label for="name">Your name: </label>
          <input type='text' name='name' id='name' value='{{name}}'/>
          <div class='clear'></div>
          <label for="email">Your email address: </label>
          <input type='text' name='email' id='email' value='{{email}}'/>
          <div class='clear'></div>
          <label for="username">User name: </label>
          <input type='text' name='username' id='username' value='{{username}}'/>
          <div class='clear'></div>
          <label for="password">Password: </label>
          <input type='password' name='password' id='password' value=''/>
          <div class='clear'></div>
          <label for="cpassword">Confirm Password: </label>
          <input type='password' name='cpassword' id='cpassword' value=''/>
          <div class='clear'></div>
          <br/>
          <label for="rcode">Password Recovery code:</label>
          <input type='password' name='rcode' id='rcode' value=''/>
          <span class="information"><a href="#" id="information" rel="tooltip">help ?</a></span>
          <div class='clear'></div>
          <br/>
          <label></label>
          <input type="submit" name="update" id ="update" value="Update Account" class="button"/>
          <div class='clear'></div>
        </div>
        <input type="hidden" name="hasAccount" id="hasAccount" value="{{name}}"/>
      </form>
    </div>
    {% if params %}
    <div id="tab2" class="tabContents">
      <form class="slapgrid">
        <div class='form'>
          <h2>Which one do you want to run ?</h2>
          <label for="run_software">Build :</label>
          <input type='checkbox' name='run_software' id='run_software' value='run_software' {% if params.run_software -%}checked{% endif %}>
          <div class='clear'></div>
          <label for="run_instance">Run :</label>
          <input type='checkbox' name='run_instance' id='run_instance' value='run_instance' {% if params.run_instance -%}checked{% endif %}>
          <div class='clear'></div>
          <h2>How many tries ?</h2>
          <label for="max_run_software">Max times for Build :</label>
          <input type='text' name='max_run_software' id='max_run_software' value="{{params.max_run_software}}">
          <div class='clear'></div>
          <label for="max_run_instance">Max times for Run :</label>
          <input type='text' name='max_run_instance' id='max_run_instance' value="{{params.max_run_instance}}">
          <div class='clear'></div>
          <br/>
          <label></label>
          <input type="submit" name="save" id ="save" value="Save config" class="button"/>
          <div class='clear'></div>
        </div>
      </form>
    </div>
    <div id="tab3" class="tabContents">
      <form class="slapgrid">
        <div class='form'>
          <label for="username">New user name :</label>
          <input type='text' name='username' id='new_username'/>
          <div class='clear'></div>
          <label for="password">New password :</label>
          <input type='password' name='password' id='new_password'/>
          <div class='clear'></div>
          <label for="new_rcode">Password Recovery code:</label>
          <input type='password' name='new_rcode' id='new_rcode' value=''/>
          <span class="information"><a href="#" id="information" rel="tooltip">help ?</a></span>
          <div class='clear'></div>
          <br/>
          <label></label>
          <input type="submit" name="add_user" id="add_user" value="Add new user" class="button"/>
          <div class='clear'></div>
        </div>
      </form>
    </div>
    {% endif %}
</div>
</div>
{% if username %}<div id="file_info" class="file_info">leave passwords blank to preserve your current password...
  </div><br/>{%endif%}
<div id="tooltip-information" style="display:none; float:left">
  <p style="font-size:12px;">
  Please find this information in your slaprunner<br/> connection informations.
  </p>
</div>
{% endblock %}
