Commit c293a2e9 authored by Johan Cwiklinski's avatar Johan Cwiklinski
Browse files

Few fixes, add number type, add selected dropdown entry

parent 23de7c1e
......@@ -237,7 +237,6 @@ class FieldsConfig
*/
protected function buildLists()
{
$this->categorized_fields = [];
$this->all_required = [];
$this->all_visibles = [];
......
{% block component %}
{% if notag is not defined %}
<div{% if component_id is defined %} id="{{ component_id }}"{% endif %} class="{{ component_class ?? 'inline field' }}">
<div{% if component_id is defined %} id="{{ component_id }}"{% endif %} class="{{ component_class ?? 'inline field' }}{% if required is defined and required == true %} required{% endif %}">
{% endif %}
{% block label %}
<label for="{{ id }}"{% if title is defined %} title="{{ title }}"{% endif %}{% if labelclass is defined %} class="{% if labelclass is defined %}{{ labelclass }}{% endif %}"{% endif %}>
......@@ -14,7 +14,7 @@
{% if type is defined and type == 'password' %}<div class="ui input">{% endif %}
{% block element %}<input
type="{{ type }}"
name="{{ name }}"
name="{{ name ?? id }}"
id="{{ id }}"
value="{% if value is not same as null %}{{ value }}{% endif %}"
{% if required is defined and required == true %} required="required"{% endif %}
......@@ -24,6 +24,7 @@
{% if maxlength is defined %} maxlength="{{ maxlength }}"{% endif %}
{% if elt_class is defined %} class="{{ elt_class }}"{% endif %}
{% if autocomplete is defined %} autocomplete="{{ autocomplete }}"{% endif %}
{% if autofocus is defined %} autofocus{% endif %}
{% if size is defined %} size="{{ size }}"{% endif %}
{% if checked is defined and checked == true %} checked="checked"{% endif %}
/>
......
{% extends "components/forms/input.html.twig" %}
{% block component %}
{% set type = "number" %}
{{ parent() }}
{% endblock %}
{% extends "components/forms/input.html.twig" %}
{% block component %}
{% if entry.required %}
{% set component_class = component_class ?? 'inline field' ~ ' required' %}
{% endif %}
{{ parent() }}
{% endblock %}
{% block element %}
<select
name="{{ name }}"
name="{{ name ?? id }}"
id="{{ id }}"
{% if required is defined and required == true %} required="required"{% endif %}
{% if disabled is defined and disabled == true %} disabled="disabled"{% endif %}
class="ui search dropdown nochosen"
>
{% for value, label in values %}
<option value="{{ value }}">{{ label }}</option>
{% for option_value, option_label in values %}
<option value="{{ option_value }}"{% if option_value == value %} selected="selected"{% endif %}>{{ option_label }}</option>
{% endfor %}
</select>
{% endblock %}
......@@ -2,8 +2,5 @@
{% block component %}
{% set type = "text" %}
{% if entry.required ?? false %}
{% set component_class = component_class ?? 'inline field' ~ ' required' %}
{% endif %}
{{ parent() }}
{% endblock %}
......@@ -6,7 +6,7 @@
{% block element %}
<textarea
name="{{ name }}"
name="{{ name ?? id }}"
id="{{ id }}"
cols="{{ cols ?? 50 }}"
rows="{{ rows ?? 6 }}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment