Merge et adding style

pull/16/head
Corentin RICHARD 10 months ago
parent 0df65456c1
commit 53cbd4bde8

@ -63,6 +63,17 @@ body {
margin: 4px;
}
.delete-button {
background-color: #970c2a;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
text-align: center;
text-decoration: none;
margin: 4px;
}
.count-container {
display: flex;
margin-left: auto; /* Pushes the container to the right */

@ -1,35 +0,0 @@
<?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 Version20240612112105 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
$this->addSql('ALTER TABLE profil ADD COLUMN roles CLOB DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TEMPORARY TABLE __temp__profil AS SELECT id, name, description, password FROM profil');
$this->addSql('DROP TABLE profil');
$this->addSql('CREATE TABLE profil (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, password VARCHAR(255) DEFAULT NULL)');
$this->addSql('INSERT INTO profil (id, name, description, password) SELECT id, name, description, password FROM __temp__profil');
$this->addSql('DROP TABLE __temp__profil');
}
}

@ -1,35 +0,0 @@
<?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 Version20240612121601 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
$this->addSql('ALTER TABLE profil ADD COLUMN roles CLOB DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TEMPORARY TABLE __temp__profil AS SELECT id, name, description, password FROM profil');
$this->addSql('DROP TABLE profil');
$this->addSql('CREATE TABLE profil (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, password VARCHAR(255) DEFAULT NULL)');
$this->addSql('INSERT INTO profil (id, name, description, password) SELECT id, name, description, password FROM __temp__profil');
$this->addSql('DROP TABLE __temp__profil');
}
}

@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240611201839 extends AbstractMigration
final class Version20240612171415 extends AbstractMigration
{
public function getDescription(): string
{
@ -28,7 +28,8 @@ final class Version20240611201839 extends AbstractMigration
$this->addSql('CREATE TABLE post_tags (post_id INTEGER NOT NULL, tags_id INTEGER NOT NULL, PRIMARY KEY(post_id, tags_id), CONSTRAINT FK_A6E9F32D4B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A6E9F32D8D7B4FB4 FOREIGN KEY (tags_id) REFERENCES tags (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('CREATE INDEX IDX_A6E9F32D4B89032C ON post_tags (post_id)');
$this->addSql('CREATE INDEX IDX_A6E9F32D8D7B4FB4 ON post_tags (tags_id)');
$this->addSql('CREATE TABLE profil (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, password VARCHAR(255) DEFAULT NULL)');
$this->addSql('CREATE TABLE profil (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, roles CLOB DEFAULT NULL --(DC2Type:json)
, name VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, password VARCHAR(255) DEFAULT NULL)');
$this->addSql('CREATE TABLE profil_profil (profil_source INTEGER NOT NULL, profil_target INTEGER NOT NULL, PRIMARY KEY(profil_source, profil_target), CONSTRAINT FK_97293BC52E75F621 FOREIGN KEY (profil_source) REFERENCES profil (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_97293BC53790A6AE FOREIGN KEY (profil_target) REFERENCES profil (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('CREATE INDEX IDX_97293BC52E75F621 ON profil_profil (profil_source)');
$this->addSql('CREATE INDEX IDX_97293BC53790A6AE ON profil_profil (profil_target)');

@ -13,12 +13,17 @@ use Symfony\Component\HttpFoundation\Request;
class ProfilController extends AbstractController
{
private Profil $currentProfil;
public function __construct(private EntityManager $mgr)
{
}
#[Route(path:"/profil", name:"profil_perso", methods: ["GET"])]
public function baseProfil(): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED');
return $this->redirectToRoute('profil_show', ['id' => $this->getUser()->getId()]);
}
#[Route('/profil/{id}',name:'profil_show', requirements: ['page' => '\d+'])]
public function profil(int $id): Response
{

@ -188,11 +188,6 @@ class Profil implements UserInterface, PasswordAuthenticatedUserInterface
return $this;
}
public function getUserIdentifier(): string
{
return $this->name;
}
public function eraseCredentials(): void
{
// TODO: Implement eraseCredentials() method.

@ -20,7 +20,7 @@
<form method="post" action="{{ path('profil_delete', {id: profil.id}) }}" onsubmit="return confirm('Are you sure you want to delete this profile?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ profil.id) }}">
<button class="btn btn-danger follow-button">Delete Profile</button>
<button class="btn btn-danger delete-button">Delete Profile</button>
</form>
</div>
{% endblock %}

Binary file not shown.
Loading…
Cancel
Save