list.tpl 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {% import 'default/macro/macro.tpl' as display %}
  2. {% extends 'layout/layout_1_col.tpl'|get_template %}
  3. {% block content %}
  4. {% if 'translate_html'|api_get_configuration_value %}
  5. <script>
  6. $(document).ready(function () {
  7. // default
  8. $('.category-forum ').hide();
  9. {% if default_user_language %}
  10. $('.{{ default_user_language }}').show();
  11. {% endif %}
  12. $('#extra_language').attr('data-width', '200px');
  13. $('#extra_language option[value=""]').text('{{ 'Any' | get_lang | escape('js') }}');
  14. $('#extra_language').on('change', function() {
  15. var selectedLanguageArray = $(this).val();
  16. $('.category-forum ').hide();
  17. $.each(selectedLanguageArray, function(index, selectedLanguage) {
  18. if (selectedLanguage == '') {
  19. $('.category-forum ').show();
  20. } else {
  21. $('.'+ selectedLanguage).show();
  22. }
  23. });
  24. });
  25. });
  26. </script>
  27. {% endif %}
  28. {{ form_content }}
  29. {{ search_filter }}
  30. {% set fold_forum_categories = 'forum_fold_categories'|api_get_configuration_value %}
  31. {% if data is not empty %}
  32. {% for item in data %}
  33. {% set category_language_array = [] %}
  34. {% set category_language = '' %}
  35. {% for extra_field in item.extra_fields %}
  36. {% if extra_field.variable == 'language' %}
  37. {% set category_language_array = extra_field.value | split(';') %}
  38. {% set category_language = extra_field.value | replace({';': ' ' }) %}
  39. {% endif %}
  40. {% endfor %}
  41. {% if fold_forum_categories %}
  42. {% set panel_icon %}
  43. <a href="{{ item.url }}" title="{{ item.title }}">
  44. <span class="open">{{ 'forum_blue.png'|img(32) }}</span>
  45. </a>
  46. {% endset %}
  47. {% set panel_title %}
  48. {{ item.title }}{{ item.icon_session }}
  49. {% for category_language_item in category_language_array %}
  50. <span class="flag-icon flag-icon-{{ languages[category_language_item | lower] }}"></span>
  51. {% endfor %}
  52. {% endset %}
  53. {% else %}
  54. {% set panel_title %}
  55. <a href="{{ item.url }}" title="{{ item.title }}">
  56. <span class="open">{{ 'forum_blue.png'|img(32) }}</span>
  57. {{ item.title }}{{ item.icon_session }}
  58. </a>
  59. {% for category_language_item in category_language_array %}
  60. <span class="flag-icon flag-icon-{{ languages[category_language_item | lower] }}"></span>
  61. {% endfor %}
  62. <div class="pull-right">
  63. {{ item.tools }}
  64. </div>
  65. {% endset %}
  66. {% endif %}
  67. {% set panel_content %}
  68. <div class="forum-description">
  69. {{ item.description }}
  70. </div>
  71. {% for subitem in item.forums %}
  72. <div class="forum_display">
  73. <div class="panel panel-default forum">
  74. <div class="panel-body">
  75. <div class="row">
  76. <div class="col-xs-4 col-md-3">
  77. <div class="number-post">
  78. <a href="{{ forum.url }}" title="{{forum.title}}">
  79. {% if subitem.forum_image is not empty %}
  80. <img src="{{ subitem.forum_image }}" width="48px">
  81. {% else %}
  82. {% if subitem.forum_of_group == 0 %}
  83. {{ 'forum_group.png'|img(48) }}
  84. {% else %}
  85. {{ 'forum.png'|img(48) }}
  86. {% endif %}
  87. {% endif %}
  88. </a>
  89. <p>{{ 'ForumThreads'| get_lang }}: {{ subitem.number_threads }} </p>
  90. </div>
  91. </div>
  92. <div class="col-xs-8 col-md-9">
  93. <div class="pull-right">
  94. <div class="toolbar">
  95. {{ subitem.tools }}
  96. </div>
  97. </div>
  98. <h3 class="title">
  99. {{ 'forum_yellow.png'|img(32) }}
  100. <a href="{{ subitem.url }}" title="{{ subitem.title }}" class="{{ subitem.visibility != '1' ? 'text-muted': '' }}">{{ subitem.title }}</a>
  101. {% if subitem.forum_of_group != 0 %}
  102. <a class="forum-goto" href="../group/group_space.php?{{ _p.web_cid_query }}&gidReq={{ subitem.forum_of_group }}">
  103. {{ "forum.png"|img(22) }} {{ "GoTo"|get_lang }} {{ subitem.forum_group_title }}
  104. </a>
  105. {% endif %}
  106. {{ subitem.icon_session }}
  107. </h3>
  108. {% if subitem.last_poster_id is not empty %}
  109. <div class="forum-date">
  110. <i class="fa fa-comments" aria-hidden="true"></i>
  111. {{ subitem.last_poster_date }}
  112. « {{ subitem.last_post_title }} »
  113. {{ "By"|get_lang }}
  114. {{ subitem.last_poster_user }}
  115. </div>
  116. {% endif %}
  117. <div class="description">
  118. {{ subitem.description }}
  119. </div>
  120. {{ subitem.last_post_text }}
  121. {{ subitem.alert }}
  122. {% if subitem.moderation is not empty %}
  123. <span class="label label-warning">
  124. {{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }}
  125. </span>
  126. {% endif %}
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. {% endfor %}
  133. {% endset %}
  134. <div class="category-forum {{ category_language }}" id="category_{{ item.id }}">
  135. {% if fold_forum_categories %}
  136. {{ display.collapse('category_' ~ item.id, panel_title, panel_content, false, fold_forum_categories, item.tools, panel_icon ) }}
  137. {% else %}
  138. {{ display.panel(panel_title, panel_content) }}
  139. {% endif %}
  140. </div>
  141. {% endfor %}
  142. {% else %}
  143. <div class="alert alert-warning">
  144. {{ 'NoForumInThisCategory'|get_lang }}
  145. </div>
  146. {% endif %}
  147. {% endblock %}