view.tpl 16 KB

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