socialbase-1.1.0/templates/form/datetime-wrapper.html.twig

templates/form/datetime-wrapper.html.twig
{#
/**
 * @file
 * Default theme implementation of a datetime form wrapper.
 *
 * Available variables:
 * - content: The form element to be output, usually a datelist, or datetime.
 * - title: The title of the form element.
 * - title_attributes: HTML attributes for the title wrapper.
 * - description: Description text for the form element.
 * - required: An indicator for whether the associated form element is required.
 *
 * @ingroup templates
 *
 * @see template_preprocess_datetime_wrapper()
 */
#}
{%
  set title_classes = [
    'control-label',
    required ? 'form-required',
  ]
%}

{%
  set classes = [
    errors ? 'error has-error',
  ]
%}

<div{{ attributes.addClass(classes) }}>
{% if title %}
  <label{{ title_attributes.addClass(title_classes) }}>{{ title }}</label>
  {% if required %}
    <span class="form-required">*</span>
  {% endif %}
{% endif %}
{{ content }}
{% if errors %}
  <div class="form-item--error-message alert alert-danger alert-sm alert-dismissible form-control-radius">
    {{ errors }}
    <button type="button" class="close" data-dismiss="alert" aria-label="{{ "Close"|t }}">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <br />
{% endif %}
{% if description %}
  <div class="help-block">{{ description }}</div>
{% endif %}
</div>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc