From 61a907785d9382adeb2de05b4b080de1d270f6d0 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 19 Oct 2025 14:24:00 +0200 Subject: =?UTF-8?q?suppression=20champ=20file=5Fpath=5Fmini=20dans=20Asset?= =?UTF-8?q?,=20nettoyage=20divers,=20r=C3=A9solution=20bug=20quand=20pas?= =?UTF-8?q?=20d'image=20de=20fond?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/trombinoscope.css | 37 ++----------------------------------- src/installation.php | 12 +++++++----- src/model/entities/Asset.php | 12 ++---------- src/model/entities/Node.php | 19 ------------------- src/view/HeaderBuilder.php | 8 ++++++-- src/view/templates/header.php | 2 +- 6 files changed, 18 insertions(+), 72 deletions(-) diff --git a/public/css/trombinoscope.css b/public/css/trombinoscope.css index cee2666..9ca1b80 100644 --- a/public/css/trombinoscope.css +++ b/public/css/trombinoscope.css @@ -1,39 +1,6 @@ -/* css personnalissé à cette page, -.grid_columns utilise un nombre de colonnes spécifique */ +/* css custom +à faire: rendre uploadable et placer le fichier dans un dossier spécifique */ article img { border-radius: 50%; -} -.grid_columns -{ - grid-template-columns: repeat(4, 1fr); -} -@media screen and (max-width: 900px) -{ - .grid_columns - { - grid-template-columns: repeat(3, 1fr); - } -} -@media screen and (max-width: 650px) -{ - .grid_columns - { - grid-template-columns: repeat(2, 1fr); - } -} -@media screen and (max-width: 550px) -{ - .grid_columns - { - display: grid; - grid-template-columns: repeat(2, 1fr); - } -} -@media screen and (max-width: 350px) -{ - .grid_columns - { - display: block; - } } \ No newline at end of file diff --git a/src/installation.php b/src/installation.php index e0314a5..7fff5f7 100644 --- a/src/installation.php +++ b/src/installation.php @@ -118,11 +118,13 @@ function makeStartPage(EntityManager $entityManager){ /* -- table asset -- */ // paramètres: file_name, file_path, file_path_mini, mime_type, alt - $favicon = new Asset("favicon48x48.png", NULL, "assets/favicon48x48.png", "image/png", "favicon"); - $facebook = new Asset("facebook.svg", NULL, "assets/facebook.svg", "image/svg+xml", "facebook"); - $instagram = new Asset("instagram.svg", NULL, "assets/instagram.svg", "image/svg+xml", "instagram"); - $linkedin = new Asset("linkedin.svg", NULL, "assets/linkedin.svg", "image/svg+xml", "linkedin"); - $github = new Asset("github.svg", NULL, "assets/github.svg", "image/svg+xml", "github"); + $favicon = new Asset("favicon48x48.png", "assets/favicon48x48.png", "image/png", "favicon"); + $background = new Asset("fond-piscine.jpg", "assets/fond-piscine.jpg", "image/jpeg", "background"); + $logo = new Asset("logo-nb-et-ffn.png", "assets/logo-nb-et-ffn.png", "image/png", "logo"); + $facebook = new Asset("facebook.svg", "assets/facebook.svg", "image/svg+xml", "facebook"); + $instagram = new Asset("instagram.svg", "assets/instagram.svg", "image/svg+xml", "instagram"); + $linkedin = new Asset("linkedin.svg", "assets/linkedin.svg", "image/svg+xml", "linkedin"); + $github = new Asset("github.svg", "assets/github.svg", "image/svg+xml", "github"); /* -- table node_data -- */ // paramètres: data, node, images diff --git a/src/model/entities/Asset.php b/src/model/entities/Asset.php index df8c98b..e1071b4 100644 --- a/src/model/entities/Asset.php +++ b/src/model/entities/Asset.php @@ -19,13 +19,10 @@ class Asset #[ORM\Column(type: "string", length: 255, unique: true)] // nom d'image UNIQUE private string $file_name; - // choisir un répertoire du genre /var/www/html/uploads/ de préférence hors de /src + // choisir un répertoire du genre /var/www/html/uploads/, au moins hors de /src #[ORM\Column(type: "string", length: 255, unique: true, nullable: true)] private ?string $file_path; - #[ORM\Column(type: "string", length: 255, unique: true, nullable: true)] - private ?string $file_path_mini; - #[ORM\Column(type: "string", length: 255, nullable: true)] private string $mime_type; // image/jpeg, image/png, etc @@ -44,11 +41,10 @@ class Asset #[ORM\ManyToMany(targetEntity: NodeData::class, mappedBy: "assets")] private $node_data; - public function __construct(string $name, ?string $path, ?string $path_mini, string $mime_type, string $alt) + public function __construct(string $name, ?string $path, string $mime_type, string $alt) { $this->file_name = $name; $this->file_path = $path; - $this->file_path_mini = $path_mini; $this->mime_type = $mime_type; $this->alt = $alt; } @@ -61,10 +57,6 @@ class Asset { return $this->file_path; } - public function getFilePathMini(): string - { - return $this->file_path_mini; - } public function getAlt(): string { return $this->alt; diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index 76ef74b..2034b3d 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php @@ -176,25 +176,6 @@ class Node $this->sortChildren(false); } } - - // remplacée par "ORDER BY a.date_time" en DQL - /*private function sortNews(bool $chrono = false) // affichage du plus récent au plus ancien par défaut - { - // tri par insertion similaire à Position::sortChildren - for($i = 1; $i < count($this->children); $i++){ - $tmp = $this->children[$i]; - $j = $i - 1; - - $compare = $chrono ? fn($a, $b) => $a > $b : fn($a, $b) => $a < $b; - - while($j >= 0 && $compare($this->children[$j]->getArticle()->getDateTime(), $tmp->getArticle()->getDateTime())){ - $this->children[$j + 1] = $this->children[$j]; - $j--; - } - $this->children[$j + 1] = $tmp; - } - }*/ - public function removeChild(self $child): void { foreach($this->children as $key => $object){ diff --git a/src/view/HeaderBuilder.php b/src/view/HeaderBuilder.php index 46a74a8..1b60bc9 100644 --- a/src/view/HeaderBuilder.php +++ b/src/view/HeaderBuilder.php @@ -50,7 +50,10 @@ class HeaderBuilder extends AbstractBuilder // réseaux sociaux + logo dans l'entête $keys = array_keys($social); $social_networks = ''; - $head_logo = ''; + //$header_logo; + //$header_background; + + // nécéssite des entrées dans la table node_asset /*foreach($node->getNodeData()->getAssets() as $asset) { for($i = 0; $i < count($keys); $i++) @@ -73,7 +76,8 @@ class HeaderBuilder extends AbstractBuilder //} } }*/ - // chemin du ficher dans node_data, à déplacer dans asset + + // réseaux sociaux, chemin du ficher dans node_data à déplacer dans asset foreach($keys as $one_key){ $social_networks .= ' ' . $one_key . '_alt'; diff --git a/src/view/templates/header.php b/src/view/templates/header.php index 47d4874..d419a12 100644 --- a/src/view/templates/header.php +++ b/src/view/templates/header.php @@ -1,7 +1,7 @@
-
+
-- cgit v1.2.3