Skip to content

Commit

Permalink
Merge branch 'release/5.1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Mar 14, 2022
2 parents 06bd4fe + 62b7b63 commit 4a47407
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# v5.1.7
## 03/14/2022

1. [](#new)
* Added `access` support for buttons
2. [](#bugfix)
* Fixed tabs in the frontend to ensure JS is loaded

# v5.1.6
## 02/07/2022

1. [](#bugfix)
* Fixed Select field when using OptGroups, not allowing key/values [#541](https://github.com/getgrav/grav-plugin-form/issues/541)
* Support for translatable OptGroup labels in Select field [#540](https://github.com/getgrav/grav-plugin-form/issues/540)
* Fixed Select field when using OptGroups, not allowing key/values [#541](https://github.com/getgrav/grav-plugin-form/issues/541)
* Support for translatable OptGroup labels in Select field [#540](https://github.com/getgrav/grav-plugin-form/issues/540)

# v5.1.5
## 01/24/2022
Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Form
slug: form
type: plugin
version: 5.1.6
version: 5.1.7
description: Enables the forms handling
icon: check-square
author:
Expand Down
2 changes: 2 additions & 0 deletions templates/forms/default/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@

{% if form.isEnabled() ?? true %}
{% for button in form.buttons %}
{% if not button.access or authorize(button.access) %}
{% if button.outerclasses is defined %}<div class="{{ button.outerclasses }}">{% endif %}

{% if button.url %}
Expand Down Expand Up @@ -190,6 +191,7 @@
{% endembed %}

{% if button.outerclasses is defined %}</div>{% endif %}
{% endif %}
{% endfor %}
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions templates/forms/fields/tabs/tabs.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "forms/field.html.twig" %}

{% if grav.admin is not defined %}
{% if not grav.admin %}
{% do assets.addJs('plugin://form/assets/form.vendor.js', { 'group': 'bottom', 'loading': 'defer' }) %}
{% do assets.addJs('plugin://form/assets/form.min.js', { 'group': 'bottom', 'loading': 'defer' }) %}
{% endif %}
Expand Down Expand Up @@ -29,7 +29,7 @@
{% endfor %}
{% else %}
{% set tabsKey = form.name ~ '-' ~ fields|keys|join(':')|md5 %}
{% set storedValue = grav.admin is defined ? get_cookie('grav-tabs-state')|default('{}')|json_decode : [] %}
{% set storedValue = grav.admin ? get_cookie('grav-tabs-state')|default('{}')|json_decode : [] %}
{% set storedTab = attribute(storedValue, 'tab-' ~ tabsKey) %}
{% if storedTab is empty %}
{% set active = uri.params.tab ?? field.active ?? 1 %}
Expand Down

0 comments on commit 4a47407

Please sign in to comment.