list_courses.html.twig 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {% import '@ChamiloTheme/Macros/box.html.twig' as macro %}
  2. {% autoescape false %}
  3. {% if not courses is empty %}
  4. <div class="grid-course">
  5. {% for item in courses %}
  6. {% set image %}
  7. {% if item.category %}
  8. <div class="category" style="background: {{ item.color.color }}; color:{{ item.color.luminosity }}">
  9. {{ item.category }}
  10. </div>
  11. {% endif %}
  12. {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') and not item.current_user_is_teacher %}
  13. {% if item.image != '' %}
  14. <img src="{{ item.image }}" title="{{ item.title }}"
  15. alt="{{ item.title }}" class="img-fluid"/>
  16. {% else %}
  17. {{ 'blackboard.png' | img(48, item.title ) }}
  18. {% endif %}
  19. {% else %}
  20. <a href="{{ item.link }}">
  21. {% if item.image != '' %}
  22. <img src="{{ item.image }}" title="{{ item.title }}"
  23. alt="{{ item.title }}" class="img-fluid"/>
  24. {% else %}
  25. {{ 'blackboard.png' | img(48, item.title ) }}
  26. {% endif %}
  27. </a>
  28. {% endif %}
  29. {% endset %}
  30. {% set title %}
  31. {% if item.edit_actions != '' %}
  32. <div class="float-right">
  33. {% if item.document == '' %}
  34. <a class="btn btn-outline-primary btn-sm" href="{{ item.edit_actions }}">
  35. <i class="fas fa-pencil-alt"></i>
  36. </a>
  37. {% else %}
  38. <div class="btn-group" role="group">
  39. <a class="btn btn-outline-primary btn-sm" href="{{ item.edit_actions }}">
  40. <i class="fas fa-pencil-alt"></i>
  41. </a>
  42. {{ item.document }}
  43. </div>
  44. {% endif %}
  45. </div>
  46. {% endif %}
  47. <h5 class="title mt-2">
  48. {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') and not item.current_user_is_teacher %}
  49. {{ item.title }} {{ item.code_course }}
  50. {% else %}
  51. <a href="{{ item.link }}">
  52. {{ item.title }} {{ item.code_course }}
  53. </a>
  54. {{ item.notifications }}
  55. {% if item.is_special_course %}
  56. {{ 'klipper.png' | img(22, 'CourseAutoRegister'|get_lang ) }}
  57. {% endif %}
  58. {% endif %}
  59. </h5>
  60. {% endset %}
  61. {% set content %}
  62. <div class="list-teachers">
  63. {% if item.teachers|length > 0 %}
  64. <i class="fas fa-user-tie"></i>
  65. {% for teacher in item.teachers %}
  66. {% set counter = counter + 1 %}
  67. {% if counter > 1 %} | {% endif %}
  68. <a href="{{ teacher.url }}" class="ajax"
  69. data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
  70. {{ teacher.firstname }} {{ teacher.lastname }}
  71. </a>
  72. {% endfor %}
  73. {% endif %}
  74. </div>
  75. <div class="student-progress">
  76. {% if item.student_info %}
  77. {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %}
  78. <div class="course-student-info">
  79. <div class="student-info">
  80. {% if (item.student_info.progress is not null) %}
  81. {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }}
  82. {% endif %}
  83. {% if (item.student_info.score is not null) %}
  84. {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }}
  85. {% endif %}
  86. {% if (item.student_info.certificate is not null) %}
  87. {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }}
  88. {% endif %}
  89. </div>
  90. </div>
  91. {% endif %}
  92. {% endif %}
  93. </div>
  94. {% endset %}
  95. <div class="item-course">
  96. {{ macro.box_course_classic(item.course_id, title, content, image, item.is_special_course) }}
  97. </div>
  98. {% endfor %}
  99. </div>
  100. {% endif %}
  101. {% endautoescape %}