session_catalog.tpl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. {% extends 'layout/page.tpl'|get_template %}
  2. {% block body %}
  3. <script>
  4. $(document).ready(function () {
  5. $('#date').datepicker({
  6. dateFormat: 'yy-mm-dd'
  7. });
  8. });
  9. </script>
  10. <div class="row">
  11. <div class="col-md-12">
  12. <!-- header catalog session -->
  13. <h2 class="title-session">{{ 'Sessions'|get_lang }}</h2>
  14. <div class="search-session">
  15. <div class="row">
  16. {% if show_courses %}
  17. <div class="col-md-4">
  18. <div class="return-catalog">
  19. <a class="btn btn-default btn-lg btn-block" href="{{ _p.web_self }}">
  20. <em class="fa fa-arrow-left"></em> {{ "CourseManagement"|get_lang }}
  21. </a>
  22. </div>
  23. </div>
  24. {% endif %}
  25. {% if show_courses %}
  26. <div class="col-md-4">
  27. {% else %}
  28. <div class="col-md-6">
  29. {% endif %}
  30. <form method="post" action="{{ _p.web_self }}?action=display_sessions">
  31. <div class="form-group">
  32. <label>{{ "ByDate"|get_lang }}</label>
  33. <div class="input-group">
  34. <input type="date" name="date" id="date" title="{{ 'Date'|get_lang }}"
  35. class="form-control" value="{{ search_date }}" readonly>
  36. <span class="input-group-btn">
  37. <button class="btn btn-default" type="submit">
  38. <em class="fa fa-search"></em> {{ 'Search'|get_lang }}
  39. </button>
  40. </span>
  41. </div>
  42. </div>
  43. </form>
  44. </div>
  45. {% if show_courses %}
  46. <div class="col-md-4">
  47. {% else %}
  48. <div class="col-md-6">
  49. {% endif %}
  50. <form method="post" action="{{ _p.web_self }}?action=search_tag">
  51. <label>{{ "ByTag"|get_lang }}</label>
  52. <div class="input-group">
  53. <input type="text" name="search_tag" title="{{ 'ByTag'|get_lang }}" class="form-control"
  54. value="{{ search_tag }}"/>
  55. <span class="input-group-btn">
  56. <button class="btn btn-default" type="submit">
  57. <em class="fa fa-search"></em> {{ 'Search'|get_lang }}
  58. </button>
  59. </span>
  60. </div>
  61. </form>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <!-- new view session grib -->
  68. <div class="row">
  69. <div class="grid-courses col-md-12">
  70. <div class="row">
  71. {% for item in sessions %}
  72. <div class="col-md-4 col-sm-6 col-xs-12">
  73. <div id="session-{{ item.id }}" class="items items-courses items-sessions">
  74. <div class="image">
  75. <a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.name }}">
  76. <img class="img-responsive" src="{{ item.image ? _p.web_upload ~ item.image : 'session_default.png'|icon() }}">
  77. </a>
  78. {% if item.category != '' %}
  79. <span class="category">{{ item.category }}</span>
  80. <div class="cribbon"></div>
  81. {% endif %}
  82. <div class="admin-actions">
  83. {% if item.edit_actions != '' %}
  84. <a class="btn btn-default btn-sm" href="{{ item.edit_actions }}">
  85. <i class="fa fa-pencil" aria-hidden="true"></i>
  86. </a>
  87. {% endif %}
  88. {% if item.is_subscribed %}
  89. {{ already_subscribed_label }}
  90. {% endif %}
  91. </div>
  92. </div>
  93. <div class="description">
  94. <div class="block-title">
  95. <h4 class="title">
  96. <a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.name }}">
  97. {{ item.name }}
  98. </a>
  99. </h4>
  100. </div>
  101. {% if show_tutor and item.coach_id %}
  102. <div class="block-author">
  103. <div class="author-card">
  104. <a href="{{ item.coach_url }}" class="ajax" data-title="{{ item.coach_name }}">
  105. <img src="{{ item.coach_avatar }}"/>
  106. </a>
  107. <div class="teachers-details">
  108. <h5>
  109. <a href="{{ item.coach_url }}" class="ajax" data-title="{{ item.coach_name }}">
  110. {{ item.coach_name }}
  111. </a>
  112. </h5>
  113. <p>{{ 'SessionGeneralCoach'|get_lang }}</p>
  114. </div>
  115. </div>
  116. </div>
  117. {% endif %}
  118. <div class="block-info">
  119. <ul class="info list-inline">
  120. <li class="course_label_number_courses">
  121. <i class="fa fa-book" aria-hidden="true"></i>
  122. {{ item.nbr_courses ~ ' ' ~ 'Courses'|get_lang }}
  123. </li>
  124. <li class="course_label_number_users">
  125. <i class="fa fa-user" aria-hidden="true"></i>
  126. {{ item.nbr_users ~ ' ' ~ 'NbUsers'|get_lang }}
  127. </li>
  128. </ul>
  129. </div>
  130. <div class="block-date">
  131. {{ item.duration ? 'SessionDurationXDaysLeft'|get_lang|format(item.duration) : item.date }}
  132. </div>
  133. <div class="toolbar row">
  134. {% if item.price %}
  135. <div class="col-sm-4">
  136. {{ item.price }}
  137. </div>
  138. {% endif %}
  139. {% if _u.logged %}
  140. <div class="col-sm-8">
  141. <div class="btn-group btn-group-sm" role="group">
  142. {% if not item.sequences is empty %}
  143. <a class="btn btn-default btn-sm" role="button"
  144. title="{{ 'SeeSequences'|get_lang }}" data-toggle="popover"
  145. id="session-{{ item.id }}-sequences">
  146. <i class="fa fa-sitemap" aria-hidden="true"></i>
  147. </a>
  148. {% endif %}
  149. {% if item.is_subscribed == false %}
  150. {{ item.subscribe_button }}
  151. {% endif %}
  152. </div>
  153. </div>
  154. {% endif %}
  155. </div>
  156. </div>
  157. {% if _u.logged %}
  158. <script>
  159. $('#session-{{ item.id }}-sequences').popover({
  160. placement: 'bottom',
  161. html: true,
  162. trigger: 'click',
  163. content: function () {
  164. var content = '';
  165. {% if item.sequences %}
  166. {% for sequence in item.sequences %}
  167. content += '<p class="lead">{{ sequence.name }}</p>';
  168. {% if sequence.requirements %}
  169. content += '<p><em class="fa fa-sort-amount-desc"></em> {{ 'RequiredSessions'|get_lang }}</p>';
  170. content += '<ul>';
  171. {% for requirement in sequence.requirements %}
  172. content += '<li>';
  173. content += '<a href="{{ _p.web ~ 'session/' ~ requirement.id ~ '/about/' }}">{{ requirement.name }}</a>';
  174. content += '</li>';
  175. {% endfor %}
  176. content += '</ul>';
  177. {% endif %}
  178. {% if sequence.dependencies %}
  179. content += '<p><em class="fa fa-sort-amount-desc"></em> {{ 'DependentSessions'|get_lang }}</p>';
  180. content += '<ul>';
  181. {% for dependency in sequence.dependencies %}
  182. content += '<li>';
  183. content += '<a href="{{ _p.web ~ 'session/' ~ dependency.id ~ '/about/' }}">{{ dependency.name }}</a>';
  184. content += '</li>';
  185. {% endfor %}
  186. content += '</ul>';
  187. {% endif %}
  188. {% if item.sequences|length > 1 %}
  189. content += '<hr>';
  190. {% endif %}
  191. {% endfor %}
  192. {% else %}
  193. content = "{{ 'NoDependencies'|get_lang }}";
  194. {% endif %}
  195. return content;
  196. }
  197. });
  198. </script>
  199. {% endif %}
  200. </div>
  201. </div>
  202. {% else %}
  203. <div class="col-xs-12">
  204. <div class="alert alert-warning">
  205. {{ 'NoResults'|get_lang }}
  206. </div>
  207. </div>
  208. {% endfor %}
  209. </div>
  210. </div>
  211. </div>
  212. <!-- end view session grib -->
  213. {{ catalog_pagination }}
  214. {% endblock %}