Allow "Add Item" translation and custom label

This commit is contained in:
Flavio Copes
2016-03-03 19:11:14 +01:00
parent f6ac011407
commit 989bea815f
2 changed files with 3 additions and 1 deletions

View File

@@ -483,3 +483,4 @@ PLUGIN_ADMIN:
FILE_ERROR_ADD: "An error occurred while trying to add the file"
FILE_ERROR_UPLOAD: "An error occurred while trying to upload the file"
FILE_UNSUPPORTED: "Unsupported file type"
ADD_ITEM: "Add item"

View File

@@ -1,5 +1,6 @@
{% set value = (value is null ? field.default : value) %}
{% set name = scope ~ field.name %}
{% set btnLabel = field.btnLabel is defined ? field.btnLabel : "PLUGIN_ADMIN.ADD_ITEM" %}
<div class="form-field grid pure-g">
<div class="form-label block size-1-4 pure-u-1-4">
@@ -55,7 +56,7 @@
{% endif %}
</ul>
<div class="collection-actions">
<button class="button" type="button" data-action="add"><i class="fa fa-plus"></i> Add item</button>
<button class="button" type="button" data-action="add"><i class="fa fa-plus"></i> {{ btnLabel|e|tu }}</button>
</div>
<div style="display: none;" data-collection-template="new" data-collection-template-html="{%- filter replace({' ': ' ', '\n': ' '})|e('html_attr') -%}