{% extends "horizon/jasmine/jasmine.html" %}

{% block source %}
<!-- Instead include all "horizon/_scripts.html" -->
  {% include "horizon/_script_i18n.html" %}

  <script src="{{ STATIC_URL }}bootstrap/js/bootstrap.js"></script>
  <script src="{{ STATIC_URL }}horizon/lib/jquery/jquery.tablesorter.js"></script>
  <script src="{{ STATIC_URL }}horizon/lib/hogan.js"></script>
  <script src='{{ STATIC_URL }}horizon/lib/jsencrypt/jsencrypt.js'></script>
  <script src="{{ STATIC_URL }}horizon/js/horizon.templates.js"></script>
  <script src="{{ STATIC_URL }}horizon/js/horizon.instances.js"></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.tabs.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.forms.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.formset_table.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.messages.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.modals.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.tables.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.quota.js'></script>
  <script src='{{ STATIC_URL }}horizon/js/horizon.string.js'></script>

  {% include "horizon/client_side/templates.html" %}

  <script>
    // Call init on DOM ready.
    $(document).ready(horizon.init);
  </script>
  <!-- The end -->
{% endblock %}

{% block spec %}
  <!-- test files -->
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/modals.legacy-spec.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/templates.legacy-spec.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/tables.legacy-spec.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/instances.legacy-spec.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/messages.legacy-spec.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/quota.legacy-spec.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}horizon/tests/jasmine/string.legacy-spec.js"></script>
{% endblock %}

{% block content %}
    <div id="jasmine-fixture">
      <!-- Test markup; will be hidden. -->
      <div id="main_content">
        <div class="messages"></div>
        <div id="modal_wrapper"></div>
      </div>

      <table id="table1" class="datatable">
        <tbody>
          <tr><td>cat1</td></tr>
          <tr><td>dog1</td></tr>
          <tr><td>cat2</td></tr>
          <tr><td>dog2</td></tr>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="1">
              <span class="table_count">Displaying 4 items</span>
            </td>
          </tr>
        </tfoot>
      </table>

      <table id="table2" class="datatable">
        <thead><tr><th><div class="table_filter" data-toggle="buttons-radio">
          <button name="cats" type="submit" value="cats" id="button_cats">Cats</button>
          <button name="dogs" type="submit" value="dogs" id="button_dogs">Dogs</button>
          <button name="big" type="submit" value="big" id="button_big">Big Animals</button>
        </div></th></tr></thead>
        <tbody>
          <tr class="category-cat"><td>cat1</td></tr>
          <tr class="category-big category-dog"  style="display: none"><td>dog1</td></tr>
          <tr class="category-big category-cat"  style="display: none"><td>cat2</td></tr>
          <tr class="category-dog"  style="display: none"><td>dog2</td></tr>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="1">
              <span class="table_count">Displaying 4 items</span>
            </td>
          </tr>
        </tfoot>
      </table>

      <div id="formset" class="table_wrapper">
          <input id="id_flavors-TOTAL_FORMS" name="flavors-TOTAL_FORMS"
          type="hidden" value="3"><input id="id_flavors-INITIAL_FORMS"
          name="flavors-INITIAL_FORMS" type="hidden" value="2"><input id=
          "id_flavors-MAX_NUM_FORMS" name="flavors-MAX_NUM_FORMS" type=
          "hidden" value="1000">

          <table id="flavors" class=
          "table table-bordered table-striped datatable">
            <thead>
              <tr class='table_caption'>
                <th class='table_header' colspan='8'>
                  <h3 class='table_title'>Flavors</h3>

                  <div class="table_actions clearfix"></div>
                </th>
              </tr>

              <tr>
                <th class="sortable normal_column"><span class=
                "required">Flavor Name</span></th>

                <th class="sortable normal_column"><span class=
                "required">VCPU</span></th>

                <th class="sortable normal_column"><span class=
                "required">RAM (MB)</span></th>

                <th class="sortable normal_column"><span class=
                "required">Root Disk (GB)</span></th>

                <th class="sortable normal_column"><span>Ephemeral Disk
                (GB)</span></th>

                <th class="sortable normal_column"><span>Swap Disk
                (MB)</span></th>

                <th class="sortable normal_column"><span>Max.
                VMs</span></th>

                <th class="sortable normal_column">
                <span>Delete</span></th>
              </tr>
            </thead>

            <tbody>
              <tr class="" data-display="yyy.1" id="flavors__row__14">
                <td class="sortable normal_column"><input class=
                "input input-small" id="id_flavors-0-name" maxlength="25"
                name="flavors-0-name" type="text" value="1"> <input id=
                "id_flavors-0-id" name="flavors-0-id" type="hidden"
                value="14"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-0-cpu" name=
                "flavors-0-cpu" type="number" value="1"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-0-memory" name=
                "flavors-0-memory" type="number" value="1"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-0-storage" name=
                "flavors-0-storage" type="number" value="1"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id=
                "id_flavors-0-ephemeral_disk" name=
                "flavors-0-ephemeral_disk" type="number"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-0-swap_disk"
                name="flavors-0-swap_disk" type="number"></td>

                <td class="sortable normal_column">-</td>

                <td class="sortable normal_column"><input id=
                "id_flavors-0-DELETE" name="flavors-0-DELETE" type=
                "checkbox"></td>
              </tr>

              <tr class="" data-display="yyy.2" id="flavors__row__15">
                <td class="sortable normal_column"><input class=
                "input input-small" id="id_flavors-1-name" maxlength="25"
                name="flavors-1-name" type="text" value="2"> <input id=
                "id_flavors-1-id" name="flavors-1-id" type="hidden"
                value="15"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-1-cpu" name=
                "flavors-1-cpu" type="number" value="2"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-1-memory" name=
                "flavors-1-memory" type="number" value="2"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-1-storage" name=
                "flavors-1-storage" type="number" value="2"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id=
                "id_flavors-1-ephemeral_disk" name=
                "flavors-1-ephemeral_disk" type="number"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-1-swap_disk"
                name="flavors-1-swap_disk" type="number"></td>

                <td class="sortable normal_column">-</td>

                <td class="sortable normal_column"><input id=
                "id_flavors-1-DELETE" name="flavors-1-DELETE" type=
                "checkbox"></td>
              </tr>

              <tr class="current_selected">
                <td class="sortable normal_column"><input class=
                "input input-small" id="id_flavors-2-name" maxlength="25"
                name="flavors-2-name" type="text"> <input id=
                "id_flavors-2-id" name="flavors-2-id" type="hidden"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-2-cpu" name=
                "flavors-2-cpu" type="number"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-2-memory" name=
                "flavors-2-memory" type="number"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-2-storage" name=
                "flavors-2-storage" type="number"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id=
                "id_flavors-2-ephemeral_disk" name=
                "flavors-2-ephemeral_disk" type="number"></td>

                <td class="sortable normal_column"><input class=
                "input number_input_slim" id="id_flavors-2-swap_disk"
                name="flavors-2-swap_disk" type="number"></td>

                <td class="sortable normal_column">-</td>

                <td class="sortable normal_column"><input id=
                "id_flavors-2-DELETE" name="flavors-2-DELETE" type=
                "checkbox"></td>
              </tr>
            </tbody>

            <tfoot>
              <tr>
                <td colspan="8"><span class="table_count">Displaying 3
                items</span></td>
              </tr>
            </tfoot>
          </table>
       </div>
    </div>
{% endblock %}
