add resume and show

This commit is contained in:
barillote 2025-04-08 11:41:15 +02:00 committed by BARILLOT Esteban
parent afa65543c9
commit d17e802f4e
6 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121142432 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
}
}

Binary file not shown.

Binary file not shown.

View File

@ -109,6 +109,10 @@ final class InternController extends AbstractController
$newFilename
);
if($intern->getResume() !== null){
unlink($cvDirectory.'/'.$intern->getResume());
}
// Mise à jour de l'entité avec le nom du fichier
$intern->setResume($newFilename);
$intern->setResumeName($cvFile->getClientOriginalName()); // Conserver le nom original du fichier
@ -116,7 +120,7 @@ final class InternController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('app_intern_index', [], Response::HTTP_SEE_OTHER);
return $this->redirectToRoute('app_profile', [], Response::HTTP_SEE_OTHER);
}
return $this->render('intern/resume.html.twig', [

View File

@ -80,7 +80,7 @@ class Intern extends UserApp
public function getResumeName(): ?string
{
return $this->resume;
return $this->resumeName;
}
public function setResumeName(string $resumeName): static

View File

@ -8,6 +8,14 @@
<p class="text-gray-600">Téléphone : {{ app.user.tel }}</p>
<p class="text-gray-600">Email : {{ app.user.mail }}</p>
<hr class="my-10"/>
{% if app.user.resume != "" %}
<iframe class="w-full" src={{ 'cv/' ~ app.user.resume }}></iframe>
{% if app.user.resumeName != "" %}
<p class="text-gray-600 italic">Nom du fichier : {{ app.user.resumeName }}</p>
{% endif %}
{% endif %}
<br>
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
href="{{ path('app_intern_resume',{id: app.user.id}) }}"> Ajouter / Modifier le CV