grid_session.tpl 6.5 KB

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