Skip to content
Permalink
Browse files

add forum_fold_categories -refs BT#15317

  • Loading branch information...
aragonc committed Feb 22, 2019
1 parent 952bb3e commit 28657267ab690f40b52e522968ee2eb69a1dc14b
@@ -3012,6 +3012,18 @@ form .formw .freeze {
font-size: 11px;
}

.btn-collapse.collapsed .open{
display: none;
}
.btn-collapse.collapsed .closed{
display: inline-block;
}
.btn-collapse .closed{
display: none;
}
.btn-collapse .open{
display: inline-block;
}
/* ****************************************************
CSS SKILL
**************************************************** */
@@ -531,8 +531,10 @@ function hidecontent(content){
$listForumCategory[] = $forumCategoryInfo;
}
}
$tpl = new Template($nameTools);
if(api_get_configuration_value('forum_fold_categories')==true){
$tpl->assign('forum_fold_categories', true);
}

This comment has been minimized.

Copy link
@AngelFQC

AngelFQC Feb 25, 2019

Member

api_get_configuration_value puede ser usado directamente desde Twig, no es necesario pasar una variable

This comment has been minimized.

Copy link
@aragonc

aragonc Feb 25, 2019

Author Member

@AngelFQC Yo recien me entero

This comment has been minimized.

Copy link
@aragonc

aragonc Feb 25, 2019

Author Member

Corregido

$tpl->assign('introduction', $introduction);
$tpl->assign('actions', $actions);
$tpl->assign('data', $listForumCategory);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 128 128"
id="svg21921"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="forum_blue_closed.svg">
<defs
id="defs21923" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4300781"
inkscape:cx="152.58194"
inkscape:cy="-14.229454"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1366"
inkscape:window-height="713"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata21926">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-924.36216)">
<g
id="g870"
inkscape:export-filename="/var/www/chamilo/main/img/icons/32/forum_blue_closed.png"
inkscape:export-xdpi="24"
inkscape:export-ydpi="24">
<rect
style="opacity:1;fill:#ffffff;fill-opacity:0;stroke:none;stroke-width:10.80000019;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect23648"
width="128"
height="128"
x="-4.0039064e-05"
y="924.36218"
ry="0" />
<g
style="fill:#006680"
id="g23654"
transform="matrix(0.31249508,0,0,0.31249508,-14.789403,915.83915)">
<path
style="fill:#006680;fill-opacity:1"
inkscape:connector-curvature="0"
d="m 426.2,143.3 c -0.5,-12.4 -4.5,-15.3 -15.1,-15.3 0,0 -121.4,0 -143.2,0 -21.8,0 -24.4,0.3 -40.9,-17.4 C 213.3,95.8 218.7,96 190.4,96 c -22.6,0 -75.3,0 -75.3,0 -17.4,0 -23.6,-1.5 -25.2,16.6 -1.5,16.7 -5,57.2 -5.5,63.4 h 343.4 z"
id="path23656" />
</g>
<path
style="fill:#00aad4;fill-opacity:1;stroke-width:4.27218676"
inkscape:connector-curvature="0"
d="M 118.396,957.69153 H 9.58524 c -5.53116,0 -5.81244,3.27954 -5.49992,7.30766 l 4.06244,65.23411 c 0.2812,3.9925 1.09372,7.3077 6.59364,7.3077 h 98.81096 c 5.62488,0 6.28112,-3.2796 6.59364,-7.3077 l 3.78116,-66.05397 c 0.2812,-3.99249 0,-6.4878 -5.53116,-6.4878 z"
id="path23652" />
<path
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:12.35786629;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 91.96664,999.14568 c 0,3.94132 -1.13192,7.61962 -3.826,10.72992 -2.05288,3.6417 -4.78376,6.7319 -2.47344,16.908 -8.89924,-2.0502 -13.80664,-4.3751 -16.52932,-6.9664 -1.47632,0.1744 -3.54332,0.2148 -5.08776,0.2148 -15.44552,0 -28.01684,-9.7112 -28.01684,-20.8862 0,-11.17496 12.52116,-20.23404 27.96668,-20.23404 15.4456,0 27.96668,9.05908 27.96668,20.23404 z"
id="path23660"
inkscape:connector-curvature="0"
sodipodi:nodetypes="scccssss" />
<g
id="g23662"
transform="matrix(3.6363636,0,0,3.6363636,-993.8486,97.951256)"
style="fill:#00aad4;fill-opacity:1">
<path
inkscape:connector-curvature="0"
id="path23664"
d="m 288.5625,247.98715 a 1.03125,1.03125 0 0 1 -1.03125,1.03125 1.03125,1.03125 0 0 1 -1.03125,-1.03125 1.03125,1.03125 0 0 1 1.03125,-1.03125 1.03125,1.03125 0 0 1 1.03125,1.03125 z"
style="opacity:1;fill:#00aad4;fill-opacity:1;stroke:none;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
style="opacity:1;fill:#00aad4;fill-opacity:1;stroke:none;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 292.09375,247.98715 a 1.03125,1.03125 0 0 1 -1.03125,1.03125 1.03125,1.03125 0 0 1 -1.03125,-1.03125 1.03125,1.03125 0 0 1 1.03125,-1.03125 1.03125,1.03125 0 0 1 1.03125,1.03125 z"
id="path23666"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path23668"
d="m 295.625,247.98715 a 1.03125,1.03125 0 0 1 -1.03125,1.03125 1.03125,1.03125 0 0 1 -1.03125,-1.03125 1.03125,1.03125 0 0 1 1.03125,-1.03125 1.03125,1.03125 0 0 1 1.03125,1.03125 z"
style="opacity:1;fill:#00aad4;fill-opacity:1;stroke:none;stroke-width:2.70000005;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</g>
</svg>
@@ -1,22 +1,109 @@
{% extends 'layout/layout_1_col.tpl'|get_template %}
{% block content %}

