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

{block name="content"}
<body>
    <section class="container mt-5 p-5 d-flex flex-column align-items-center">
        <div>
            <h2>Alimenter votre projet</h2>
			<form method="post">
				<button type="submit" class="btn btn-primary btn-lg" name="showForm">+</button>
				{if isset($smarty.post.toContinue)}
					<button type="submit" class="btn btn-warning btn-lg" name="showFormContinue">Reprendre</button>
				{/if}
			</form>
			
			{* Affichage d'un formulaire en cas d'appuie sur le bouton "+" *}
			{if isset($smarty.post.showForm) || isset($smarty.post.showFormContinue)}
				<form method="post" enctype="multipart/form-data" onsubmit="return confirm('Voulez-vous vraiment envoyer le formulaire ?')">
					<div>
						<label>Titre</label>
						<input type="text" name="titleProject">
					</div>
					<div> 
						<label>Description</label>
						<input type="text" name="descProject">
					</div>
					<div>
						<label>Texte Portfolio</label>
						<input type="text" name="textProject">
					</div>
					<div>
						<input name="imageProject" class="form-control" type="file">
					</div>
					<button type="submit" class="btn btn-primary btn-md" name="sendMessage">Envoyer</button>
					<button type="submit" class="btn btn-warning btn-md" name="toContinue">Remettre à plus tard</button>
				</form>
			{/if}
			
        </div>
            <div>
                <h3>Description</h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
                    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
                    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div>
                <h3>Photos behind the scene</h3>
                <div class="row mb-2">
                    <img>
                </div>
            </div>
            <div>
                <h3>Other projects</h3>
                <div class="row mb-2">
                    {foreach $arrProjectToDisplay as $objProject}
                        {include file="../app/views/partials/preview.tpl"}
                    {/foreach}
                </div>
            </div>
        </div>
    <section>
</body>
{/block}