classic_session.html.twig 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. {% set session_image = 'window_list.png'|img(32, row.title) %}
  2. {% autoescape false %}
  3. {% for row in session %}
  4. <div class="panel panel-default">
  5. {% set collapsable = '' %}
  6. {% if not row.show_simple_session_info %}
  7. {% if row.course_list_session_style %}
  8. <div class="panel-heading">
  9. {% if row.course_list_session_style == 1 or row.course_list_session_style == 2 %}
  10. {# Session link #}
  11. {% if remove_session_url == true %}
  12. {{ session_image }} {{ row.title }}
  13. {% else %}
  14. {# Default link #}
  15. {% set session_link = _p.web_main ~ 'session/index.php?session_id=' ~ row.id %}
  16. {% if row.course_list_session_style == 2 and row.courses|length == 1 %}
  17. {# Linkt to first course #}
  18. {% set session_link = row.courses.0.link %}
  19. {% endif %}
  20. <a href="{{ session_link }}">
  21. {{ session_image }} {{ row.title }}
  22. </a>
  23. {% endif %}
  24. {% elseif row.course_list_session_style == 4 %}
  25. {{ session_image }} {{ row.title }}
  26. {% elseif row.course_list_session_style == 3 %}
  27. {# Collapsible/Foldable panel #}
  28. <a role="button" data-toggle="collapse" data-parent="#page-content" href="#collapse_{{ row.id }}"
  29. aria-expanded="false">
  30. {{ session_image }} {{ row.title }}
  31. </a>
  32. {% if row.collapsable_link %}
  33. {% if row.collapsed == 1 %}
  34. {% set collapsable = 'collapse' %}
  35. {% endif %}
  36. {% else %}
  37. {% set collapsable = 'collapse' %}
  38. {% endif %}
  39. {% endif %}
  40. {% if row.show_actions %}
  41. <div class="pull-right">
  42. <a href="{{ _p.web_main ~ "session/resume_session.php?id_session=" ~ row.id }}">
  43. <img src="{{ "edit.png"|icon(22) }}" width="22" height="22" alt="{{ "Edit"|get_lang }}"
  44. title="{{ "Edit"|get_lang }}">
  45. </a>
  46. </div>
  47. {% endif %}
  48. {% if row.collapsable_link %}
  49. <div class="pull-right">
  50. {{ row.collapsable_link }}
  51. </div>
  52. {% endif %}
  53. </div>
  54. {% endif %}
  55. {% if row.collapsable_link %}
  56. {% if row.collapsed == 1 %}
  57. {% set collapsable = 'collapse' %}
  58. {% endif %}
  59. {% endif %}
  60. <div class="session panel-body {{ collapsable }}" id="collapse_{{ row.id }}">
  61. <div class="row">
  62. <div class="col-md-12">
  63. {% if row.show_description %}
  64. {{ row.description }}
  65. {% endif %}
  66. <ul class="info-session list-inline">
  67. {% if row.coach_name %}
  68. <li>
  69. <i class="fa fa-user" aria-hidden="true"></i>
  70. {{ row.coach_name }}
  71. </li>
  72. {% endif %}
  73. {% if row.date %}
  74. <li>
  75. <i class="fa fa-calendar" aria-hidden="true"></i>
  76. {{ row.date }}
  77. </li>
  78. {% elseif row.duration %}
  79. <li>
  80. <i class="fa fa-calendar" aria-hidden="true"></i>
  81. {{ row.duration }}
  82. </li>
  83. {% endif %}
  84. </ul>
  85. <div class="sessions-items">
  86. {% for item in row.courses %}
  87. <div class="courses">
  88. <div class="row">
  89. <div class="col-md-2">
  90. <a href="{{ item.link }}" class="thumbnail">
  91. {{ item.html_image }}
  92. </a>
  93. </div>
  94. <div class="col-md-10">
  95. <h4>{{ item.title }}</h4>
  96. <div class="list-teachers">
  97. {% if item.coaches|length > 0 %}
  98. <img src="{{ 'teacher.png'|icon(16) }}" width="16" height="16">
  99. {% for coach in item.coaches %}
  100. {{ loop.index > 1 ? ' | ' }}
  101. <a href="{{ _p.web_ajax ~ 'user_manager.ajax.php?' ~ {'a': 'get_user_popup', 'user_id': coach.user_id, 'session_id': row.id, 'course_id': item.real_id }|url_encode() }}"
  102. data-title="{{ coach.full_name }}" class="ajax">
  103. {{ coach.firstname }}, {{ coach.lastname }}
  104. </a>
  105. {% endfor %}
  106. {% endif %}
  107. </div>
  108. </div>
  109. {% if item.student_info %}
  110. {% if item.student_info.progress is not null or item.student_info.score is not null or item.student_info.certificate is not null %}
  111. <div class="course-student-info">
  112. <div class="student-info">
  113. {% if (item.student_info.progress is not null) %}
  114. {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }}
  115. {% endif %}
  116. {% if (item.student_info.score is not null) %}
  117. {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }}
  118. {% endif %}
  119. {% if (item.student_info.certificate is not null) %}
  120. {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }}
  121. {% endif %}
  122. </div>
  123. </div>
  124. {% endif %}
  125. {% endif %}
  126. </div>
  127. </div>
  128. {% endfor %}
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. {% else %}
  134. <div class="panel-heading">
  135. <a href="{{ _p.web_main ~ 'session/index.php?session_id=' ~ row.id }}">
  136. <img id="session_img_{{ row.id }}" src="{{ "window_list.png"|icon(32) }}" alt="{{ row.title }}"
  137. title="{{ row.title }}">
  138. {{ row.title }}
  139. </a>
  140. </div>
  141. <!-- view simple info -->
  142. <div class="panel-body">
  143. <div class="row">
  144. <div class="col-md-2">
  145. <a class="thumbnail" href="{{ _p.web_main ~ 'session/index.php?session_id=' ~ row.id }}">
  146. <img class="img-responsive"
  147. src="{{ row.image ? _p.web_upload ~ row.image : 'session_default.png'|icon() }}"
  148. alt="{{ row.title }}" title="{{ row.title }}">
  149. </a>
  150. </div>
  151. <div class="col-md-10">
  152. <div class="info-session">
  153. <p>{{ row.subtitle }}</p>
  154. {% if row.show_description %}
  155. <div class="description">
  156. {{ row.description }}
  157. </div>
  158. {% endif %}
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <!-- end view simple info -->
  164. {% endif %}
  165. </div>
  166. {% endfor %}
  167. {% endautoescape %}