{{ form_content }}

{% if data is not empty %}
{% for item in data %}
<div class="category-forum" id="category_{{ item.id }}">
<div class="pull-right">
{{ item.tools }}
{% if(forum_fold_categories == true) %}
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
{% for item in data %}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading_{{ item.id }}">
<div class="pull-right">
{{ item.tools }}
</div>
<h4 class="panel-title">
<a class="btn-collapse collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse_{{ item.id }}" aria-expanded="true" aria-controls="collapse_{{ item.id }}">
<span class="closed">{{ 'forum_blue_closed.png'|img(32) }}</span>
<span class="open">{{ 'forum_blue.png'|img(32) }}</span>
</a>
<a href="{{ item.url }}" title="{{ item.title }}">{{ item.title }}{{ item.icon_session }}</a>
</h4>

</div>
<h3>
{{ 'forum_blue.png'|img(32) }}
<a href="{{ item.url }}" title="{{ item.title }}">{{ item.title }}{{ item.icon_session }}</a>
</h3>
<div class="forum-description">
{{ item.description }}
<div id="collapse_{{ item.id }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading_{{ item.id }}">

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Mar 8, 2019

Member

Por favor usar macros y no código HTML, toda esa lógica ya está implementada.

<div class="panel-body">
<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-3">
<div class="number-post">
<a href="{{ forum.url }}" title="{{forum.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-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 }}" 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 }}
{{ "By"|get_lang }}
{{ subitem.last_poster_user }}
</div>
{% endif %}
<div class="description">
{{ subitem.description }}
</div>
{{ 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>
</div>
</div>
{% endfor %}
</div>
{% else %}
{% for item in data %}
<div class="category-forum" 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>
</h3>
<div class="forum-description">
{{ item.description }}
</div>
</div>
{% for subitem in item.forums %}
<div class="forum_display">
<div class="panel panel-default forum">
@@ -25,15 +112,15 @@
<div class="col-md-3">
<div class="number-post">
<a href="{{ forum.url }}" title="{{forum.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) }}
{% if subitem.forum_image is not empty %}
<img src="{{ subitem.forum_image }}" width="48px">
{% else %}
{{ 'forum.png'|img(48) }}
{% if subitem.forum_of_group == 0 %}
{{ 'forum_group.png'|img(48) }}
{% else %}
{{ 'forum.png'|img(48) }}
{% endif %}
{% endif %}
{% endif %}
</a>
<p>{{ 'ForumThreads'| get_lang }}: {{ subitem.number_threads }} </p>
</div>
@@ -45,14 +132,14 @@
</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 }}
{{ '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">
@@ -77,7 +164,8 @@
</div>
</div>
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
{% else %}
<div class="alert alert-warning">
{{ 'NoForumInThisCategory'|get_lang }}

0 comments on commit 2865726

Please sign in to comment.
You can’t perform that action at this time.