list.tpl 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <script>
  2. function confirmation(name) {
  3. if (confirm("{{ "AreYouSureToDeleteJS"|get_lang }} \"" + name + "\" ?")) {
  4. return true;
  5. } else {
  6. return false;
  7. }
  8. }
  9. </script>
  10. {{ introduction_section }}
  11. {% for lp_data in data %}
  12. {% set show_category = true %}
  13. {% if filtered_category and filtered_category != lp_data.category.id %}
  14. {% set show_category = false %}
  15. {% endif %}
  16. {% if show_category %}
  17. {% if categories|length > 1 and lp_data.category.id %}
  18. {% if is_allowed_to_edit %}
  19. <h3 class="page-header">
  20. {{ lp_data.category.getName() }}
  21. {% if lp_data.category.getId() > 0 %}
  22. {% if not _c.session_id %}
  23. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Edit"|get_lang }}">
  24. <img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
  25. </a>
  26. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}" title="{{ "AddUser"|get_lang }}">
  27. <img src="{{ "user.png"|icon }}" alt="{{ "AddUser"|get_lang }}">
  28. </a>
  29. {% if loop.index0 == 1 %}
  30. <a href="#">
  31. <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
  32. </a>
  33. {% else %}
  34. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}">
  35. <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
  36. </a>
  37. {% endif %}
  38. {% if (data|length - 1) == loop.index0 %}
  39. <a href="#">
  40. <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
  41. </a>
  42. {% else %}
  43. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}">
  44. <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
  45. </a>
  46. {% endif %}
  47. {% endif %}
  48. {% if lp_data.category_visibility == 0 %}
  49. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
  50. title="{{ 'Show'|get_lang }}">
  51. <img src="{{ 'invisible.png'|icon }}" alt="{{ 'Show'|get_lang }}">
  52. </a>
  53. {% else %}
  54. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
  55. title="{{ 'Hide'|get_lang }}">
  56. <img src="{{ 'visible.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
  57. </a>
  58. {% endif %}
  59. {% if lp_data.category_is_published == 0 %}
  60. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
  61. title="{{ 'LearnpathPublish'|get_lang }}">
  62. <img src="{{ 'lp_publish_na.png'|icon }}" alt="{{ 'LearnpathPublish'|get_lang }}">
  63. </a>
  64. {% else %}
  65. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
  66. title="{{ 'LearnpathDoNotPublish'|get_lang }}">
  67. <img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
  68. </a>
  69. {% endif %}
  70. {% if not _c.session_id %}
  71. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Delete"|get_lang }}">
  72. <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
  73. </a>
  74. {% endif %}
  75. {% endif %}
  76. </h3>
  77. {% elseif lp_data.lp_list is not empty %}
  78. <h3 class="page-header">{{ lp_data.category.getName() }}</h3>
  79. {% endif %}
  80. {% endif %}
  81. {% if lp_data.lp_list %}
  82. <div class="table-responsive">
  83. <table class="table table-hover table-striped">
  84. <thead>
  85. <tr>
  86. <th>{{ "Title"|get_lang }}</th>
  87. {% if is_allowed_to_edit %}
  88. <th>{{ "PublicationDate"|get_lang }}</th>
  89. <th>{{ "ExpirationDate"|get_lang }}</th>
  90. <th>{{ "Progress"|get_lang }}</th>
  91. <th>{{ "AuthoringOptions"|get_lang }}</th>
  92. {% else %}
  93. {% if not is_invitee %}
  94. <th>{{ "Progress"|get_lang }}</th>
  95. {% endif %}
  96. <th>{{ "Actions"|get_lang }}</th>
  97. {% endif %}
  98. </tr>
  99. </thead>
  100. <tbody>
  101. {% for row in lp_data.lp_list %}
  102. <tr>
  103. <td>
  104. {{ row.learnpath_icon }}
  105. <a href="{{ row.url_start }}">
  106. {{ row.title }}
  107. {{ row.session_image }}
  108. {{ row.extra }}
  109. </a>
  110. </td>
  111. {% if is_allowed_to_edit %}
  112. <td>
  113. {% if row.start_time %}
  114. <span class="small">{{ row.start_time }}</span>
  115. {% endif %}
  116. </td>
  117. <td>
  118. <span class="small">{{ row.end_time }}</span>
  119. </td>
  120. <td>
  121. {{ row.dsp_progress }}
  122. </td>
  123. {% else %}
  124. {% if not is_invitee %}
  125. <td>
  126. {{ row.dsp_progress }}
  127. </td>
  128. {% endif %}
  129. {% endif %}
  130. <td>
  131. {{ row.action_build }}
  132. {{ row.action_edit }}
  133. {{ row.action_visible }}
  134. {{ row.action_tracking }}
  135. {{ row.action_publish }}
  136. {{ row.action_subscribe_users }}
  137. {{ row.action_serious_game }}
  138. {{ row.action_reinit }}
  139. {{ row.action_default_view }}
  140. {{ row.action_debug }}
  141. {{ row.action_export }}
  142. {{ row.action_copy }}
  143. {{ row.action_auto_launch }}
  144. {{ row.action_pdf }}
  145. {{ row.action_delete }}
  146. {{ row.action_order }}
  147. </td>
  148. </tr>
  149. {% endfor %}
  150. </tbody>
  151. </table>
  152. </div>
  153. {% endif %}
  154. {% endif %}
  155. {% endfor %}
  156. {% if is_allowed_to_edit and not lp_is_shown %}
  157. <div id="no-data-view">
  158. <h2>{{ "LearningPaths"|get_lang }}</h2>
  159. <img src="{{ "scorms.png"|icon(64) }}" width="64" height="64">
  160. <div class="controls">
  161. <a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=add_lp" }}" class="btn btn-default">
  162. {{ "LearnpathAddLearnpath"|get_lang }}
  163. </a>
  164. </div>
  165. </div>
  166. {% endif %}