catalog.html.twig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. {% autoescape false %}
  2. <div id="buy-courses-tabs">
  3. {% if sessions_are_included %}
  4. <ul class="nav nav-tabs buy-courses-tabs" role="tablist">
  5. <li id="buy-courses-tab" class="{{ showing_courses ? 'active' : '' }}" role="presentation">
  6. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/course_catalog.php'} ) }}" aria-controls="buy-courses" role="tab">
  7. {{ 'Courses'|get_lang }}
  8. </a>
  9. </li>
  10. <li id="buy-sessions-tab" class="{{ showing_sessions ? 'active' : '' }}" role="presentation">
  11. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/session_catalog.php'} ) }}" aria-controls="buy-sessions" role="tab">
  12. {{ 'Sessions'|get_lang }}
  13. </a>
  14. </li>
  15. {% if services_are_included %}
  16. <li id="buy-services-tab" class="{{ showing_services ? 'active' : '' }}" role="presentation">
  17. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/service_catalog.php'} ) }}" aria-controls="buy-services" role="tab">
  18. {{ 'Services'|get_plugin_lang('BuyCoursesPlugin') }}
  19. </a>
  20. </li>
  21. {% endif %}
  22. </ul>
  23. {% endif %}
  24. <div class="tab-content">
  25. <div class="tab-pane active" aria-labelledby="buy-sessions-tab" role="tabpanel">
  26. <div class="row">
  27. <div class="col-md-3">
  28. {{ search_filter_form }}
  29. </div>
  30. <div class="col-md-9">
  31. <div class="row">
  32. {% if showing_courses %}
  33. {% for course in courses %}
  34. <div class="col-md-4 col-sm-6">
  35. <article class="thumbnail">
  36. <img alt="{{ course.title }}" class="img-responsive" src="{{ course.course_img ? course.course_img : 'session_default.png'|icon() }}">
  37. <div class="caption">
  38. {% set course_description_url = _p.web_ajax ~ 'course_home.ajax.php?' ~ {'code': course.code, 'a': 'show_course_information'}|url_encode() %}
  39. <h3>
  40. <a class="ajax" href="{{ course_description_url }}" data-title="{{ course.title }}">{{ course.title }}</a>
  41. </h3>
  42. <ul class="list-unstyled">
  43. {% for teacher in course.teachers %}
  44. <li><em class="fa fa-user"></em> {{ teacher }}</li>
  45. {% endfor %}
  46. </ul>
  47. <p class="lead text-right">{{ course.currency }} {{ course.price }}</p>
  48. {% if course.enrolled == "YES" %}
  49. <div class="alert alert-success">
  50. <em class="fa fa-check-square-o fa-fw"></em> {{ 'TheUserIsAlreadyRegisteredInTheCourse'|get_plugin_lang('BuyCoursesPlugin') }}
  51. </div>
  52. {% elseif course.enrolled == "NO" %}
  53. <div class="text-center">
  54. <a class="ajax btn btn-primary" title="" href="{{ course_description_url }}" data-title="{{ course.title }}">
  55. <em class="fa fa-file-text"></em> {{ 'SeeDescription'|get_plugin_lang('BuyCoursesPlugin') }}
  56. </a>
  57. <a class="btn btn-success" title="" href="{{ url('legacy_plugin', {'name' :'buycourses/src/process.php', 'i': course.id, 't': 1 }) }}">
  58. <em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
  59. </a>
  60. </div>
  61. {% elseif course.enrolled == "TMP" %}
  62. <div class="alert alert-info">{{ 'WaitingToReceiveThePayment'|get_plugin_lang('BuyCoursesPlugin') }}</div>
  63. {% endif %}
  64. </div>
  65. </article>
  66. </div>
  67. {% endfor %}
  68. {% endif %}
  69. {% if showing_sessions %}
  70. {% for session in sessions %}
  71. <div class="col-md-4 col-sm-6">
  72. <article class="thumbnail">
  73. <img alt="{{ session.name }}" class="img-responsive" src="{{ session.image ? session.image : 'session_default.png'|icon() }}">
  74. <div class="caption">
  75. <h3>
  76. <a href="{{ _p.web ~ 'session/' ~ session.id ~ '/about/' }}">{{ session.name }}</a>
  77. </h3>
  78. {% if 'show_session_coach'|get_setting == 'true' %}
  79. <p><em class="fa fa-user fa-fw"></em> {{ session.coach }}</p>
  80. {% endif %}
  81. <p><em class="fa fa-calendar fa-fw"></em> {{ session.dates.display }}</p>
  82. <p class="lead text-right">{{ session.currency }} {{ session.price }}</p>
  83. <ul class="list-unstyled">
  84. {% for course in session.courses %}
  85. <li>
  86. <em class="fa fa-book fa-fw"></em> {{ course.title }}
  87. {% if course.coaches|length %}
  88. <ul>
  89. {% for coach in course.coaches %}
  90. <li>{{ coach }}</li>
  91. {% endfor %}
  92. </ul>
  93. {% endif %}
  94. </li>
  95. {% endfor %}
  96. </ul>
  97. {% if session.enrolled == "YES" %}
  98. <div class="alert alert-success">
  99. <em class="fa fa-check-square-o fa-fw"></em> {{ 'TheUserIsAlreadyRegisteredInTheSession'|get_plugin_lang('BuyCoursesPlugin') }}
  100. </div>
  101. {% elseif session.enrolled == "NO" %}
  102. <div class="text-center">
  103. <a class="btn btn-success" href="{{ url('legacy_plugin', {'name' :'buycourses/src/process.php', 'i': session.id, 't': 2 }) }}">
  104. <em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
  105. </a>
  106. </div>
  107. {% elseif session.enrolled == "TMP" %}
  108. <div class="alert alert-info">{{ 'WaitingToReceiveThePayment'|get_plugin_lang('BuyCoursesPlugin') }}</div>
  109. {% endif %}
  110. </div>
  111. </article>
  112. </div>
  113. {% endfor %}
  114. {% endif %}
  115. {% if showing_services %}
  116. {% for service in services %}
  117. <div class="col-md-4 col-sm-6">
  118. <div class="items-course">
  119. <div class="items-course-image">
  120. <a href="{{ _p.web }}service/{{ service.id }}">
  121. <img alt="{{ service.name }}" class="img-responsive" src="{{ service.image }}">
  122. </a>
  123. </div>
  124. <div class="items-course-info">
  125. <h4 class="title">
  126. <a title="{{ service.name }}" href="{{ _p.web }}service/{{ service.id }}" >
  127. {{ service.name }}
  128. </a>
  129. </h4>
  130. <ul class="list-unstyled">
  131. <li><em class="fa fa-clock-o"></em> {{ 'Duration'|get_plugin_lang('BuyCoursesPlugin') }} : {{ service.duration_days == 0 ? 'NoLimit' | get_lang : service.duration_days ~ ' ' ~ 'Days' | get_lang }}</li>
  132. {% if service.applies_to == 0 %}
  133. <li><em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'None' | get_lang }}</li>
  134. {% elseif service.applies_to == 1 %}
  135. <li><em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'User' | get_lang }}</li>
  136. {% elseif service.applies_to == 2 %}
  137. <li><em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'Course' | get_lang }}</li>
  138. {% elseif service.applies_to == 3 %}
  139. <li><em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'Session' | get_lang }}</li>
  140. {% elseif service.applies_to == 4 %}
  141. <li><em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'SubscriptionPackage' | get_plugin_lang('BuyCoursesPlugin') }}</li>
  142. {% endif %}
  143. <li><em class="fa fa-user"></em> {{ service.owner_name }}</li>
  144. </ul>
  145. <p class="text-right">
  146. <span class="label label-primary">
  147. {{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }}
  148. </span>
  149. </p>
  150. <div class="toolbar">
  151. <a class="btn btn-info btn-block btn-sm" title="" href="{{ _p.web }}service/{{ service.id }}">
  152. <em class="fa fa-info-circle"></em> {{ 'ServiceInformation'|get_plugin_lang('BuyCoursesPlugin') }}
  153. </a>
  154. <a class="btn btn-success btn-block btn-sm" title="" href="{{ _p.web_plugin ~ 'buycourses/src/service_process.php?' ~ {'i': service.id, 't': service.applies_to}|url_encode() }}">
  155. <em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
  156. </a>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. {% endfor %}
  162. {% endif %}
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. {% endautoescape %}