upgrade
This commit is contained in:
111
main/template/default/forum/global_list.tpl
Normal file
111
main/template/default/forum/global_list.tpl
Normal file
@@ -0,0 +1,111 @@
|
||||
{% extends 'layout/layout_1_col.tpl'|get_template %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
{% if 'allow_forum_category_language_filter'|api_get_configuration_value %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// default
|
||||
$('.category-forum ').hide();
|
||||
$('.{{ default_user_language }}').show();
|
||||
$('#extra_language').attr('data-width', '200px');
|
||||
$('#extra_language option[value=""]').text('{{ 'Any' | get_lang | 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 }}
|
||||
|
||||
{% if data is not empty %}
|
||||
{% for item in data %}
|
||||
{% set category_language_array = [] %}
|
||||
{% set category_language = '' %}
|
||||
{% 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 %}
|
||||
|
||||
<div class="category-forum {{ category_language }}" id="category_{{ item.id }}">
|
||||
<div class="pull-right">
|
||||
{{ item.tools }}
|
||||
</div>
|
||||
<h3>
|
||||
{{ 'forum_blue.png'|img(32) }}
|
||||
<a href="{{ item.url }}" title="{{ item.title }}">{{ 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 %}
|
||||
</h3>
|
||||
<div class="forum-description">
|
||||
{{ item.description }}
|
||||
</div>
|
||||
{% for subitem in item.forums %}
|
||||
<div class="forum_display">
|
||||
<div class="panel panel-default forum">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-right">
|
||||
<div class="toolbar">
|
||||
{{ subitem.tools }}
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="title">
|
||||
{{ '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?{{ _p.web_cid_query }}&gidReq={{ subitem.forum_of_group }}">
|
||||
{{ "forum.png"|img(22) }} {{ "GoTo"|get_lang }} {{ subitem.forum_group_title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{{ subitem.icon_session }}
|
||||
</h3>
|
||||
{% if subitem.last_poster_id is not empty %}
|
||||
<div class="forum-date">
|
||||
<i class="fa fa-comments" aria-hidden="true"></i>
|
||||
{{ subitem.last_poster_date }}
|
||||
« {{ subitem.last_post_title }} »
|
||||
{{ "By"|get_lang }}
|
||||
{{ subitem.last_poster_user }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="description">
|
||||
{{ subitem.description }}
|
||||
</div>
|
||||
|
||||
{{ subitem.last_post_text }}
|
||||
|
||||
{{ subitem.alert }}
|
||||
{% if subitem.moderation is not empty %}
|
||||
<span class="label label-warning">
|
||||
{{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
{{ 'NoForumInThisCategory'|get_lang }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
167
main/template/default/forum/list.tpl
Normal file
167
main/template/default/forum/list.tpl
Normal file
@@ -0,0 +1,167 @@
|
||||
{% import 'default/macro/macro.tpl' as display %}
|
||||
{% extends 'layout/layout_1_col.tpl'|get_template %}
|
||||
|
||||
{% block content %}
|
||||
{% if 'allow_forum_category_language_filter'|api_get_configuration_value %}
|
||||
<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' | get_lang | 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 data is not empty %}
|
||||
{% for item in data %}
|
||||
{% set category_language_array = [] %}
|
||||
{% set category_language = '' %}
|
||||
{% 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 %}
|
||||
|
||||
{% if fold_forum_categories %}
|
||||
{% set panel_icon %}
|
||||
<a href="{{ item.url }}" title="{{ item.title | remove_xss }}">
|
||||
<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 }}">
|
||||
<span class="open">{{ 'forum_blue.png'|img(32) }}</span>
|
||||
{{ item.title | remove_xss }}
|
||||
{{ 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">
|
||||
<div class="panel panel-default forum">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<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>{{ 'ForumThreads'| get_lang }}: {{ subitem.number_threads }} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8 col-md-9">
|
||||
<div class="pull-right">
|
||||
<div class="toolbar">
|
||||
{{ subitem.tools }}
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="title">
|
||||
{{ 'forum_yellow.png'|img(32) }}
|
||||
<a
|
||||
href="{{ subitem.url }}"
|
||||
title="{{ subitem.title | remove_xss }}"
|
||||
class="{{ subitem.visibility != '1' ? 'text-muted': '' }}"
|
||||
>
|
||||
{{ subitem.title | remove_xss }}
|
||||
</a>
|
||||
{% if subitem.forum_of_group != 0 %}
|
||||
<a class="forum-goto" href="../group/group_space.php?{{ _p.web_cid_query }}&gidReq={{ subitem.forum_of_group }}">
|
||||
{{ "forum.png"|img(22) }} {{ "GoTo"|get_lang }} {{ subitem.forum_group_title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{{ subitem.icon_session }}
|
||||
</h3>
|
||||
{% if subitem.last_poster_id is not empty %}
|
||||
<div class="forum-date">
|
||||
<i class="fa fa-comments" aria-hidden="true"></i>
|
||||
{{ subitem.last_poster_date }}
|
||||
« {{ subitem.last_post_title }} »
|
||||
{{ "By"|get_lang }}
|
||||
{{ subitem.last_poster_user }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="description">
|
||||
{{ subitem.description | remove_xss }}
|
||||
</div>
|
||||
|
||||
{{ subitem.last_post_text }}
|
||||
{{ subitem.alert }}
|
||||
|
||||
{% if subitem.moderation is not empty %}
|
||||
<span class="label label-warning">
|
||||
{{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</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">
|
||||
{{ 'NoForumInThisCategory'|get_lang }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
69
main/template/default/forum/posts.tpl
Normal file
69
main/template/default/forum/posts.tpl
Normal file
@@ -0,0 +1,69 @@
|
||||
{% import 'default/macro/macro.tpl' as display %}
|
||||
{% extends 'layout/layout_1_col.tpl'|get_template %}
|
||||
|
||||
{% block content %}
|
||||
{% if origin == 'learnpath' %}
|
||||
<div style="height:15px"> </div>
|
||||
{% endif %}
|
||||
|
||||
{% if forum_actions %}
|
||||
<div class="actions">
|
||||
{{ forum_actions }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for post in posts %}
|
||||
{% set post_data %}
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
{{ post.user_data }}
|
||||
</div>
|
||||
{% set highlight = '' %}
|
||||
{% if post.current %}
|
||||
{% set highlight = 'alert alert-danger' %}
|
||||
{% endif %}
|
||||
|
||||
{% set highlight_revision = '' %}
|
||||
{% if post.is_a_revision %}
|
||||
{% set highlight_revision = 'forum_revision' %}
|
||||
{% endif %}
|
||||
|
||||
<div class="col-md-10 {{ highlight }} ">
|
||||
{{ post.post_title }}
|
||||
|
||||
{% if post.is_a_revision %}
|
||||
{{ 'ProposedRevision' | get_lang }} {{ post.flag_revision }}
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ highlight_revision }} ">
|
||||
{{ post.post_data }}
|
||||
</div>
|
||||
|
||||
{{ post.post_attachments }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-8 text-right">
|
||||
{{ post.post_buttons }}
|
||||
</div>
|
||||
</div>
|
||||
{% endset %}
|
||||
|
||||
{% if view_mode == 'nested' %}
|
||||
<div class="col-md-offset-{{ post.indent_cnt }} forum-post">
|
||||
{{ display.panel('', post_data) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-md-12 forum-post">
|
||||
{{ display.panel('', post_data) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{ form }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user