{% extends template('page', 'Combodo\\iTop\\Portal\\Brick\\AbstractBrick') %}

{% block pPageBodyClass %}{{ parent() }} page_browse_brick page_browse_brick_as_{{ sBrowseMode }}{% endblock %}

{% block pPageReadyScripts %}
    {{ parent() }}
    {% include template('tagset_clic_handler_js') %}
{% endblock %}

{% block pMainHeaderTitle %}
	{{ oBrick.GetTitle()|dict_s }}
{% endblock %}

{% block pMainHeaderActions %}
	{% if aBrowseButtons|length > 1 %}
		<div class="ipb-button--group">
			{% for sBrowseButton in aBrowseButtons %}
			<a href="{{ app.url_generator.generate('p_browse_brick_mode', {'sBrickId': sBrickId, 'sBrowseMode': sBrowseButton}) }}"
               class="ipb-button {% if sBrowseMode == sBrowseButton %}ipb-is-primary{% else %}ipb-is-default{% endif %}"
            >
                {{ ('Brick:Portal:Browse:Mode:'~sBrowseButton|capitalize)|dict_s }}
            </a>
			{% endfor %}
		</div>
	{% endif %}
{% endblock %}

{% block pMainContentHolder%}
	{% if iItemsCount > 0 or sSearchValue is not empty %}
        {% block bBrowseHeaderContent %}
        {% endblock %}
		<div class="ipb-panel ipb-browse-brick-panel panel panel-default">
			{% block bBrowseMainContent %}
			{% endblock %}
		</div>
	{% else %}
		<div class="ipb-panel panel panel-default">
			<div class="ipb-panel--body panel-body">
                <div class="ipb-browse-brick--no-item--illustration ipb-svg-illustration--container">{{ source('illustrations/undraw_empty_alternative.svg') }}</div>
				<h3 class="ipb-browse-brick--no-item--text text-center">{{ 'Brick:Portal:Browse:Filter:NoData'|dict_s }}</h3>
			</div>
		</div>
	{% endif %}
{% endblock %}
