session_catalog.tpl 12 KB

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