{#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
 #
 # SPDX-License-Identifier: MIT
-#}

{%- import('macros/printElementId.xml.jinja2') as peid %}

{%- macro printAdditionalAudience(audience) -%}
<ADDITIONAL-AUDIENCE {{-peid.printElementIdAttribs(audience)}}>
 {{ peid.printElementIdSubtags(audience)|indent(1) }}
</ADDITIONAL-AUDIENCE>
{%- endmacro -%}

{%- macro printAudience(audience) -%}
<AUDIENCE {{-make_bool_xml_attrib("IS-SUPPLIER", audience.is_supplier_raw)}}
          {{-make_bool_xml_attrib("IS-DEVELOPMENT", audience.is_development_raw)}}
          {{-make_bool_xml_attrib("IS-MANUFACTURING", audience.is_manufacturing_raw)}}
          {{-make_bool_xml_attrib("IS-AFTERSALES", audience.is_aftersales_raw)}}
          {{-make_bool_xml_attrib("IS-AFTERMARKET", audience.is_aftermarket_raw)}}>
{%- if audience.enabled_audience_refs %}
 <ENABLED-AUDIENCE-REFS>
{%- for ref in audience.enabled_audience_refs %}
  <ENABLED-AUDIENCE-REF ID-REF="{{ref.ref_id}}" />
{%- endfor %}
 </ENABLED-AUDIENCE-REFS>
{%- endif%}
{%- if audience.disabled_audience_refs %}
 <DISABLED-AUDIENCE-REFS>
{%- for ref in audience.disabled_audience_refs %}
  <DISABLED-AUDIENCE-REF ID-REF="{{ref.ref_id}}" />
{%- endfor %}
 </DISABLED-AUDIENCE-REFS>
{%- endif%}
</AUDIENCE>
{%- endmacro -%}
