view.tpl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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 'learnpath/scorm_list.tpl'|get_template %}
  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. $(function() {
  149. $('#scorm-panel .panel.higher .status-heading').on("click", function () {
  150. $(this).siblings().find(".panel-heading").removeClass("on");
  151. $(this).find(".panel-heading").toggleClass("on");
  152. });
  153. $('#scorm-panel .panel.lower .status-heading').on("click", function () {
  154. $(this).siblings().find(".panel-heading").removeClass("on");
  155. $(this).find(".panel-heading").toggleClass("on");
  156. });
  157. $('.section-list .list-item').click(function () {
  158. $(this).addClass('active').siblings().removeClass('active');
  159. });
  160. });
  161. </script>
  162. {% endif %}
  163. <script>
  164. var LPViewUtils = {
  165. setHeightLPToc: function () {
  166. var scormInfoHeight = $('#scorm-info').outerHeight(true);
  167. $('#learning_path_toc').css({
  168. top: scormInfoHeight
  169. });
  170. },
  171. groupToc: function () {
  172. $('[data-lp-id]:not([data-lp-parent])').each(function () {
  173. var $self = $(this),
  174. id = $self.data('lp-id') || 0;
  175. if (!id) {
  176. return;
  177. }
  178. $self.find('.panel-collapse .panel-body').append('<div id="scorm-panel-' + id + '" class="panel-parent">');
  179. });
  180. $('[data-lp-parent]').each(function () {
  181. var $panel = $(this),
  182. parentId = $panel.data('lp-parent') || 0,
  183. id = $panel.data('lp-id') || 0;
  184. if (!parentId) {
  185. return;
  186. }
  187. $panel.appendTo('#scorm-panel-' + parentId);
  188. if ($('#collapse-' + id).is('.in')) {
  189. $('#collapse-' + parentId).collapse('toggle');
  190. }
  191. });
  192. }
  193. };
  194. $(function() {
  195. {% if data_panel %}
  196. LPViewUtils.groupToc();
  197. {% endif %}
  198. if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
  199. $('#wrapper-iframe').css({
  200. 'overflow': 'auto',
  201. 'position': 'relative',
  202. '-webkit-overflow-scrolling': 'touch'
  203. });
  204. }
  205. {% if lp_mode == 'embedframe' %}
  206. //$('#learning_path_main').addClass('lp-view-collapsed');
  207. $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
  208. e.preventDefault();
  209. $('#learning_path_main').toggleClass('lp-view-collapsed');
  210. $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
  211. $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
  212. });
  213. {% else %}
  214. $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
  215. e.preventDefault();
  216. $('#learning_path_main').toggleClass('lp-view-collapsed');
  217. $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
  218. $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
  219. });
  220. {% endif %}
  221. $('.lp-view-tabs').on('click', '.disabled', function (e) {
  222. e.preventDefault();
  223. });
  224. $('a#ui-option').on('click', function (e) {
  225. e.preventDefault();
  226. var icon = $(this).children('.fa');
  227. if (icon.is('.fa-chevron-up')) {
  228. icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
  229. return;
  230. }
  231. icon.removeClass('fa-chevron-down').addClass('fa-chevron-up');
  232. });
  233. LPViewUtils.setHeightLPToc();
  234. $('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
  235. $('.lp-view-tabs').fadeOut();
  236. });
  237. $('#learning_path_right_zone #lp-view-content iframe').on('load', function () {
  238. $('.lp-view-tabs a[href="#lp-view-content"]').tab('show');
  239. $('.lp-view-tabs').fadeIn();
  240. });
  241. loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
  242. checkCurrentItemPosition({{ lp_current_item_id }});
  243. {% if glossary_extra_tools in glossary_tool_available_list %}
  244. // Loads the glossary library.
  245. (function () {
  246. {% if show_glossary_in_documents == 'ismanual' %}
  247. $.frameReady(
  248. function(){
  249. // $("<div>I am a div courses</div>").prependTo("body");
  250. },
  251. "#content_id",
  252. [
  253. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}", deps: [
  254. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  255. { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
  256. {{ fix_link }}
  257. ]},
  258. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  259. ]
  260. );
  261. {% elseif show_glossary_in_documents == 'isautomatic' %}
  262. $.frameReady(
  263. function(){
  264. // $("<div>I am a div courses</div>").prependTo("body");
  265. },
  266. "#content_id",
  267. [
  268. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}", deps: [
  269. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  270. { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
  271. {{ fix_link }}
  272. ]},
  273. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  274. ]
  275. );
  276. {% elseif fix_link != '' %}
  277. $.frameReady(
  278. function(){
  279. // $("<div>I am a div courses</div>").prependTo("body");
  280. },
  281. "#content_id",
  282. [
  283. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}", deps: [
  284. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  285. {{ fix_link }}
  286. ]},
  287. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  288. ]
  289. );
  290. {% endif %}
  291. })();
  292. {% endif %}
  293. {% if disable_js_in_lp_view == 0 %}
  294. $(function() {
  295. var arr = ['link', 'sco'];
  296. if ($.inArray(olms.lms_item_type, arr) == -1) {
  297. {{ frame_ready }}
  298. }
  299. });
  300. {% endif %}
  301. $(window).on('resize', function () {
  302. LPViewUtils.setHeightLPToc();
  303. });
  304. });
  305. </script>