media-reference-help.html.twig 1.6 KB

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