footer.tpl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <footer{% block footer_open_attributes %}{% endblock footer_open_attributes %}> <!-- start of #footer section -->
  2. <div class="container">
  3. <div class="row">
  4. <div id="footer_left" class="span4">
  5. {% if session_teachers is not null %}
  6. <div id="session_teachers">
  7. {{ session_teachers }}
  8. </div>
  9. {% endif %}
  10. {% if teachers is not null %}
  11. <div id="teachers">
  12. {{ teachers }}
  13. </div>
  14. {% endif %}
  15. {# Plugins for footer section #}
  16. {% if plugin_footer_left is not null %}
  17. <div id="plugin_footer_left">
  18. {{ plugin_footer_left }}
  19. </div>
  20. {% endif %}
  21. &nbsp;
  22. </div>
  23. <div id="footer_center" class="span4">
  24. {# Plugins for footer section #}
  25. {% if plugin_footer_center is not null %}
  26. <div id="plugin_footer_center">
  27. {{ plugin_footer_center }}
  28. </div>
  29. {% endif %}
  30. &nbsp;
  31. </div>
  32. <div id="footer_right" class="span4">
  33. {% if administrator_name is not null %}
  34. <div id="admin_name">
  35. {{ administrator_name }}
  36. </div>
  37. {% endif %}
  38. <div id="software_name">
  39. </div>
  40. {# Plugins for footer section #}
  41. {% if plugin_footer_right is not null %}
  42. <div id="plugin_footer_right">
  43. {{ plugin_footer_right }}
  44. </div>
  45. {% endif %}
  46. &nbsp;
  47. </div><!-- end of #footer_right -->
  48. </div><!-- end of #row -->
  49. </div><!-- end of #container -->
  50. </footer>
  51. {{ footer_extra_content }}
  52. {% raw %}
  53. <script>
  54. jQuery.fn.filterByText = function(textbox) {
  55. return this.each(function() {
  56. var select = this;
  57. var options = [];
  58. $(select).find('option').each(function() {
  59. options.push({value: $(this).val(), text: $(this).text()});
  60. });
  61. $(select).data('options', options);
  62. $(textbox).bind('change keyup', function() {
  63. var options = $(select).empty().data('options');
  64. var search = $.trim($(this).val());
  65. var regex = new RegExp(search,"gi");
  66. $.each(options, function(i) {
  67. var option = options[i];
  68. if(option.text.match(regex) !== null) {
  69. $(select).append(
  70. $('<option>').text(option.text).val(option.value)
  71. );
  72. }
  73. });
  74. });
  75. });
  76. };
  77. // Functions used in main/admin.
  78. var textarea = "";
  79. var max_char = 255;
  80. function maxCharForTextarea(obj) {
  81. num_characters = obj.value.length;
  82. if (num_characters > max_char){
  83. obj.value = textarea;
  84. } else {
  85. textarea = obj.value;
  86. }
  87. }
  88. function moveItem(origin , destination) {
  89. for(var i = 0 ; i<origin.options.length ; i++) {
  90. if(origin.options[i].selected) {
  91. destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
  92. origin.options[i]=null;
  93. i = i-1;
  94. }
  95. }
  96. destination.selectedIndex = -1;
  97. sortOptions(destination.options);
  98. }
  99. function sortOptions(options) {
  100. newOptions = new Array();
  101. for (i = 0 ; i<options.length ; i++)
  102. newOptions[i] = options[i];
  103. newOptions = newOptions.sort(mysort);
  104. options.length = 0;
  105. for(i = 0 ; i < newOptions.length ; i++)
  106. options[i] = newOptions[i];
  107. }
  108. function mysort(a, b) {
  109. if(a.text.toLowerCase() > b.text.toLowerCase()){
  110. return 1;
  111. }
  112. if(a.text.toLowerCase() < b.text.toLowerCase()){
  113. return -1;
  114. }
  115. return 0;
  116. }
  117. $("form").on("click", '.advanced_parameters', function() {
  118. var id = $(this).attr('id') + '_options';
  119. var button = $(this);
  120. $("#"+id).toggle(function() {
  121. button.toggleClass('disabled');
  122. });
  123. });
  124. /** Makes row highlighting possible */
  125. $(document).ready( function() {
  126. // Chosen select.
  127. $(".chzn-select").chosen({
  128. disable_search_threshold: 10
  129. });
  130. // Adv multiselect text inputs.
  131. $('.select_class_filter').each(function(){
  132. var inputId = $(this).attr('id');
  133. inputId = inputId.replace('f-', '');
  134. inputId = inputId.replace('-filter', '');
  135. $("#"+ inputId+"-f").filterByText($("#f-"+inputId+"-filter"));
  136. $("#"+ inputId+"-t").filterByText($("#t-"+inputId+"-filter"));
  137. });
  138. // Table highlight.
  139. $("form .data_table input:checkbox").click(function() {
  140. if ($(this).is(":checked")) {
  141. $(this).parentsUntil("tr").parent().addClass("row_selected");
  142. } else {
  143. $(this).parentsUntil("tr").parent().removeClass("row_selected");
  144. }
  145. });
  146. /* For non HTML5 browsers */
  147. if ($("#formLogin".length > 1)) {
  148. $("input[name=login]").focus();
  149. }
  150. /* For IOS users */
  151. $('.autocapitalize_off').attr('autocapitalize', 'off');
  152. //Tool tip (in exercises)
  153. var tip_options = {
  154. placement : 'right'
  155. }
  156. $('.boot-tooltip').tooltip(tip_options);
  157. });
  158. </script>
  159. {% endraw %}
  160. {{ execution_stats }}