You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
7.8 KiB
156 lines
7.8 KiB
{% extends "@ChamiloCore/Layout/layout_one_col.html.twig" %}
|
|
{% import '@ChamiloCore/Macros/box.html.twig' as display %}
|
|
|
|
{% block content %}
|
|
{% autoescape false %}
|
|
{% if 'editor.translate_html'|api_get_setting == 'true' %}
|
|
<script>
|
|
$(function () {
|
|
// default
|
|
$('.category-forum ').hide();
|
|
|
|
{% if default_user_language %}
|
|
$('.{{ default_user_language }}').show();
|
|
{% endif %}
|
|
|
|
$('#extra_language').attr('data-width', '200px');
|
|
$('#extra_language option[value=""]').text('{{ 'Any' | trans | escape('js') }}');
|
|
$('#extra_language').on('change', function() {
|
|
var selectedLanguageArray = $(this).val();
|
|
$('.category-forum ').hide();
|
|
$.each(selectedLanguageArray, function(index, selectedLanguage) {
|
|
if (selectedLanguage == '') {
|
|
$('.category-forum ').show();
|
|
} else {
|
|
$('.'+ selectedLanguage).show();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
{% endif %}
|
|
|
|
{{ form_content }}
|
|
{{ search_filter }}
|
|
|
|
{% set fold_forum_categories = 'forum_fold_categories'|api_get_configuration_value %}
|
|
|
|
{% if categories is not empty %}
|
|
{% for item in categories %}
|
|
{% set category_language_array = [] %}
|
|
{% set category_language = '' %}
|
|
{% if item.extra_fields is defined %}
|
|
{% for extra_field in item.extra_fields %}
|
|
{% if extra_field.variable == 'language' %}
|
|
{% set category_language_array = extra_field.value | split(';') %}
|
|
{% set category_language = extra_field.value | replace({';': ' ' }) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if fold_forum_categories %}
|
|
{% set panel_icon %}
|
|
<a href="{{ item.url }}" title="{{ item.title }}">
|
|
<span class="open">{{ 'forum_blue.png'|img(32) }}</span>
|
|
</a>
|
|
{% endset %}
|
|
|
|
{% set panel_title %}
|
|
{{ item.title }}{{ item.icon_session }}
|
|
{% for category_language_item in category_language_array %}
|
|
<span class="flag-icon flag-icon-{{ languages[category_language_item | lower] }}"></span>
|
|
{% endfor %}
|
|
{% endset %}
|
|
{% else %}
|
|
{% set panel_title %}
|
|
<a href="{{ item.url }}" title="{{ item.title }}" class="flex flex-row gap-2">
|
|
<span class="open">{{ 'forum_blue.png'|img(32) }}</span>
|
|
{{ item.title }}{{ item.icon_session }}
|
|
</a>
|
|
{% for category_language_item in category_language_array %}
|
|
<span class="flag-icon flag-icon-{{ languages[category_language_item | lower] }}"></span>
|
|
{% endfor %}
|
|
<div class="pull-right">
|
|
{{ item.tools }}
|
|
</div>
|
|
{% endset %}
|
|
{% endif %}
|
|
|
|
{% set panel_content %}
|
|
<div class="forum-description">
|
|
{{ item.description }}
|
|
</div>
|
|
{% for subitem in item.forums %}
|
|
<div class="forum_display w-full">
|
|
<div class="card">
|
|
<div class="flex flex-row">
|
|
<div class="w-1/5">
|
|
<div class="number-post">
|
|
<a href="{{ subitem.url }}" title="{{subitem.title}}">
|
|
{% if subitem.forum_image is not empty %}
|
|
<img src="{{ subitem.forum_image }}" width="48px">
|
|
{% else %}
|
|
{% if subitem.forum_of_group == 0 %}
|
|
{{ 'forum_group.png'|img(48) }}
|
|
{% else %}
|
|
{{ 'forum.png'|img(48) }}
|
|
{% endif %}
|
|
{% endif %}
|
|
</a>
|
|
{# <p>{{ 'Forum threads'| trans }}: {{ subitem.number_threads }} </p>#}
|
|
</div>
|
|
</div>
|
|
<div class="w-4/5 flex flex-row justify-between">
|
|
<h3 class="text-lg flex flex-row">
|
|
{{ 'forum_yellow.png'|img(32) }}
|
|
<a href="{{ subitem.url }}" title="{{ subitem.title }}" class="{{ subitem.visibility != '1' ? 'text-muted': '' }}">{{ subitem.title }}</a>
|
|
{# {% if subitem.forum_of_group != 0 %}#}
|
|
{# <a class="forum-goto" href="../group/group_space.php?cid={{ course.id }}&sid={{ session.id }}&gid={{ subitem.forum_of_group }}">#}
|
|
{# {{ "forum.png"|img(22) }} {{ "Go to"|trans }} {{ subitem.forum_group_title }}#}
|
|
{# </a>#}
|
|
{# {% endif %}#}
|
|
{{ subitem.icon_session }}
|
|
</h3>
|
|
{% if subitem.last_poster_id is not empty %}
|
|
<div class="forum-date">
|
|
{{ 'comment' | mdi_icon }}
|
|
{{ subitem.last_poster_date }}
|
|
« {{ subitem.last_post_title }} »
|
|
{{ "By"|trans }}
|
|
{{ subitem.last_poster_user }}
|
|
</div>
|
|
{% endif %}
|
|
<div class="description">
|
|
{{ subitem.description }}
|
|
</div>
|
|
|
|
<div class="pull-right">
|
|
{{ subitem.tools }}
|
|
</div>
|
|
{{ subitem.alert }}
|
|
{% if subitem.moderation is defined and subitem.moderation is not empty %}
|
|
<span class="label label-warning">
|
|
{{ "Posts pending moderation"|trans }}: {{ subitem.moderation }}
|
|
</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% endset %}
|
|
<div class="category-forum {{ category_language }}" id="category_{{ item.id }}">
|
|
{% if fold_forum_categories %}
|
|
{{ display.collapse('category_' ~ item.id, panel_title, panel_content, false, fold_forum_categories, item.tools, panel_icon ) }}
|
|
{% else %}
|
|
{{ display.panel(panel_title, panel_content) }}
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<div class="alert alert-warning">
|
|
{{ 'There are no forums in this category'|trans }}
|
|
</div>
|
|
{% endif %}
|
|
{% endautoescape %}
|
|
{% endblock %}
|
|
|