app/soc/templates/soc/program/allocation/allocation.html
author Sverre Rabbelier <srabbelier@gmail.com>
Sun, 08 Mar 2009 14:38:24 +0000
changeset 1747 02f15a955c42
parent 1734 c9ecc7449632
child 2136 5d55e61dd338
permissions -rw-r--r--
Provide the 'return_url' in the allocate slots view This url can then be used to post and receive JSON data from. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1734
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
{% extends "soc/models/list.html" %}
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     3
{% block scripts %}
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
{{ block.super }}
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
<script type="text/javascript">
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
  var MAX_AVAILABLE_SLOTS = {{ total_slots }};
1747
02f15a955c42 Provide the 'return_url' in the allocate slots view
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1734
diff changeset
     8
  var RETURN_URL = "{{ return_url }}";
1734
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
  $(document).ready(function(){
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
    $('[id^=id_spin_slot_count_]').spin({min:0, max:MAX_AVAILABLE_SLOTS});
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
    $('[id^=id_spin_adjustment_count_]').spin();
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
    $(tooltip).purr({usingTransparentPNG: true, isSticky: true});
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
    $("#p_total_slots").html("<strong>Max slots:</strong> "+MAX_AVAILABLE_SLOTS);
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
    retrieveJSON();
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
  });
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
</script>
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    17
{% endblock %}
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
{% block body %}
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
<input type="button" class="button" onclick="javascript:reCalculate()" value="Recalculate slots" />
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
{{ block.super }}
c9ecc7449632 Add a slot allocation script and template
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
{% endblock %}