configuration.html.twig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {% autoescape false %}
  2. {% if sessions_are_included %}
  3. <ul class="nav nav-tabs buy-courses-tabs" role="tablist">
  4. <li role="presentation" class="active">
  5. <a href="#courses" aria-controls="courses" role="tab" data-toggle="tab">{{ 'Courses'|get_lang }}</a>
  6. </li>
  7. <li role="presentation">
  8. <a href="#sessions" aria-controls="sessions" role="tab" data-toggle="tab">{{ 'Sessions'|get_lang }}</a>
  9. </li>
  10. {% if services_are_included %}
  11. <li role="presentation">
  12. <a href="#services" aria-controls="services" role="tab" data-toggle="tab">{{ 'Services'|get_plugin_lang('BuyCoursesPlugin') }}</a>
  13. </li>
  14. {% endif %}
  15. </ul>
  16. {% endif %}
  17. <div class="tab-content">
  18. <div role="tabpanel" class="tab-pane fade in active" id="courses">
  19. <div class="table-responsive">
  20. <table id="courses_table" class="table table-striped table-hover">
  21. <thead>
  22. <tr>
  23. <th>{{ 'Title'|get_lang }}</th>
  24. <th class="text-center">{{ 'OfficialCode'|get_lang }}</th>
  25. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  26. <th class="text-right" width="200">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  27. <th class="text-right">{{ 'Options'|get_lang }}</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {% for item in courses %}
  32. <tr data-item="{{ item.course_id }}" data-type="course">
  33. <td>
  34. {% if item.course_visibility == 0 %}
  35. <img src="{{ 'bullet_red.png'|icon() }}" alt="{{ 'CourseVisibilityClosed'|get_lang }}" title="{{ 'CourseVisibilityClosed'|get_lang }}">
  36. {% elseif item.course_visibility == 1 %}
  37. <img src="{{ 'bullet_orange.png'|icon() }}" alt="{{ 'Private'|get_lang }}" title="{{ 'Private'|get_lang }}">
  38. {% elseif item.course_visibility == 2 %}
  39. <img src="{{ 'bullet_green.png'|icon() }}" alt="{{ 'OpenToThePlatform'|get_lang }}" title="{{ 'OpenToThePlatform'|get_lang }}">
  40. {% elseif item.course_visibility == 3 %}
  41. <img src="{{ 'bullet_blue.png'|icon() }}" alt="{{ 'OpenToTheWorld'|get_lang }}" title="{{ 'OpenToTheWorld'|get_lang }}">
  42. {% elseif item.course_visibility == 4 %}
  43. <img src="{{ 'bullet_gray.png'|icon() }}" alt="{{ 'CourseVisibilityHidden'|get_lang }}" title="{{ 'CourseVisibilityHidden'|get_lang }}">
  44. {% endif %}
  45. <a href="{{ _p.web_course ~ item.course_code ~ '/index.php' }}">{{ item.course_title }}</a>
  46. <span class="label label-info">{{ item.course_visual_code }}</span>
  47. </td>
  48. <td class="text-center">
  49. {{ item.course_code }}
  50. </td>
  51. <td class="text-center">
  52. {% if item.visible %}
  53. <em class="fa fa-fw fa-check-square-o"></em>
  54. {% else %}
  55. <em class="fa fa-fw fa-square-o"></em>
  56. {% endif %}
  57. </td>
  58. <td width="200" class="text-right">
  59. {{ "#{item.price} #{item.currency ?: item.currency}" }}
  60. </td>
  61. <td class="text-right">
  62. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/configure_course.php', 'i': item.course_id, 't':product_type_course } ) }}" class="btn btn-info btn-sm">
  63. <em class="fa fa-wrench fa-fw"></em> {{ 'Configure'|get_lang }}
  64. </a>
  65. </td>
  66. </tr>
  67. {% endfor %}
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. {% if sessions_are_included %}
  73. <div role="tabpanel" class="tab-pane" id="sessions">
  74. <div class="table-responsive">
  75. <table id="courses_table" class="table">
  76. <thead>
  77. <tr>
  78. <th>{{ 'Title'|get_lang }}</th>
  79. <th class="text-center">{{ 'StartDate'|get_lang }}</th>
  80. <th class="text-center">{{ 'EndDate'|get_lang }}</th>
  81. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  82. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  83. <th class="text-right">{{ 'Options'|get_lang }}</th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. {% for item in sessions %}
  88. <tr data-item="{{ item.session_id }}" data-type="session">
  89. <td>
  90. {% if item.session_visibility == 0 %}
  91. <img src="{{ 'bullet_red.png'|icon() }}" alt="{{ 'CourseVisibilityClosed'|get_lang }}" title="{{ 'CourseVisibilityClosed'|get_lang }}">
  92. {% elseif item.session_visibility == 1 %}
  93. <img src="{{ 'bullet_orange.png'|icon() }}" alt="{{ 'Private'|get_lang }}" title="{{ 'Private'|get_lang }}">
  94. {% elseif item.session_visibility == 2 %}
  95. <img src="{{ 'bullet_green.png'|icon() }}" alt="{{ 'OpenToThePlatform'|get_lang }}" title="{{ 'OpenToThePlatform'|get_lang }}">
  96. {% elseif item.session_visibility == 3 %}
  97. <img src="{{ 'bullet_blue.png'|icon() }}" alt="{{ 'OpenToTheWorld'|get_lang }}" title="{{ 'OpenToTheWorld'|get_lang }}">
  98. {% elseif item.session_visibility == 4 %}
  99. <img src="{{ 'bullet_gray.png'|icon() }}" alt="{{ 'CourseVisibilityHidden'|get_lang }}" title="{{ 'CourseVisibilityHidden'|get_lang }}">
  100. {% endif %}
  101. <a href="{{ _p.web_main ~ 'session/index.php?' ~ {'session_id': item.session_id}|url_encode() }}">
  102. {{ item.session_name }}
  103. </a>
  104. </td>
  105. <td class="text-center">
  106. {{ item.session_display_start_date }}
  107. </td>
  108. <td class="text-center">
  109. {{ item.session_display_end_date }}
  110. </td>
  111. <td class="text-center">
  112. {% if item.visible %}
  113. <em class="fa fa-fw fa-check-square-o"></em>
  114. {% else %}
  115. <em class="fa fa-fw fa-square-o"></em>
  116. {% endif %}
  117. </td>
  118. <td class="text-right" width="200">
  119. {{ "#{item.price} #{item.currency ?: item.currency}" }}
  120. </td>
  121. <td class="text-right">
  122. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/configure_course.php', 'i': item.session_id, 't':product_type_session } ) }}" class="btn btn-info btn-sm">
  123. <em class="fa fa-wrench fa-fw"></em> {{ 'Configure'|get_lang }}
  124. </a>
  125. </td>
  126. </tr>
  127. {% endfor %}
  128. </tbody>
  129. </table>
  130. </div>
  131. </div>
  132. {% endif %}
  133. {% if services_are_included %}
  134. <div role="tabpanel" class="tab-pane" id="services">
  135. <div class="table-responsive">
  136. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/services_add.php'}) }}" class="btn btn-primary">
  137. <em class="fa fa-cart-plus fa-fw"></em> {{ 'NewService'| get_plugin_lang('BuyCoursesPlugin') }}
  138. </a>
  139. </br>
  140. </br>
  141. <table id="services_table" class="table">
  142. <thead>
  143. <tr>
  144. <th>{{ 'Service'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  145. <th>{{ 'Description'|get_lang }}</th>
  146. <th class="text-center">{{ 'Duration'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  147. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  148. <th class="text-center">{{ 'Owner'|get_lang }}</th>
  149. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  150. <th class="text-right">{{ 'Options'|get_lang }}</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. {% for item in services %}
  155. <tr data-item="{{ item.id }}" data-type="service">
  156. <td>
  157. {{ item.name }}
  158. </td>
  159. <td>
  160. {{ item.description }}
  161. </td>
  162. <td class="text-center">
  163. {% if item.duration_days == 0 %}
  164. {{ 'NoLimit'|get_lang }}
  165. {% else %}
  166. {{ item.duration_days }} {{ 'Days'|get_lang }}
  167. {% endif %}
  168. </td>
  169. <td class="text-center">
  170. {% if item.visibility == 1 %}
  171. <em class="fa fa-fw fa-check-square-o"></em>
  172. {% else %}
  173. <em class="fa fa-fw fa-square-o"></em>
  174. {% endif %}
  175. </td>
  176. <td class="text-center">
  177. {{ item.owner_name }}
  178. </td>
  179. <td class="text-right" width="200">
  180. {{ "#{item.price} #{item.currency ?: item.currency}" }}
  181. </td>
  182. <td class="text-right">
  183. <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/services_edit.php', 'id': item.id } ) }}" class="btn btn-info btn-sm">
  184. <em class="fa fa-wrench fa-fw"></em> {{ 'Edit'|get_lang }}
  185. </a>
  186. </td>
  187. </tr>
  188. {% endfor %}
  189. </tbody>
  190. </table>
  191. </div>
  192. </div>
  193. {% endif %}
  194. </div>
  195. {% endautoescape %}