Skip to content

Commit

Permalink
Provide security options for single tabs (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sommerregen authored and flaviocopes committed May 24, 2016
1 parent f810199 commit 1a55784
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions themes/grav/templates/forms/fields/tabs/tabs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
<div class="tab-body-wrapper">
{% for field in field.fields %}
{% if field.type == 'tab' %}
{% set value = data.value(field.name) %}
<div id="tab-body-{{ tabsKey ~ loop.index }}" class="tab-body">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% if field.security is empty or authorize(array(field.security)) %}
{% set value = data.value(field.name) %}
<div id="tab-body-{{ tabsKey ~ loop.index }}" class="tab-body">
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
Expand Down

0 comments on commit 1a55784

Please sign in to comment.