|
373 | 373 |
|
374 | 374 | {% block widget_attributes %}
|
375 | 375 | {% spaceless %}
|
376 |
| - id="{{ id }}" name="{{ full_name }}"{% if read_only %} readonly="readonly"{% endif %}{% if disabled %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %} |
377 |
| - {% for attrname, attrvalue in attr %}{% if attrname in ['placeholder', 'title'] %}{{ attrname }}="{{ attrvalue|trans({}, translation_domain) }}" {% else %}{{ attrname }}="{{ attrvalue }}" {% endif %}{% endfor %} |
| 376 | + id="{{ id }}" |
| 377 | + name="{{ full_name }}" |
| 378 | + {% if read_only %} readonly="readonly"{% endif %} |
| 379 | + {% if disabled %} disabled="disabled"{% endif %} |
| 380 | + {% if required %} required="required"{% endif %} |
| 381 | + {% if max_length %} maxlength="{{ max_length }}"{% endif %} |
| 382 | + {% if pattern %} pattern="{{ pattern }}"{% endif %} |
| 383 | + {% for attrname, attrvalue in attr %} |
| 384 | + {% if attrname in ['placeholder', 'title'] %} |
| 385 | + {{ attrname }}="{{ attrvalue|trans({}, translation_domain) }}" |
| 386 | + {% else %} |
| 387 | + {% if attrvalue is sameas(true) %} |
| 388 | + {{ attrname }}="{{ attrname }}" |
| 389 | + {% elseif attrvalue is not sameas(false) %} |
| 390 | + {{ attrname }}="{{ attrvalue }}" |
| 391 | + {% endif %} |
| 392 | + {% endif %} |
| 393 | + {% endfor %} |
378 | 394 | {% endspaceless %}
|
379 | 395 | {% endblock widget_attributes %}
|
380 | 396 |
|
381 | 397 | {% block widget_container_attributes %}
|
382 | 398 | {% spaceless %}
|
383 | 399 | {% if id is not empty %}id="{{ id }}" {% endif %}
|
384 |
| - {% for attrname, attrvalue in attr %}{{ attrname }}="{{ attrvalue }}" {% endfor %} |
| 400 | + {% for attrname, attrvalue in attr %} |
| 401 | + {% if attrname in ['placeholder', 'title'] %} |
| 402 | + {{ attrname }}="{{ attrvalue|trans({}, translation_domain) }}" |
| 403 | + {% else %} |
| 404 | + {% if attrvalue is sameas(true) %} |
| 405 | + {{ attrname }}="{{ attrname }}" |
| 406 | + {% elseif attrvalue is not sameas(false) %} |
| 407 | + {{ attrname }}="{{ attrvalue }}" |
| 408 | + {% endif %} |
| 409 | + {% endif %} |
| 410 | + {% endfor %} |
385 | 411 | {% endspaceless %}
|
386 | 412 | {% endblock widget_container_attributes %}
|
387 | 413 |
|
|
0 commit comments