|
50 | 50 | {%- block form_label -%} |
51 | 51 | {% if label is not same as(false) -%} |
52 | 52 | {%- if compound -%} |
53 | | - <legend><h2 class="rnib-form-label__wrapper">{{- block('form_label_content') -}}</h2></legend> |
| 53 | + <legend class="tbxforms-fieldset legend"><h2 class="rnib-form-label rnib-form-label__wrapper">{{- block('form_label_content') -}}{% if required %} (required){% endif %}</h2></legend> |
54 | 54 | {%- else -%} |
55 | 55 | {% if not compound -%} |
56 | 56 | {% set label_attr = label_attr|merge({for: id}) %} |
57 | 57 | {%- endif -%} |
58 | 58 | {% set label_attr = label_attr|merge({'class': 'rnib-form-label'}) %} |
59 | 59 | <h2 class="rnib-form-label__wrapper"> |
60 | 60 | <label{% if label_attr %}{% with {attr: label_attr} %}{{ block('attributes') }}{% endwith %}{% endif %}> |
61 | | - {{- block('form_label_content') -}} |
| 61 | + {{- block('form_label_content') -}}{% if required %} (required){% endif %} |
62 | 62 | </label> |
63 | 63 | </h2> |
64 | 64 | {%- endif -%} |
|
160 | 160 | {%- if type == 'text' -%} |
161 | 161 | {%- set attr = attr|merge({'class': 'tbxforms-input tbxforms-input--text'}) -%} |
162 | 162 | {% endif %} |
| 163 | + {%- if type == 'file' -%} |
| 164 | + {%- set attr = attr|merge({'class': 'tbxforms-input tbxforms-input--file'}) -%} |
| 165 | + {% endif %} |
163 | 166 | {{- parent() -}} |
164 | 167 | {%- endblock form_widget_simple -%} |
165 | 168 |
|
|
180 | 183 | </button> |
181 | 184 | {%- endblock button_widget -%} |
182 | 185 |
|
| 186 | +{%- block textarea_widget -%} |
| 187 | + {% set attr = attr|merge({'class': 'tbxforms-input tbxforms-textarea'}) %} |
| 188 | + {{- parent() -}} |
| 189 | +{%- endblock textarea_widget -%} |
| 190 | + |
| 191 | +{% block birthday_widget %} |
| 192 | + {% if widget == 'single_text' %} |
| 193 | + {{- block('form_widget_simple') -}} |
| 194 | + {% else -%} |
| 195 | + {%- set yearWidget = '<div class="date-subfield">' ~ form_label(form.year) ~ form_widget(form.year) ~ '</div>'|raw -%} |
| 196 | + {%- set monthWidget = '<div class="date-subfield">' ~ form_label(form.month) ~ form_widget(form.month) ~ '</div>'|raw -%} |
| 197 | + {%- set dayWidget = '<div class="date-subfield">' ~ form_label(form.day) ~ form_widget(form.day) ~ '</div>'|raw -%} |
| 198 | + |
| 199 | + {%- set date_pattern = '{{ day }}{{ month }}{{ year }}' -%} |
| 200 | + |
| 201 | + {{- date_pattern|replace({ |
| 202 | + '{{ year }}': yearWidget, |
| 203 | + '{{ month }}': monthWidget, |
| 204 | + '{{ day }}': dayWidget, |
| 205 | + })|raw -}} |
| 206 | + |
| 207 | + {% endif %} |
| 208 | +{% endblock birthday_widget %} |
0 commit comments