First commit
This commit is contained in:
commit
b7ce57b541
10 changed files with 273 additions and 0 deletions
51
admin/templates/partials/item.html.twig
Normal file
51
admin/templates/partials/item.html.twig
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{% 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue