Improve rendering of options and fields

This commit is contained in:
2015-11-27 13:37:07 +01:00
parent f24a088a0d
commit bf99b68a2a
6 changed files with 65 additions and 16 deletions

View File

@@ -35,17 +35,17 @@
{# CFChoice : render the different elements in a choice list #}
{% block cf_choices_row %}
<h3>{{ 'Choices'|trans }}</h3>
{{ dump(form.vars.prototype.children) }}
<div id="{{ form.vars.id }}" data-prototype="{{- form_row(form.vars.prototype.children.name)
~ form_row(form.vars.prototype.children.active)
~ form_row(form.vars.prototype.children.slug) |e -}}">
~ form_row(form.vars.prototype.children.slug) -}}">
<table><tbody>
{% for choice in form %}
<tr><td>
{{ form_row(choice.name) }}
{{ form_row(choice.active) }}
{{ form_row(choice.slug) }}
</td></tr>
</td></tr>
{% endfor %}
</tbody></table>
</div>
@@ -67,7 +67,7 @@
}
function initializeCFChoiceOptionsChoices(div_id) {
var add_element_link = $('<a id="' + div_id + '_add_element_link"" href="#" class="sc-button bt-submit">Add an element</a>');
var add_element_link = $('<a id="' + div_id + '_add_element_link"" href="#" class="sc-button bt-submit">{{ 'Add an element'|trans }}</a>');
var div = $('#' + div_id);
div.append(add_element_link);
div.data('index', div.find(':input').length / 5);