media-reference-help.html.twig 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {#
  2. /**
  3. * @file
  4. * Theme override for media reference fields.
  5. *
  6. * @see template_preprocess_field_multiple_value_form()
  7. */
  8. #}
  9. {%
  10. set classes = [
  11. 'js-form-item',
  12. 'form-item',
  13. 'js-form-wrapper',
  14. 'form-wrapper',
  15. ]
  16. %}
  17. <fieldset{{ attributes.addClass(classes) }}>
  18. {%
  19. set legend_span_classes = [
  20. 'fieldset-legend',
  21. required ? 'js-form-required',
  22. required ? 'form-required',
  23. ]
  24. %}
  25. {# Always wrap fieldset legends in a <span> for CSS positioning. #}
  26. <legend{{ legend_attributes }}>
  27. <span{{ legend_span_attributes.addClass(legend_span_classes) }}>{{ original_label }}</span>
  28. </legend>
  29. <div class="js-form-item form-item">
  30. {% if media_add_help %}
  31. <h4{{ header_attributes.addClass('label') }}>
  32. {% trans %}
  33. Create new media
  34. {% endtrans %}
  35. </h4><br />
  36. <div class="description">
  37. {{ media_add_help }}
  38. </div>
  39. {% endif %}
  40. {% if multiple %}
  41. {{ table }}
  42. {% else %}
  43. {% for element in elements %}
  44. {{ element }}
  45. {% endfor %}
  46. {% endif %}
  47. <div{{ description.attributes.addClass('description') }}>
  48. {% if multiple and description.content %}
  49. <ul>
  50. <li>{{ media_list_help }} {{ media_list_link }} {{ allowed_types_help }}</li>
  51. <li>{{ description.content }}</li>
  52. </ul>
  53. {% else %}
  54. {{ media_list_help }} {{ media_list_link }} {{ allowed_types_help }}
  55. {% endif %}
  56. {% if multiple and button %}
  57. <div class="clearfix">{{ button }}</div>
  58. {% endif %}
  59. </div>
  60. </div>
  61. </fieldset>