cotisations.html.twig 2.19 KB
Newer Older
1
{% set cotisations = getValidCotisations(app.user, app.request) %}
Julien Jorry committed
2 3 4 5 6 7 8 9 10 11
{% if cotisations|length > 0 %}
	{% set idcard = 'cotisationspresta' %}
	{% extends '@kohinos/block/block_collapse.html.twig' %}

	{% block blocktitle %}
		<i class="fa fa-clipboard-list mr-4"></i> {{ 'Mes cotisations'|trans }}
	{% endblock blocktitle %}
	{% block blocksubtitle %}
	{% endblock blocksubtitle %}
	{% block blockcontent %}
12
		{% if false == isCotisationValid(app.user) %}
Julien Jorry committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
			{% if cotisations|length > 0 %}
				<div class='text-danger mb-3'>{{ 'Votre dernière cotisation est arrivée à expiration, veuillez cotiser de nouveau pour accéder aux fonctionnalités de votre compte !'|trans }}</div>
			{% else %}
				<div class='text-danger mb-3'>{{ 'Si vous souhaitez utiliser les fonctionnalités de votre compte, vous devez avoir une cotisation valide !'|trans }}</div>
			{% endif %}
		{% endif %}
		<ul class='list-group'>
			{% if cotisations|length <= 0 %}
				<em>{{ 'Aucunes cotisations à ce jour'|trans }}</em>
			{% else %}
				{% for cotisation in cotisations %}
					<li class="list-group-item"><span class='btn btn-xs btn-primary disabled'>{{cotisation.annee|upper}}</span> <b>{{cotisation.montant}}&euro;</b> <em> {{ 'payée le'|trans }} {{cotisation.createdAt|date('d/m/Y')}} en {{cotisation.moyen}}</em></li>
				{% endfor %}
			{% endif %}
		</ul>

Julien Jorry committed
29 30 31 32 33 34 35 36
		{% set cotisEnd = false %}
		{% if (app.user and is_granted('ROLE_ADHERENT') and app.user.adherent) %}
			{% set cotisEnd = isCotisationValidForAdherent(app.user.adherent) %}
		{% elseif (app.user and is_granted('ROLE_PRESTATAIRE') and app.session.has('_prestagere')) %}
			{% set cotisEnd = isCotisationValidForPresta(app.session.get('_prestagere')) %}
		{% endif %}
		{% if false != cotisEnd %}
			<span class='btn btn-secondary disabled mt-2' disabled='disabled'>
37
				{{ "Votre cotisation est à jour jusqu'au %date%" |trans({'%date%': cotisEnd|date('d/m/Y')}) }}
Julien Jorry committed
38
			</span>
39 40 41
			<a class='btn btn-xs btn-primary mt-2' href='{{ path('cotisernextyear') }}'>
				{{ "Cotiser pour l'année suivante"|trans }}
			</a>
Julien Jorry committed
42 43 44 45
		{% else %}
			<a class='btn btn-xs btn-primary mt-2' href='{{ path('cotiser') }}'>
				{{ 'Cotiser'|trans }}
			</a>
Julien Jorry committed
46 47 48
		{% endif %}
	{% endblock blockcontent %}
{% endif %}