grid_session.tpl 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% set group_courses = 'view_grid_courses_grouped_categories_in_sessions'| api_get_configuration_value %}
  2. {% macro course_block(course, show_category) %}
  3. <div class="col-xs-12 col-sm-6 col-md-4">
  4. <div class="items items-sessions">
  5. <div class="image">
  6. <img src="{{ course.image }}" class="img-responsive">
  7. {% if course.category != '' and show_category %}
  8. <span class="category">{{ course.category }}</span>
  9. <div class="cribbon"></div>
  10. {% endif %}
  11. {% if course.edit_actions != '' %}
  12. <div class="admin-actions">
  13. {% if course.document == '' %}
  14. <a class="btn btn-default btn-sm" href="{{ course.edit_actions }}">
  15. <i class="fa fa-pencil" aria-hidden="true"></i>
  16. </a>
  17. {% else %}
  18. <div class="btn-group" role="group">
  19. <a class="btn btn-default btn-sm" href="{{ course.edit_actions }}">
  20. <i class="fa fa-pencil" aria-hidden="true"></i>
  21. </a>
  22. {{ course.document }}
  23. </div>
  24. {% endif %}
  25. </div>
  26. {% endif %}
  27. </div>
  28. <div class="description">
  29. <div class="block-title">
  30. <h4 class="title">
  31. {% if course.visibility == constant('COURSE_VISIBILITY_CLOSED') %}
  32. {{ course.title }}
  33. <span class="code-title">{{ course.code }}</span>
  34. {% else %}
  35. <a href="{{ course.link }}">{{ course.title }}</a>
  36. {% endif %}
  37. </h4>
  38. </div>
  39. <div class="block-author">
  40. {% for teacher in course.teachers %}
  41. {% if course.teachers | length > 2 %}
  42. <a href="{{ teacher.url }}" class="ajax"
  43. data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
  44. <img src="{{ teacher.avatar }}"/>
  45. </a>
  46. {% else %}
  47. <a href="{{ teacher.url }}" class="ajax"
  48. data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
  49. <img src="{{ teacher.avatar }}"/>
  50. </a>
  51. <div class="teachers-details">
  52. <h5>
  53. <a href="{{ teacher.url }}" class="ajax"
  54. data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
  55. {{ teacher.firstname }} {{ teacher.lastname }}
  56. </a>
  57. </h5>
  58. <p>{{ "Teacher"|get_lang }}</p>
  59. </div>
  60. {% endif %}
  61. {% endfor %}
  62. </div>
  63. <div class="notifications">{{ course.notifications }}</div>
  64. {% if item.student_info %}
  65. <div class="black-student">
  66. {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %}
  67. <div class="course-student-info">
  68. <div class="student-info">
  69. {% if (item.student_info.progress is not null) %}
  70. {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }}
  71. {% endif %}
  72. {% if (item.student_info.score is not null) %}
  73. {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }}
  74. {% endif %}
  75. {% if (item.student_info.certificate is not null) %}
  76. {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }}
  77. {% endif %}
  78. </div>
  79. </div>
  80. {% endif %}
  81. </div>
  82. {% endif %}
  83. </div>
  84. </div>
  85. </div>
  86. {% endmacro %}
  87. {% import _self as blocks %}
  88. {% for row in session %}
  89. <div id="session-{{ item.id }}" class="session panel panel-default">
  90. <div class="panel-heading">
  91. <img id="session_img_{{ row.id }}" src="{{ "window_list.png"|icon(32) }}" width="32" height="32"
  92. alt="{{ row.title }}" title="{{ row.title }}"/>
  93. {{ row.title }}
  94. {% if row.edit_actions != '' %}
  95. <div class="pull-right">
  96. <a class="btn btn-default btn-sm" href="{{ row.edit_actions }}">
  97. <i class="fa fa-pencil" aria-hidden="true"></i>
  98. </a>
  99. </div>
  100. {% endif %}
  101. </div>
  102. <div class="panel-body">
  103. {% if row.description != '' %}
  104. {{ row.description }}
  105. {% endif %}
  106. <ul class="info-session list-inline">
  107. {% if row.coach_name %}
  108. <li>
  109. <i class="fa fa-user" aria-hidden="true"></i>
  110. {{ row.coach_name }}
  111. </li>
  112. {% endif %}
  113. <li>
  114. <i class="fa fa-calendar" aria-hidden="true"></i>
  115. {{ row.date ? row.date : row.duration }}
  116. </li>
  117. </ul>
  118. <div class="grid-courses">
  119. {% if not group_courses %}
  120. <div class="row">
  121. {% for item in row.courses %}
  122. {{ blocks.course_block(item, true) }}
  123. {% endfor %}
  124. </div>
  125. {% else %}
  126. {% for category_code in row.course_categories %}
  127. <div class="row">
  128. <div class="col-xs-12">
  129. <h4>{{ category_code }}</h4>
  130. </div>
  131. {% for course in row.courses %}
  132. {% if course.category == category_code %}
  133. {{ blocks.course_block(course, false) }}
  134. {% endif %}
  135. {% endfor %}
  136. </div>
  137. {% endfor %}
  138. {% endif %}
  139. </div>
  140. </div>
  141. </div>
  142. {% endfor %}