view.tpl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <div id="learning_path_main" class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }} {{ lp_mode == 'embedframe' ? 'lp-view-collapsed' }}">
  2. <div id="learning_path_left_zone" class="sidebar-scorm">
  3. <div class="lp-view-zone-container">
  4. <div id="scorm-info">
  5. <div id="panel-scorm" class="panel-body">
  6. <div class="image-avatar">
  7. {% if lp_author == '' %}
  8. <div class="text-center">
  9. {{ lp_preview_image }}
  10. </div>
  11. {% else %}
  12. <div class="media">
  13. <div class="media-left">
  14. {{ lp_preview_image }}
  15. </div>
  16. <div class="media-body">
  17. <div class="description-autor"> {{ lp_author }} </div>
  18. </div>
  19. </div>
  20. {% endif %}
  21. </div>
  22. {% if show_audio_player %}
  23. <div id="lp_media_file" class="audio-scorm">
  24. {{ media_player }}
  25. </div>
  26. {% endif %}
  27. {% if gamification_mode == 1 %}
  28. <!--- gamification -->
  29. <div id="scorm-gamification">
  30. <div class="row">
  31. <div class="col-xs-6">
  32. {% if gamification_stars > 0 %}
  33. {% for i in 1..gamification_stars %}
  34. <em class="fa fa-star level"></em>
  35. {% endfor %}
  36. {% endif %}
  37. {% if gamification_stars < 4 %}
  38. {% for i in 1..4 - gamification_stars %}
  39. <em class="fa fa-star"></em>
  40. {% endfor %}
  41. {% endif %}
  42. </div>
  43. <div class="col-xs-6 text-right">
  44. {{ "XPoints"|get_lang|format(gamification_points) }}
  45. </div>
  46. </div>
  47. <div class="row">
  48. <div class="col-xs-12 navegation-bar">
  49. <div id="progress_bar">
  50. {{ progress_bar }}
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <!--- end gamification -->
  56. {% else %}
  57. <div id="progress_bar">
  58. {{ progress_bar }}
  59. </div>
  60. {% endif %}
  61. {{ teacher_toc_buttons }}
  62. </div>
  63. </div>
  64. {# TOC layout #}
  65. <div id="toc_id" class="scorm-body" name="toc_name">
  66. {% include template ~ '/learnpath/scorm_list.tpl' %}
  67. </div>
  68. {# end TOC layout #}
  69. </div>
  70. </div>
  71. {# end left zone #}
  72. <div id="lp_navigation_elem" class="navegation-bar">
  73. <a href="#" title = "{{ 'Expand'|get_lang }}" id="lp-view-expand-toggle" class="icon-toolbar expand" role="button">
  74. {% if lp_mode == 'embedframe' %}
  75. <span class="fa fa-compress" aria-hidden="true"></span>
  76. <span class="sr-only">{{ 'Expand'|get_lang }}</span>
  77. {% else %}
  78. <span class="fa fa-expand" aria-hidden="true"></span>
  79. <span class="sr-only">{{ 'Expand'|get_lang }}</span>
  80. {% endif %}
  81. </a>
  82. <a id="home-course" title = "{{ 'Home'|get_lang }}" href="{{ button_home_url }}" class="icon-toolbar" target="_self" onclick="javascript: window.parent.API.save_asset();">
  83. <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
  84. </a>
  85. {{ navigation_bar }}
  86. </div>
  87. {# <div id="hide_bar" class="scorm-toggle" style="display:inline-block; width: 25px; height: 1000px;"></div> #}
  88. {# right zone #}
  89. <div id="learning_path_right_zone" class="content-scorm">
  90. <div class="lp-view-zone-container">
  91. <div class="lp-view-tabs">
  92. <div id="navTabsbar" class="nav-tabs-bar">
  93. <ul id="navTabs" class="nav nav-tabs" role="tablist">
  94. <li role="presentation" class="active">
  95. <a href="#lp-view-content" title="{{ 'Lesson'|get_lang }}" aria-controls="lp-view-content" role="tab" data-toggle="tab">
  96. <span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Lesson'|get_lang }}</span>
  97. </a>
  98. </li>
  99. <li role="presentation">
  100. <a href="#lp-view-forum" title="{{ 'Forum'|get_lang }}" aria-controls="lp-view-forum" role="tab" data-toggle="tab">
  101. <span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Forum'|get_lang }}</span>
  102. </a>
  103. </li>
  104. </ul>
  105. </div>
  106. <div class="tab-content">
  107. <div role="tabpanel" class="tab-pane active" id="lp-view-content">
  108. <div id="wrapper-iframe" style="width:100%; height:100%">
  109. {% if lp_mode == 'fullscreen' %}
  110. <iframe id="content_id_blank" name="content_name_blank" src="blank.php" style="width:100%; height:100%" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
  111. {% else %}
  112. <iframe id="content_id" name="content_name" src="{{ iframe_src }}" style="width:100%; height:100%" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
  113. {% endif %}
  114. </div>
  115. </div>
  116. <div role="tabpanel" class="tab-pane" id="lp-view-forum">
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. {# end right Zone #}
  123. </div>
  124. <script>
  125. (function () {
  126. var LPViewUtils = {
  127. setHeightLPToc: function () {
  128. var scormInfoHeight = $('#scorm-info').outerHeight(true);
  129. $('#learning_path_toc').css({
  130. top: scormInfoHeight
  131. });
  132. }
  133. };
  134. $(document).on('ready', function () {
  135. if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
  136. document.getElementById('wrapper-iframe')
  137. .setAttribute(
  138. 'style',
  139. 'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;'
  140. );
  141. }
  142. {% if lp_mode == 'embedframe' %}
  143. //$('#learning_path_main').addClass('lp-view-collapsed');
  144. $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
  145. e.preventDefault();
  146. $('#learning_path_main').toggleClass('lp-view-collapsed');
  147. $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
  148. $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
  149. var className = $('#lp-view-expand-toggle span.fa').attr('class');
  150. if (className == 'fa fa-expand') {
  151. $(this).attr('title', '{{ "Expand" | get_lang }}');
  152. } else {
  153. $(this).attr('title', '{{ "Collapse" | get_lang }}');
  154. }
  155. if($('#navTabsbar').is(':hidden')){
  156. $('#navTabsbar').show();
  157. } else {
  158. $('#navTabsbar').hide();
  159. }
  160. });
  161. {% else %}
  162. $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
  163. e.preventDefault();
  164. $('#learning_path_main').toggleClass('lp-view-collapsed');
  165. $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
  166. $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
  167. var className = $('#lp-view-expand-toggle span.fa').attr('class');
  168. if (className == 'fa fa-expand') {
  169. $(this).attr('title', '{{ "Expand" | get_lang }}');
  170. } else {
  171. $(this).attr('title', '{{ "Collapse" | get_lang }}');
  172. }
  173. if($('#navTabsbar').is(':hidden')){
  174. $('#navTabsbar').show();
  175. } else {
  176. $('#navTabsbar').hide();
  177. }
  178. });
  179. {% endif %}
  180. $('.lp-view-tabs').on('click', '.disabled', function (e) {
  181. e.preventDefault();
  182. });
  183. $('a#ui-option').on('click', function (e) {
  184. e.preventDefault();
  185. var icon = $(this).children('.fa');
  186. if (icon.is('.fa-chevron-up')) {
  187. icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
  188. return;
  189. }
  190. icon.removeClass('fa-chevron-down').addClass('fa-chevron-up');
  191. });
  192. LPViewUtils.setHeightLPToc();
  193. $('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
  194. $('.lp-view-tabs').animate({opacity: 0}, 500);
  195. });
  196. $('#learning_path_right_zone #lp-view-content iframe').on('load', function () {
  197. $('.lp-view-tabs a[href="#lp-view-content"]').tab('show');
  198. $('.lp-view-tabs').animate({opacity: 1}, 500);
  199. });
  200. loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
  201. checkCurrentItemPosition({{ lp_current_item_id }});
  202. {% if glossary_extra_tools in glossary_tool_availables %}
  203. // Loads the glossary library.
  204. (function () {
  205. {% if show_glossary_in_documents == 'ismanual' %}
  206. $.frameReady(
  207. function(){
  208. // $("<div>I am a div courses</div>").prependTo("body");
  209. },
  210. "top.content_name",
  211. {
  212. load: [
  213. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
  214. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  215. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  216. { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
  217. {{ fix_link }}
  218. ]
  219. }
  220. );
  221. {% elseif show_glossary_in_documents == 'isautomatic' %}
  222. $.frameReady(
  223. function(){
  224. // $("<div>I am a div courses</div>").prependTo("body");
  225. },
  226. "top.content_name",
  227. {
  228. load: [
  229. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
  230. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  231. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  232. { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
  233. {{ fix_link }}
  234. ]
  235. }
  236. );
  237. {% elseif fix_link != '' %}
  238. $.frameReady(
  239. function(){
  240. // $("<div>I am a div courses</div>").prependTo("body");
  241. },
  242. "top.content_name",
  243. {
  244. load: [
  245. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
  246. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  247. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  248. {{ fix_link }}
  249. ]
  250. }
  251. );
  252. {% endif %}
  253. })();
  254. {% endif %}
  255. $('iframe#content_id')
  256. .on('load', function () {
  257. $.frameReady(function () {
  258. }, 'top.content_name', {
  259. load: [
  260. {type: 'script', id: '_fr1', src: '{{ _p.web }}web/assets/jquery/dist/jquery.min.js'},
  261. {type: 'script', id: '_fr7', src: '{{ _p.web }}web/assets/MathJax/MathJax.js?config=AM_HTMLorMML'},
  262. {type: 'script', id: '_fr4', src: '{{ _p.web }}web/assets/jquery-ui/jquery-ui.min.js'},
  263. {type: 'stylesheet', id: '_fr5', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'},
  264. {type: 'stylesheet', id: '_fr6', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'},
  265. {type: 'script', id: '_fr2', src: '{{ _p.web_lib }}javascript/jquery.highlight.js'},
  266. {type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php'}
  267. ]
  268. });
  269. });
  270. });
  271. $(window).on('resize', function () {
  272. LPViewUtils.setHeightLPToc();
  273. });
  274. })();
  275. </script>