session_catalog.tpl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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"><em class="fa fa-search"></em> {{ '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"><em class="fa fa-search"></em> {{ '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"><em class="fa fa-search"></em> {{ '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-xs-6 col-sm-6 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. <em class="fa fa-user"></em> {{ session.coach_name }}
  89. </li>
  90. {% endif %}
  91. <li class="date-session">
  92. <em class="fa fa-calendar-o"></em> {{ session.date }}
  93. </li>
  94. {% if session.tags %}
  95. <li class="tags-session">
  96. <em class="fa fa-tags"></em> {{ session.tags|join(', ')}}
  97. </li>
  98. {% endif %}
  99. </ul>
  100. <div class="options">
  101. {% if not _u.logged %}
  102. <p>
  103. <a class="btn btn-info btn-block btn-sm" href="{{ "#{_p.web}session/#{session.id}/about/" }}" title="{{ session.name }}">{{ 'SeeCourseInformationAndRequirements'|get_lang }}</a>
  104. </p>
  105. {% else %}
  106. <p>
  107. <a class="btn btn-info btn-block btn-sm" role="button" data-toggle="popover" id="session-{{ session.id }}-sequences">{{ 'SeeSequences'|get_lang }}</a>
  108. </p>
  109. <p class="buttom-subscribed">
  110. {% if session.is_subscribed %}
  111. {{ already_subscribed_label }}
  112. {% else %}
  113. {{ session.subscribe_button }}
  114. {% endif %}
  115. </p>
  116. {% endif %}
  117. </div>
  118. </div>
  119. {% if _u.logged %}
  120. <script>
  121. $('#session-{{ session.id }}-sequences').popover({
  122. placement: 'bottom',
  123. html: true,
  124. trigger: 'click',
  125. content: function () {
  126. var content = '';
  127. {% if session.sequences %}
  128. {% for sequence in session.sequences %}
  129. content += '<p class="lead">{{ sequence.name }}</p>';
  130. {% if sequence.requirements %}
  131. content += '<p><em class="fa fa-sort-amount-desc"></em> {{ 'RequiredSessions'|get_lang }}</p>';
  132. content += '<ul>';
  133. {% for requirement in sequence.requirements %}
  134. content += '<li>';
  135. content += '<a href="{{ _p.web ~ 'session/' ~ requirement.id ~ '/about/' }}">{{ requirement.name }}</a>';
  136. content += '</li>';
  137. {% endfor %}
  138. content += '</ul>';
  139. {% endif %}
  140. {% if sequence.dependencies %}
  141. content += '<p><em class="fa fa-sort-amount-desc"></em> {{ 'DependentSessions'|get_lang }}</p>';
  142. content += '<ul>';
  143. {% for dependency in sequence.dependencies %}
  144. content += '<li>';
  145. content += '<a href="{{ _p.web ~ 'session/' ~ dependency.id ~ '/about/' }}">{{ dependency.name }}</a>';
  146. content += '</li>';
  147. {% endfor %}
  148. content += '</ul>';
  149. {% endif %}
  150. {% if session.sequences|length > 1 %}
  151. content += '<hr>';
  152. {% endif %}
  153. {% endfor %}
  154. {% else %}
  155. content = "{{ 'NoDependencies'|get_lang }}";
  156. {% endif %}
  157. return content;
  158. }
  159. });
  160. </script>
  161. {% endif %}
  162. </div>
  163. </div>
  164. {% else %}
  165. <div class="col-xs-12">
  166. <div class="alert alert-warning">
  167. {{ 'NoResults'|get_lang }}
  168. </div>
  169. </div>
  170. {% endfor %}
  171. </div>
  172. </div>
  173. </section>
  174. {{ catalog_pagination }}
  175. {% endblock %}