view.tpl 15 KB

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