session_catalog.tpl 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {% extends template ~ "/layout/main.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="col-md-12">
  11. <div class="row">
  12. {% if show_courses %}
  13. <div class="col-md-4">
  14. <div class="section-title-catalog">{{ 'Courses'|get_lang }}</div>
  15. {% if not hidden_links %}
  16. <form class="form-horizontal" method="post" action="{{ course_url }}">
  17. <div class="form-group">
  18. <div class="col-sm-12">
  19. <input type="hidden" name="sec_token" value="{{ search_token }}">
  20. <input type="hidden" name="search_course" value="1" />
  21. <div class="input-group">
  22. <input type="text" name="search_term" class="form-control" />
  23. <span class="input-group-btn">
  24. <button class="btn btn-default" type="submit"><i class="fa fa-search"></i> {{ 'Search'|get_lang }}</button>
  25. </span>
  26. </div>
  27. </div>
  28. </div>
  29. </form>
  30. {% endif %}
  31. </div>
  32. {% endif %}
  33. <div class="col-md-8">
  34. {% if show_sessions %}
  35. <div class="section-title-catalog">{{ 'Sessions'|get_lang }}</div>
  36. <div class="row">
  37. <div class="col-md-6">
  38. <form class="form-horizontal" method="post" action="{{ _p.web_self }}?action=display_sessions">
  39. <div class="form-group">
  40. <label class="col-sm-3">{{ "ByDate"|get_lang }}</label>
  41. <div class="col-sm-9">
  42. <div class="input-group">
  43. <input type="date" name="date" id="date" class="form-control" value="{{ search_date }}" readonly>
  44. <span class="input-group-btn">
  45. <button class="btn btn-default" type="submit"><i class="fa fa-search"></i> {{ 'Search'|get_lang }}</button>
  46. </span>
  47. </div>
  48. </div>
  49. </div>
  50. </form>
  51. </div>
  52. <div class="col-md-6">
  53. <form class="form-horizontal" method="post" action="{{ _p.web_self }}?action=search_tag">
  54. <div class="form-group">
  55. <label class="col-sm-4">{{ "ByTag"|get_lang }}</label>
  56. <div class="col-sm-8">
  57. <div class="input-group">
  58. <input type="text" name="search_tag" class="form-control" value="{{ search_tag }}" />
  59. <span class="input-group-btn">
  60. <button class="btn btn-default" type="submit"><i class="fa fa-search"></i> {{ 'Search'|get_lang }}</button>
  61. </span>
  62. </div>
  63. </div>
  64. </div>
  65. </form>
  66. </div>
  67. </div>
  68. {% endif %}
  69. </div>
  70. </div>
  71. </div>
  72. <section id="session-list">
  73. <div class="col-md-12">
  74. <div class="row">
  75. {% for session in sessions %}
  76. <div class="col-md-3 session-col">
  77. <div class="item" id="session-{{ session.id }}">
  78. <img src="{{ session.image ? _p.web_upload ~ session.image : _p.web_img ~ 'session_default.png' }}">
  79. <div class="information-item">
  80. <h3 class="title-session">
  81. <a href="{{ _p.web ~ 'session/' ~ session.id ~ '/about/' }}" title="{{ session.name }}">
  82. {{ session.name }}
  83. </a>
  84. </h3>
  85. <ul class="list-unstyled">
  86. {% if show_tutor %}
  87. <li class="author-session">
  88. <i class="fa fa-user"></i> {{ session.coach_name }}
  89. </li>
  90. {% endif %}
  91. <li class="date-session">
  92. <i class="fa fa-calendar-o"></i> {{ session.date }}
  93. </li>
  94. {% if session.tags %}
  95. <li class="tags-session">
  96. <i class="fa fa-tags"></i> {{ session.tags|join(', ')}}
  97. </li>
  98. {% endif %}
  99. </ul>
  100. <div class="options">
  101. <p>
  102. <a class="btn btn-info btn-block btn-sm" role="button" data-toggle="popover" id="session-{{ session.id }}-sequences">{{ 'SeeSequences'|get_lang }}</a>
  103. </p>
  104. <p class="buttom-subscribed">
  105. {% if session.is_subscribed %}
  106. {{ already_subscribed_label }}
  107. {% elseif _u.logged == 0 %}
  108. {{ '' }}
  109. {% else %}
  110. {{ session.subscribe_button }}
  111. {% endif %}
  112. </p>
  113. </div>
  114. </div>
  115. <script>
  116. $('#session-{{ session.id }}-sequences').popover({
  117. placement: 'bottom',
  118. html: true,
  119. trigger: 'click',
  120. content: function () {
  121. var content = '';
  122. {% if session.sequences %}
  123. {% for sequence in session.sequences %}
  124. content += '<p class="lead">{{ sequence.name }}</p>';
  125. {% if sequence.requirements %}
  126. content += '<p><i class="fa fa-sort-amount-desc"></i> {{ 'RequiredSessions'|get_lang }}</p>';
  127. content += '<ul>';
  128. {% for requirement in sequence.requirements %}
  129. content += '<li>';
  130. content += '<a href="{{ _p.web ~ 'session/' ~ requirement.id ~ '/about/' }}">{{ requirement.name }}</a>';
  131. content += '</li>';
  132. {% endfor %}
  133. content += '</ul>';
  134. {% endif %}
  135. {% if sequence.dependencies %}
  136. content += '<p><i class="fa fa-sort-amount-desc"></i> {{ 'DependentSessions'|get_lang }}</p>';
  137. content += '<ul>';
  138. {% for dependency in sequence.dependencies %}
  139. content += '<li>';
  140. content += '<a href="{{ _p.web ~ 'session/' ~ dependency.id ~ '/about/' }}">{{ dependency.name }}</a>';
  141. content += '</li>';
  142. {% endfor %}
  143. content += '</ul>';
  144. {% endif %}
  145. {% if session.sequences|length > 1 %}
  146. content += '<hr>';
  147. {% endif %}
  148. {% endfor %}
  149. {% else %}
  150. content = "{{ 'NoDependencies'|get_lang }}";
  151. {% endif %}
  152. return content;
  153. }
  154. });
  155. </script>
  156. </div>
  157. </div>
  158. {% else %}
  159. <div class="col-xs-12">
  160. <div class="alert alert-warning">
  161. {{ 'NoResults'|get_lang }}
  162. </div>
  163. </div>
  164. {% endfor %}
  165. </div>
  166. </div>
  167. </section>
  168. {{ catalog_pagination }}
  169. {% endblock %}