footer.tpl 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <footer{% block footer_open_attributes %}{% endblock footer_open_attributes %}>
  2. <!-- start of #footer section -->
  3. <div class="container">
  4. <div class="row">
  5. <div id="footer_left" class="col-md-4">
  6. {% if session_teachers is not null %}
  7. <div id="session_teachers">
  8. {{ session_teachers }}
  9. </div>
  10. {% endif %}
  11. {% if teachers is not null %}
  12. <div id="teachers">
  13. {{ teachers }}
  14. </div>
  15. {% endif %}
  16. {# Plugins for footer section #}
  17. {% if plugin_footer_left is not null %}
  18. <div id="plugin_footer_left">
  19. {{ plugin_footer_left }}
  20. </div>
  21. {% endif %}
  22. &nbsp;
  23. </div>
  24. <div id="footer_center" class="col-md-4">
  25. {# Plugins for footer section #}
  26. {% if plugin_footer_center is not null %}
  27. <div id="plugin_footer_center">
  28. {{ plugin_footer_center }}
  29. </div>
  30. {% endif %}
  31. &nbsp;
  32. </div>
  33. <div id="footer_right" class="col-md-4">
  34. {% if administrator_name is not null %}
  35. <div id="admin_name">
  36. {{ administrator_name }}
  37. </div>
  38. {% endif %}
  39. <div id="software_name">
  40. {{ "Platform"|get_lang }} <a href="{{_p.web}}" target="_blank">{{_s.software_name}} {{_s.system_version}}</a>
  41. &copy; {{ "now"|date("Y") }}
  42. </div>
  43. {# Plugins for footer section #}
  44. {% if plugin_footer_right is not null %}
  45. <div id="plugin_footer_right">
  46. {{ plugin_footer_right }}
  47. </div>
  48. {% endif %}
  49. &nbsp;
  50. </div><!-- end of #footer_right -->
  51. </div><!-- end of #row -->
  52. </div><!-- end of #container -->
  53. </footer>
  54. {{ footer_extra_content }}
  55. {% raw %}
  56. <script>
  57. jQuery.fn.filterByText = function(textbox) {
  58. return this.each(function() {
  59. var select = this;
  60. var options = [];
  61. $(select).find('option').each(function() {
  62. options.push({value: $(this).val(), text: $(this).text()});
  63. });
  64. $(select).data('options', options);
  65. $(textbox).bind('change keyup', function() {
  66. var options = $(select).empty().data('options');
  67. var search = $.trim($(this).val());
  68. var regex = new RegExp(search,"gi");
  69. $.each(options, function(i) {
  70. var option = options[i];
  71. if(option.text.match(regex) !== null) {
  72. $(select).append(
  73. $('<option>').text(option.text).val(option.value)
  74. );
  75. }
  76. });
  77. });
  78. });
  79. };
  80. // Functions used in main/admin.
  81. var textarea = "";
  82. var max_char = 255;
  83. function maxCharForTextarea(obj) {
  84. num_characters = obj.value.length;
  85. if (num_characters > max_char){
  86. obj.value = textarea;
  87. } else {
  88. textarea = obj.value;
  89. }
  90. }
  91. function moveItem(origin , destination) {
  92. for(var i = 0 ; i<origin.options.length ; i++) {
  93. if(origin.options[i].selected) {
  94. destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
  95. origin.options[i]=null;
  96. i = i-1;
  97. }
  98. }
  99. destination.selectedIndex = -1;
  100. sortOptions(destination.options);
  101. }
  102. function sortOptions(options) {
  103. newOptions = new Array();
  104. for (i = 0 ; i<options.length ; i++)
  105. newOptions[i] = options[i];
  106. newOptions = newOptions.sort(mysort);
  107. options.length = 0;
  108. for(i = 0 ; i < newOptions.length ; i++)
  109. options[i] = newOptions[i];
  110. }
  111. function mysort(a, b) {
  112. if(a.text.toLowerCase() > b.text.toLowerCase()){
  113. return 1;
  114. }
  115. if(a.text.toLowerCase() < b.text.toLowerCase()){
  116. return -1;
  117. }
  118. return 0;
  119. }
  120. // Global loading for ajax calls.
  121. $(document).bind("ajaxSend", function(){
  122. $("#loading_block").show();
  123. }).bind("ajaxComplete", function(){
  124. $("#loading_block").hide();
  125. });
  126. $("form").on("click", ' .advanced_parameters', function() {
  127. var id = $(this).attr('id') + '_options';
  128. var button = $(this);
  129. $("#"+id).toggle(function() {
  130. button.toggleClass('active');
  131. });
  132. });
  133. /** Makes row highlighting possible */
  134. $(document).ready( function() {
  135. /**
  136. * Advanced options
  137. * Usage
  138. * <a id="link" href="url">Advanced</a>
  139. * <div id="link_options" style="display:none">
  140. * hidden content :)
  141. * </div>
  142. * */
  143. $(".advanced_options").on("click", function() {
  144. var id = $(this).attr('id') + '_options';
  145. var button = $(this);
  146. $("#"+id).toggle(function() {
  147. button.toggleClass('active');
  148. });
  149. });
  150. $(".advanced_options_open").on("click", function() {
  151. var id = $(this).attr('rel');
  152. $("#"+id).show();
  153. });
  154. $(".advanced_options_close").on("click", function() {
  155. var id = $(this).attr('rel');
  156. $("#"+id).hide();
  157. });
  158. $(function() {
  159. $('a').tooltip({
  160. placement: 'right',
  161. show: 500,
  162. hide: 500
  163. });
  164. });
  165. $('.advanced_parameters').addClass('btn-default');
  166. //$('.btn').addClass('btn-default');
  167. // Chosen select.
  168. $(".chzn-select").chosen({
  169. disable_search_threshold: 10
  170. });
  171. // Adv multiselect text inputs.
  172. $('.select_class_filter').each(function(){
  173. var inputId = $(this).attr('id');
  174. inputId = inputId.replace('f-', '');
  175. inputId = inputId.replace('-filter', '');
  176. $("#"+ inputId+"-f").filterByText($("#f-"+inputId+"-filter"));
  177. $("#"+ inputId+"-t").filterByText($("#t-"+inputId+"-filter"));
  178. });
  179. // Table highlight.
  180. $("form .data_table input:checkbox").click(function() {
  181. if ($(this).is(":checked")) {
  182. $(this).parentsUntil("tr").parent().addClass("row_selected");
  183. } else {
  184. $(this).parentsUntil("tr").parent().removeClass("row_selected");
  185. }
  186. });
  187. /* For non HTML5 browsers */
  188. if ($("#formLogin".length > 1)) {
  189. $("input[name=login]").focus();
  190. }
  191. /* For IOS users */
  192. $('.autocapitalize_off').attr('autocapitalize', 'off');
  193. //Tool tip (in exercises)
  194. var tip_options = {
  195. placement : 'right'
  196. }
  197. $('.boot-tooltip').tooltip(tip_options);
  198. });
  199. </script>
  200. {% endraw %}
  201. {{ execution_stats }}