{extends file="views/layout.tpl"}

{block name="content"}

<section class="user-profile mb-5">
    <div class="row">
        <div class="col-md-4 text-center">
            <img src="{$user->getImage()}" alt="Avatar de {$user->getPseudo()}" class="img-fluid rounded-circle mb-3" style="max-width: 200px">
        </div>
        <div class="col-md-8">
            <h1>{$user->getPseudo()}</h1>
            <p class="text-muted">{$user->getMail()}</p>
            
            {if $user->getWork()}
                <p>{$user->getWork()}</p>
            {/if}
            
            {if $user->getLocation()}
                <p>{$user->getLocation()}</p>
            {/if}
            
            <p class="mt-3">{$user->getDescription()}</p>
        </div>
    </div>
</section>

<section>
    <h2 class="mb-4 border-bottom pb-2">Les projets de {$user->getPseudo()}</h2>
    
    <div class="row">
        {if count($arrProjectToDisplay) > 0}
            {foreach $arrProjectToDisplay as $objProject}
                    {include file="views/_partial/preview.tpl"}
            {/foreach} 
        {else}
            <p class="alert alert-info">Cet utilisateur n'a pas encore publié de projets.</p>
        {/if}
    </div>
</section>

{/block}