footer.tpl 5.6 KB

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