app/soc/templates/soc/program/show_duplicates.html
changeset 2004 4d9e41c947fd
parent 1830 b2b638076e90
child 2034 59de158c936d
equal deleted inserted replaced
2003:ed24a0bd19d9 2004:4d9e41c947fd
    17 {% block header_title %}
    17 {% block header_title %}
    18 {{ page_name }}
    18 {{ page_name }}
    19 {% endblock %}
    19 {% endblock %}
    20 
    20 
    21 {% block body %}
    21 {% block body %}
    22 {{ info }} <br/>
    22 <script language="javascript" type="text/javascript">
    23 {{ duplicate_cache_content }}
    23   // variables from python context to get eventual cache
       
    24   // number of orgs, offset and url for querying the apps
       
    25   var infos = {{ info|safe }};
       
    26   var cache = {{ duplicate_cache_content|safe }};
       
    27   var offset_length = {{ offset_length }};
       
    28   var number_of_orgs = infos.nr_of_orgs;
       
    29   var url_to_query = infos.program_key;
       
    30   // this global variable will contain the html to output
       
    31   var html_string = '';
       
    32   $(document).ready(function(){
       
    33     // Initialize the progress bar
       
    34     $("#duplicates_progress_bar").progressBar({showText: false});
       
    35     // if there's data in the cache
       
    36     if (cache.data!=undefined) {
       
    37       // then the button will show "recalculate" instead of "calculate"
       
    38       $("#id_button_duplicate_slots").val("Recalculate");
       
    39       // and then we will show the html based on the cache
       
    40       for (var student_key in cache.data.students) {
       
    41         duplicateSlots.showDuplicatesHtml(cache.data.orgs,cache.data.students[student_key],student_key,cache.data.students[student_key].proposals);
       
    42       }
       
    43       // if there's no data in the cache, tell the user
       
    44       if (html_string=="") {
       
    45         $("#div_duplicate_slots").html("<strong>No duplicate slot assignments found</strong>");
       
    46       }
       
    47     }
       
    48     // else if there's no data in the cache
       
    49     else {
       
    50       // then the button will show "calculate"
       
    51       $("#id_button_duplicate_slots").val("Calculate");
       
    52     }
       
    53   });
       
    54 </script>
       
    55 <input type="button" id="id_button_duplicate_slots" onclick="javascript:duplicateSlots.showDuplicatesInit();" class="button" />
       
    56 <span class="progressBar" style="display:none;" id="duplicates_progress_bar"></span>
       
    57 <span id="description_progressbar"></span><span id="description_done"></span>
       
    58 
       
    59 <br /><br />
       
    60 <div id="div_duplicate_slots"></div>
    24 {% endblock %}
    61 {% endblock %}