<link rel="stylesheet" type="text/css" href="{{ asset('bundles/dcsite/css/modules/conditions-of-sales/style.css') }}">
<section class="terms_of_car">
<div class="container">
<div class="row">
<div class="col-md-12">
{% if dealer is defined and dealer.id == 4 %}
<h1 class="main-title">{{ 'conditions_of_sales.title_alt'|trans({}, 'dc_base') }}</h1>
{% else %}
<h1 class="main-title">{{ 'conditions_of_sales.title'|trans({}, 'dc_base') }}</h1>
{% endif %}
<div class="terms_of_car-item terms_of_car-item-head">
{% if filesByType.types|length > 0 %}
{% for type, files in filesByType.types %}
{% if type == constant('DcSiteBundle\\Model\\File::CONDITION_OF_SALES') %}
<div class="terms_of_car-item w-100">
<div class="terms_of_car-item-row">
<a href="{{ sonata_path(files.0.file, 'reference') }}" download class="terms_of_car-item-name">
<span class="terms_of_car-item-title">{{ files.0.title(app.request.locale) }} {{ 'conditions_of_sales.from'|trans({}, 'dc_base') }}</span>
<span class="terms_of_car-item-date">{{ files.0.beginDate|date('d.m.Y')}} р.</span>
</a>
</div>
</div>
{% endif %}
{% if type == constant('DcSiteBundle\\Model\\File::LIST_OF_CONFIGURATION') %}
<div class="terms_of_car-item w-100">
<div class="terms_of_car-item-row">
<a href="{{ sonata_path(files.0.file, 'reference') }}" download class="terms_of_car-item-name">
<span class="terms_of_car-item-title">{{ files.0.title(app.request.locale) }} {{ 'conditions_of_sales.from'|trans({}, 'dc_base') }}</span>
<span class="terms_of_car-item-date">{{ files.0.beginDate|date('d.m.Y')}} р.</span>
</a>
</div>
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
{% if filesByType.previous %}
<div class="terms_of_car-list-wrap">
<div class="terms_of_car-list">
<button class="terms_btn-last terms_btn-last-main collapsed" type="button" data-toggle="collapse" data-target="#multiCollapseExample2" aria-expanded="false" aria-controls="multiCollapseExample2">
{{ 'conditions_of_sales.previous_editions'|trans({}, 'dc_base') }}
</button>
{% for type, files in filesByType.types %}
{% if files|length > 1 %}
<div class="collapse" id="multiCollapseExample2">
{% if type == constant('DcSiteBundle\\Model\\File::CONDITION_OF_SALES') %}
<button class="terms_btn-last collapsed" type="button" data-toggle="collapse" data-target="#conditionsCars" aria-expanded="false" aria-controls="conditionsCars">
{{ 'conditions_of_sales.title'|trans({}, 'dc_base') }}
</button>
<div class="collapse" id="conditionsCars">
{% for file in files|slice(1) %}
<a href="{{ sonata_path(file.file, 'reference') }}" download class="terms_of_car-list-item">
<div class="terms_of_car-item-name">
<span class="terms_of_car-item-title">{{ file.title(app.request.locale) }} {{ 'conditions_of_sales.from'|trans({}, 'dc_base') }}</span>
<span class="terms_of_car-item-date">{{ file.beginDate|date('d.m.Y') }} р.</span>
</div>
</a>
{% endfor %}
</div>
{% endif %}
{% if type == constant('DcSiteBundle\\Model\\File::LIST_OF_CONFIGURATION') %}
<button class="terms_btn-last collapsed" type="button" data-toggle="collapse" data-target="#conditionsComplectations" aria-expanded="false" aria-controls="conditionsComplectations">
{{ 'main.list_compectation_title'|trans({}, 'dc_base') }}
</button>
<div class="collapse" id="conditionsComplectations">
{% for file in files|slice(1) %}
<a href="{{ sonata_path(file.file, 'reference') }}" download class="terms_of_car-list-item">
<div class="terms_of_car-item-name">
<span class="terms_of_car-item-title">{{ file.title(app.request.locale) }} {{ 'conditions_of_sales.from'|trans({}, 'dc_base') }}</span>
<span class="terms_of_car-item-date">{{ file.beginDate|date('d.m.Y') }} р.</span>
</div>
</a>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
</section>