{% extends '@kohinos/common/layout.html.twig' %}

{% block content %}
<div class='container' style='max-width: 800px;'>
	{% include '@kohinos/block/breadcrumb.html.twig' with {'label': 'Cotiser'} %}
	<h2 class='text-center w-100 mt-4 mb-4'>{{ "Cotiser pour l'année"|trans }} {{ koh_year }}</h2>
	<div class='text-center mb-5'>
		{% if app.user and is_granted('ROLE_ADHERENT') %}
			<h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.user.adherent.emlcAccount.balance }}</b></h4>
			<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT|default('') }} €</b></h5>
			{% if KOH_ADHESION_TEXT|default('') != '' %}
				<br/><p>
					{{ KOH_ADHESION_TEXT }}
				</p>
			{% endif %}
		{% elseif app.user and is_granted('ROLE_PRESTATAIRE') %}
			<h4>{{ 'Solde de eMLC'|trans }} : <b>{{ getCurrentPrestataire().emlcAccount.balance }}</b></h4>
			<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_PRESTATAIRE|default('') }} €</b></h5>
		{% endif %}
		<br/>
		{{ form_start(form) }}
			{{ form_row(form.operateur) }}
			{{ form_row(form.role) }}
			{{ form_row(form.reference) }}
			{{ form_row(form.montant) }}
			{% if form.don is defined %}
				{{ form_row(form.don) }}
			{% endif %}
			<div class='row mt-4'>
				{% if form.payMLC is defined %}
					{% if form.payCB is defined %}
						{% if form.payHelloAsso is defined %}
							<div class='col-4'>
								{{ form_widget(form.payMLC) }}
							</div>
							<div class='col-4'>
								{{ form_widget(form.payCB) }}
							</div>
							<div class='col-4'>
								{{ form_widget(form.payHelloAsso) }}
							</div>
						{% else %}
							<div class='col-6'>
								{{ form_widget(form.payMLC) }}
							</div>
							<div class='col-6'>
								{{ form_widget(form.payCB) }}
							</div>
						{% endif %}
					{% endif %}
				{% else %}
					{% if form.payCB is defined %}
						{% if form.payHelloAsso is defined %}
							<div class='col-6'>
								{{ form_widget(form.payCB) }}
							</div>
							<div class='col-6'>
								{{ form_widget(form.payHelloAsso) }}
							</div>
						{% else %}
							<div class='col-12'>
								{{ form_widget(form.payCB) }}
							</div>
						{% endif %}
					{% endif %}
				{% endif %}
			</div>
		{{ form_end(form) }}
	</div>
</div>
{% endblock %}
