global_list.tpl 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {% extends 'layout/layout_1_col.tpl'|get_template %}
  2. {% block content %}
  3. {% if 'translate_html'|api_get_configuration_value %}
  4. <script>
  5. $(document).ready(function () {
  6. // default
  7. $('.category-forum ').hide();
  8. $('.{{ default_user_language }}').show();
  9. $('#extra_language').attr('data-width', '200px');
  10. $('#extra_language option[value=""]').text('{{ 'Any' | get_lang | escape('js') }}');
  11. $('#extra_language').on('change', function() {
  12. var selectedLanguageArray = $(this).val();
  13. $('.category-forum ').hide();
  14. $.each(selectedLanguageArray, function(index, selectedLanguage) {
  15. if (selectedLanguage == '') {
  16. $('.category-forum ').show();
  17. } else {
  18. $('.'+ selectedLanguage).show();
  19. }
  20. });
  21. });
  22. });
  23. </script>
  24. {% endif %}
  25. {{ form_content }}
  26. {{ search_filter }}
  27. {% if data is not empty %}
  28. {% for item in data %}
  29. {% set category_language_array = [] %}
  30. {% set category_language = '' %}
  31. {% for extra_field in item.extra_fields %}
  32. {% if extra_field.variable == 'language' %}
  33. {% set category_language_array = extra_field.value | split(';') %}
  34. {% set category_language = extra_field.value | replace({';': ' ' }) %}
  35. {% endif %}
  36. {% endfor %}
  37. <div class="category-forum {{ category_language }}" id="category_{{ item.id }}">
  38. <div class="pull-right">
  39. {{ item.tools }}
  40. </div>
  41. <h3>
  42. {{ 'forum_blue.png'|img(32) }}
  43. <a href="{{ item.url }}" title="{{ item.title }}">{{ item.title }}{{ item.icon_session }}</a>
  44. {% for category_language_item in category_language_array %}
  45. <span class="flag-icon flag-icon-{{ languages[category_language_item | lower] }}"></span>
  46. {% endfor %}
  47. </h3>
  48. <div class="forum-description">
  49. {{ item.description }}
  50. </div>
  51. {% for subitem in item.forums %}
  52. <div class="forum_display">
  53. <div class="panel panel-default forum">
  54. <div class="panel-body">
  55. <div class="row">
  56. <div class="col-md-12">
  57. <div class="pull-right">
  58. <div class="toolbar">
  59. {{ subitem.tools }}
  60. </div>
  61. </div>
  62. <h3 class="title">
  63. {{ 'forum_yellow.png'|img(32) }}
  64. <a href="{{ subitem.url }}" title="{{ subitem.title }}" class="{{ subitem.visibility != '1' ? 'text-muted': '' }}">{{ subitem.title }}</a>
  65. {% if subitem.forum_of_group != 0 %}
  66. <a class="forum-goto" href="../group/group_space.php?{{ _p.web_cid_query }}&gidReq={{ subitem.forum_of_group }}">
  67. {{ "forum.png"|img(22) }} {{ "GoTo"|get_lang }} {{ subitem.forum_group_title }}
  68. </a>
  69. {% endif %}
  70. {{ subitem.icon_session }}
  71. </h3>
  72. {% if subitem.last_poster_id is not empty %}
  73. <div class="forum-date">
  74. <i class="fa fa-comments" aria-hidden="true"></i>
  75. {{ subitem.last_poster_date }}
  76. « {{ subitem.last_post_title }} »
  77. {{ "By"|get_lang }}
  78. {{ subitem.last_poster_user }}
  79. </div>
  80. {% endif %}
  81. <div class="description">
  82. {{ subitem.description }}
  83. </div>
  84. {{ subitem.last_post_text }}
  85. {{ subitem.alert }}
  86. {% if subitem.moderation is not empty %}
  87. <span class="label label-warning">
  88. {{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }}
  89. </span>
  90. {% endif %}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. {% endfor %}
  97. </div>
  98. {% endfor %}
  99. {% else %}
  100. <div class="alert alert-warning">
  101. {{ 'NoForumInThisCategory'|get_lang }}
  102. </div>
  103. {% endif %}
  104. {% endblock %}