chill-bundles/Resources/views/layout.html.twig
2014-11-19 09:43:53 +01:00

110 lines
4.6 KiB
Twig

{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillMainBundle::layout.html.twig" %}
{% block css %}
{% stylesheets output="css/all.css" filter="cssrewrite"
"bundles/chillperson/css/person.css"
%}
<link rel="stylesheet" href="{{ asset_url }}"/>
{% endstylesheets %}
{% endblock %}
{% block layout_content %}
<div class="container">
<div id="person_wrapper">
<div id="general" class="parent">
<div class="grid-8">
<h1>
{% if person.genre == "woman" %}
<i class="fa fa-female"></i>
{% else %}
<i class="fa fa-male"></i>
{% endif %}
{{ person.firstName }} {{ person.lastName }} {% spaceless %}
{% if not person.isOpen %}
<i class="fa fa-lock"></i>
{% endif %}
{% endspaceless %}
</h1>
</div>
<div class="grid-4">
<p><i class="fa fa-birthday-cake"></i> {% spaceless %}
{% if person.dateOfBirth == null %}
{{ 'Unknown date of birth'|trans }}, {{ ('person.gender.' ~
person.genre)|trans }}
{% else %}
{% transchoice person.genreNumeric
with {'%date%' : person.dateOfBirth.format('d-m-Y')} %}
{0} Born the %date | {1} Born the %date
{% endtranschoice %}
{% endif %}
{% endspaceless %}</p>
{% if person.nationality is not null %}
<p><i class="fa fa-flag"></i> {{ person.nationality.name|localize_translatable_string }}</p>
{% else %}
<p class="without_nationality"><i class="fa fa-flag"></i> {% trans %}Without nationality{% endtrans %}</p>
{% endif %}
</div>
</div>
<div id="person_details" class="content">
<section class="container">
{# Note: activeRouteKey should be defined in Controller or child layout #}
{{ chill_menu('person', {
'layout': 'ChillPersonBundle::menu.html.twig',
'args' : {'person_id': person.id },
'activeRouteKey': activeRouteKey
}) }}
<div class="grid-8">
{# Flash messages ! #}
<div class="container">
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="grid-8 centered success">
<span>
{{ flashMessage|raw }}
</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('danger') %}
<div class="grid-8 centered error">
<span>
{{ flashMessage|raw }}
</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('info') %}
<div class="grid-8 centered notice">
<span>
{{ flashMessage|raw }}
</span>
</div>
{% endfor %}
</div>
{% block personcontent %}<!-- block personcontent empty -->{%endblock%}
</div>
</section>
</div>
</div>
</div>
{% endblock %}