grav-plugin-comments/admin/templates/partials/item.html.twig

52 lines
1.7 KiB
Twig
Raw Normal View History

2015-09-13 18:32:44 +00:00
{% macro loop(elements) %}
<ul>
{% for key, item in elements %}
{% if item is iterable %}
<li><strong>{{key|e|capitalize}}</strong>:</li>
{{ _self.loop(item) }}
{% else %}
<li><strong>{{key|e|capitalize}}</strong>: {{ item|e }}</li>
{% endif %}
{% endfor %}
</ul>
{% endmacro %}
<h1>
{{ config.plugins['data-manager'].types[type].item.title ?: type|e|capitalize ~ " " ~ "PLUGIN_DATA_MANAGER.ITEM_DETAILS"|e|tu }}
</h1>
<ul>
{% if config.plugins['data-manager'].types[type].item.fields %}
{% for key, type in config.plugins['data-manager'].types[type].item.fields %}
<li class="page-item">
<div class="row">
<strong>{{type.name|e|capitalize}}</strong>:
{% set item = grav.twig.itemData[key]|cast_to_array %}
{% if item is iterable %}
{{ _self.loop(item) }}
{% else %}
{{ item|e }}
{% endif %}
</div>
</li>
{% endfor %}
{% else %}
{% for key, type in grav.twig.itemData %}
<li class="page-item">
<div class="row">
<strong>{{key|capitalize}}</strong>:
{% set item = grav.twig.itemData[key]|cast_to_array %}
{% if item is iterable %}
{{ _self.loop(item) }}
{% else %}
{{ item|e }}
{% endif %}
</div>
</li>
{% endfor %}
{% endif %}
</ul>