resume_session.tpl 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. {% extends 'layout/layout_1_col.tpl'|get_template %}
  2. {% block content %}
  3. {{ session_header }}
  4. {{ title }}
  5. <table id="session-properties" class="table table-hover data_table">
  6. <tr>
  7. <td>{{ 'CreatedBy'|get_lang }}</td>
  8. <td>{{ session_admin.complete_name_with_message_link }}</td>
  9. </tr>
  10. <tr>
  11. <td>{{ 'GeneralCoach' | get_lang}} :</td>
  12. <td>{{ general_coach.complete_name_with_message_link }}</td>
  13. </tr>
  14. {% if session_category %}
  15. <tr>
  16. <td>{{ 'SessionCategory' | get_lang}} </td>
  17. <td>{{ session_category }}</td>
  18. </tr>
  19. {% endif %}
  20. {% if session.duration > 0 %}
  21. <tr>
  22. <td>{{ 'Duration' | get_lang}} </td>
  23. <td>
  24. {{ session.duration }} {{ 'Days' | get_lang }}
  25. </td>
  26. </tr>
  27. {% else %}
  28. <tr>
  29. <td>{{ 'DisplayDates' | get_lang}} </td>
  30. <td>{{ session_dates.display }}</td>
  31. </tr>
  32. <tr>
  33. <td>{{ 'AccessDates' | get_lang}} </td>
  34. <td>{{ session_dates.access }}</td>
  35. </tr>
  36. <tr>
  37. <td>{{ 'CoachDates' | get_lang}} </td>
  38. <td>{{ session_dates.coach }}</td>
  39. </tr>
  40. {% endif %}
  41. <tr>
  42. <td>{{ 'Description' | get_lang}} </td>
  43. <td>
  44. {{ session.description }}
  45. </td>
  46. </tr>
  47. <tr>
  48. <td>{{ 'ShowDescription' | get_lang}} </td>
  49. <td>
  50. {% if session.show_description == 1 %}
  51. {{ 'Yes' | get_lang}}
  52. {% else %}
  53. {{ 'No' | get_lang}}
  54. {% endif %}
  55. </td>
  56. </tr>
  57. <tr>
  58. <td>{{ 'SessionVisibility' | get_lang}} </td>
  59. <td>
  60. {{ session_visibility }}
  61. </td>
  62. </tr>
  63. {% if promotion %}
  64. <tr>
  65. <td>{{ 'Career' | get_lang}}</td>
  66. <td>
  67. <a href="{{ _p.web_main }}admin/career_dashboard.php?filter={{ promotion.career.id }}&submit=&_qf__filter_form=">
  68. {{ promotion.career.name }}
  69. </a>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td>{{ 'Promotion' | get_lang}}</td>
  74. <td>
  75. <a href="{{ _p.web_main }}admin/promotions.php?action=edit&id={{ promotion.id }}">
  76. {{ promotion.name }}
  77. </a>
  78. </td>
  79. </tr>
  80. {% endif %}
  81. {% if url_list %}
  82. <tr>
  83. <td>URL</td>
  84. <td>
  85. {% for url in url_list %}
  86. {{ url.url }}
  87. {% endfor %}
  88. </td>
  89. </tr>
  90. {% endif %}
  91. {% for extra_field in extra_fields %}
  92. <tr>
  93. <td>{{ extra_field.text }}</td>
  94. <td>{{ extra_field.value }}</td>
  95. </tr>
  96. {% endfor %}
  97. {% if programmed_announcement %}
  98. <tr>
  99. <td>{{ 'ScheduledAnnouncements' | get_lang}}</td>
  100. <td>
  101. <a class="btn btn-default" href="{{ _p.web_main }}session/scheduled_announcement.php?session_id={{ session.id }}">
  102. {{ 'Edit' | get_lang }}
  103. </a>
  104. </td>
  105. </tr>
  106. {% endif %}
  107. </table>
  108. {{ course_list }}
  109. {{ user_list }}
  110. {{ requirements }}
  111. {{ dependencies }}
  112. <script>
  113. $(function () {
  114. function loadFiles(courseId, sessionId) {
  115. return $.get('{{ _p.web_ajax }}session.ajax.php', {
  116. course: courseId,
  117. session: sessionId,
  118. a: 'get_basic_course_documents_list'
  119. });
  120. }
  121. function loadForm(courseId, sessionId) {
  122. return $.get('{{ _p.web_ajax }}session.ajax.php', {
  123. course: courseId,
  124. session: sessionId,
  125. a: 'get_basic_course_documents_form'
  126. });
  127. }
  128. var c = 0;
  129. $('.session-upload-file-btn').on('click', function (e) {
  130. e.preventDefault();
  131. var $self = $(this),
  132. $trParent = $self.parents('tr'),
  133. $trContainer = $trParent.next(),
  134. courseId = $self.data('course') || 0,
  135. sessionId = $self.data('session') || 0;
  136. $('.session-upload-file-tr').remove();
  137. if (courseId == c) {
  138. c = 0;
  139. return;
  140. }
  141. c = courseId;
  142. $trContainer = $('<tr>')
  143. .addClass('session-upload-file-tr')
  144. .html('<td colspan="4">{{ 'Loading'|get_lang }}</td>')
  145. .insertAfter($trParent);
  146. $.when
  147. .apply($, [loadFiles(courseId, sessionId), loadForm(courseId, sessionId)])
  148. .then(function (response1, response2) {
  149. var filesCount = 0,
  150. filesUploadedCount = 0;
  151. $trContainer.find('td:first')
  152. .html('<div id="session-' + sessionId + '-docs">' + response1[0] + '</div>'
  153. + '<div id="session-' + sessionId + '-form">' + response2[0] + '</div>');
  154. $('#input_file_upload')
  155. .on('fileuploadadd', function (e, data) {
  156. filesCount += data.files.length;
  157. })
  158. .on('fileuploaddone', function (e, data) {
  159. filesUploadedCount += data.files.length;
  160. data.context.parent().remove();
  161. if (filesUploadedCount < filesCount) {
  162. return;
  163. }
  164. $('#session-' + sessionId + '-docs').html('{{ 'Loading'|get_lang }}');
  165. loadFiles(courseId, sessionId)
  166. .then(function (response) {
  167. filesCount = 0;
  168. filesUploadedCount = 0;
  169. $('#session-' + sessionId + '-docs').html(response);
  170. });
  171. });
  172. });
  173. });
  174. $('#session-list-course').on('click', '.delete_document', function (e) {
  175. e.preventDefault();
  176. if (!confirm('{{ 'ConfirmYourChoice'|get_lang }}')) {
  177. return;
  178. }
  179. var $self = $(this),
  180. courseId = $self.data('course') || 0,
  181. sessionId = $self.data('session') || 0;
  182. $('#session-' + sessionId + '-docs').html('{{ 'Loading'|get_lang }}');
  183. $.ajax(this.href)
  184. .then(function () {
  185. loadFiles(courseId, sessionId)
  186. .then(function (response) {
  187. $('#session-' + sessionId + '-docs').html(response);
  188. })
  189. });
  190. });
  191. });
  192. </script>
  193. {% endblock %}