index.html.twig 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {% set admin_chamilo_announcements_disable = 'admin_chamilo_announcements_disable'|api_get_configuration_value %}
  2. {% block content %}
  3. {% autoescape false %}
  4. {% if not admin_chamilo_announcements_disable %}
  5. <div class="alert alert-info alert-dismissible fade show d-none" role="alert">
  6. <button type="button" class="close" data-dismiss="alert" aria-label="{{ 'Close'|trans }}">
  7. <span aria-hidden="true">&times;</span>
  8. </button>
  9. <div id="chamilo-news-content"></div>
  10. </div>
  11. {% endif %}
  12. <div id="settings">
  13. <div class="list-settings">
  14. {% for block_item in blocks_admin %}
  15. <div id="tabs-{{ loop.index }}" class="item-setting">
  16. <div class="card mb-3">
  17. <div class="card-header">
  18. <h5 class="card-title">{{ block_item.icon }} {{ block_item.label }}</h5>
  19. </div>
  20. <div class="card-body">
  21. <div class="card-search">
  22. {{ block_item.search_form }}
  23. </div>
  24. <div class="card-description mp-3 mb-3">
  25. {{ block_item.description }}
  26. </div>
  27. {% if block_item.items is not empty %}
  28. <ul class="list-group">
  29. {% for url in block_item.items %}
  30. {% if url.url is not empty %}
  31. <li class="list-group-item">
  32. <a href="{{ url.url }}">
  33. {{ url.label }}
  34. </a>
  35. </li>
  36. {% endif %}
  37. {% endfor %}
  38. </ul>
  39. {% endif %}
  40. {% if block_item.extra is not null %}
  41. <div>
  42. {{ block_item.extra }}
  43. </div>
  44. {% endif %}
  45. </div>
  46. </div>
  47. </div>
  48. {% endfor %}
  49. </div>
  50. <div class="row">
  51. {% for role in app.user.roles %}
  52. {% set role = role | lower | replace ({ 'role_' : ''}) %}
  53. {% if role in ['global_admin'] %}
  54. {% include '@ChamiloTheme/Admin/' ~ role ~ '/role_index.html.twig' %}
  55. {% endif %}
  56. {% endfor %}
  57. </div>
  58. </div>
  59. {% if is_granted('ROLE_ADMIN') %}
  60. <script>
  61. $(function () {
  62. $.ajax({
  63. url: '{{ web_admin_ajax_url }}?a=version',
  64. success: function (version) {
  65. $(".admin-block-version").html(version);
  66. }
  67. });
  68. {% if not admin_chamilo_announcements_disable %}
  69. $('#chamilo-news-content').load(
  70. '{{ web_admin_ajax_url }}?a=get_latest_news',
  71. function (response) {
  72. if (!response.length) {
  73. return;
  74. }
  75. $(this).parent().removeClass('d-none');
  76. }
  77. );
  78. {% endif %}
  79. });
  80. </script>
  81. {% endif %}
  82. {% endautoescape %}
  83. {% endblock %}