diff options
| -rw-r--r-- | public/assets/logo-nb-et-ffn.png | bin | 0 -> 61236 bytes | |||
| -rw-r--r-- | public/css/foot.css | 16 | ||||
| -rw-r--r-- | public/css/head.css | 10 | ||||
| -rw-r--r-- | public/css/main.css | 6 | ||||
| -rw-r--r-- | public/css/trombinoscope.css | 4 | ||||
| -rw-r--r-- | src/controller/Director.php | 2 | ||||
| -rw-r--r-- | src/controller/installation.php | 18 | ||||
| -rw-r--r-- | src/model/entities/Page.php | 31 | ||||
| -rw-r--r-- | src/view/HeaderBuilder.php | 12 | ||||
| -rw-r--r-- | src/view/templates/footer.php | 5 | ||||
| -rw-r--r-- | src/view/templates/header.php | 13 |
11 files changed, 82 insertions, 35 deletions
diff --git a/public/assets/logo-nb-et-ffn.png b/public/assets/logo-nb-et-ffn.png new file mode 100644 index 0000000..f51ac9c --- /dev/null +++ b/public/assets/logo-nb-et-ffn.png | |||
| Binary files differ | |||
diff --git a/public/css/foot.css b/public/css/foot.css index ef3291d..0e454ac 100644 --- a/public/css/foot.css +++ b/public/css/foot.css | |||
| @@ -32,13 +32,13 @@ footer > div | |||
| 32 | border-bottom: 2px #ff1d04 solid; | 32 | border-bottom: 2px #ff1d04 solid; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | |||
| 36 | /*-- fil d'ariane --*/ | 35 | /*-- fil d'ariane --*/ |
| 37 | .breadcrumb | 36 | .breadcrumb |
| 38 | { | 37 | { |
| 39 | max-width: 45%; | 38 | /*max-width: 45%;*/ |
| 40 | /*margin-right: 10px;*/ | 39 | /*margin-right: 10px;*/ |
| 41 | margin: 16px 0; /* = p */ | 40 | /*margin: 16px 0;*/ /* = p */ |
| 41 | padding: 10px; | ||
| 42 | list-style: none; /* retirer les puces */ | 42 | list-style: none; /* retirer les puces */ |
| 43 | font-size: small; | 43 | font-size: small; |
| 44 | text-align: right; | 44 | text-align: right; |
| @@ -67,6 +67,12 @@ footer > div | |||
| 67 | display: block; | 67 | display: block; |
| 68 | margin: 0 3px; | 68 | margin: 0 3px; |
| 69 | }*/ | 69 | }*/ |
| 70 | |||
| 71 | .footer_logo img | ||
| 72 | { | ||
| 73 | max-width: 288px; | ||
| 74 | } | ||
| 75 | |||
| 70 | .breadcrumb a | 76 | .breadcrumb a |
| 71 | { | 77 | { |
| 72 | color: unset; /* ne plus hériter */ | 78 | color: unset; /* ne plus hériter */ |
| @@ -101,7 +107,7 @@ footer > div | |||
| 101 | { | 107 | { |
| 102 | margin: 5px 0; | 108 | margin: 5px 0; |
| 103 | display: flex; | 109 | display: flex; |
| 104 | justify-content: space-around; | 110 | justify-content: center; |
| 105 | } | 111 | } |
| 106 | .logged_in button | 112 | .logged_in button |
| 107 | { | 113 | { |
| @@ -117,4 +123,4 @@ footer > div | |||
| 117 | cursor: pointer; /* curseur qui touche du doigt */ | 123 | cursor: pointer; /* curseur qui touche du doigt */ |
| 118 | background-color: #ffff00; | 124 | background-color: #ffff00; |
| 119 | border-radius: 4px; | 125 | border-radius: 4px; |
| 120 | } \ No newline at end of file | 126 | } |
diff --git a/public/css/head.css b/public/css/head.css index b8d4c93..a718a45 100644 --- a/public/css/head.css +++ b/public/css/head.css | |||
| @@ -6,17 +6,21 @@ header | |||
| 6 | background-image: url('../assets/fond-piscine.jpg'); | 6 | background-image: url('../assets/fond-piscine.jpg'); |
| 7 | background-size: cover; /* largeur du bloc_page */ | 7 | background-size: cover; /* largeur du bloc_page */ |
| 8 | } | 8 | } |
| 9 | header > div | 9 | .empty_nav_zone |
| 10 | { | 10 | { |
| 11 | /*margin: auto;*/ | 11 | /*margin: auto;*/ |
| 12 | /*max-width: 1200px;*/ | 12 | /*max-width: 1200px;*/ |
| 13 | display: flex; | 13 | display: flex; |
| 14 | /*align-items: center;*/ /* conflit possible avec .social align-self */ | 14 | /*align-items: center;*/ /* conflit possible avec .social align-self */ |
| 15 | justify-content: space-around; | 15 | justify-content: center; |
| 16 | } | 16 | } |
| 17 | |||
| 17 | .header-content | 18 | .header-content |
| 18 | { | 19 | { |
| 19 | padding: 20px 0; | 20 | padding: 20px 0; |
| 21 | display: grid; | ||
| 22 | grid-template-columns: repeat(3, 1fr); | ||
| 23 | align-items: end; | ||
| 20 | } | 24 | } |
| 21 | .site_title | 25 | .site_title |
| 22 | { | 26 | { |
| @@ -50,7 +54,7 @@ header a | |||
| 50 | { | 54 | { |
| 51 | width: 25px; | 55 | width: 25px; |
| 52 | background-color: #ffffffb3; | 56 | background-color: #ffffffb3; |
| 53 | border-radius: 10px; | 57 | border-radius: 50%; |
| 54 | } | 58 | } |
| 55 | 59 | ||
| 56 | .social img:hover | 60 | .social img:hover |
diff --git a/public/css/main.css b/public/css/main.css index b38f8d9..a75b8cd 100644 --- a/public/css/main.css +++ b/public/css/main.css | |||
| @@ -35,7 +35,7 @@ article | |||
| 35 | { | 35 | { |
| 36 | /*display: flex;*/ | 36 | /*display: flex;*/ |
| 37 | background-color: white; | 37 | background-color: white; |
| 38 | margin: 15px 15px 0 15px; | 38 | margin: 15px; |
| 39 | padding: 0 15px; | 39 | padding: 0 15px; |
| 40 | /*min-height: 150px;*/ | 40 | /*min-height: 150px;*/ |
| 41 | } | 41 | } |
| @@ -79,10 +79,6 @@ article .action_icon:hover | |||
| 79 | justify-content: space-between; | 79 | justify-content: space-between; |
| 80 | font-size: small; | 80 | font-size: small; |
| 81 | } | 81 | } |
| 82 | .under_an_article p | ||
| 83 | { | ||
| 84 | margin: 5px; | ||
| 85 | } | ||
| 86 | .under_an_article img | 82 | .under_an_article img |
| 87 | { | 83 | { |
| 88 | width: 24px; | 84 | width: 24px; |
diff --git a/public/css/trombinoscope.css b/public/css/trombinoscope.css new file mode 100644 index 0000000..f42dad8 --- /dev/null +++ b/public/css/trombinoscope.css | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | article img | ||
| 2 | { | ||
| 3 | border-radius: 50%; | ||
| 4 | } \ No newline at end of file | ||
diff --git a/src/controller/Director.php b/src/controller/Director.php index 896cde1..5ff8f47 100644 --- a/src/controller/Director.php +++ b/src/controller/Director.php | |||
| @@ -62,7 +62,7 @@ class Director | |||
| 62 | return true; | 62 | return true; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | public function feedObjects(array $bulk_data): void // $bulk_data = tableau de Node | 65 | private function feedObjects(array $bulk_data): void // $bulk_data = tableau de Node |
| 66 | { | 66 | { |
| 67 | // puis on les range | 67 | // puis on les range |
| 68 | // (attention, risque de disfonctionnement si les noeuds de 1er niveau ne sont pas récupérés en 1er dans la BDD) | 68 | // (attention, risque de disfonctionnement si les noeuds de 1er niveau ne sont pas récupérés en 1er dans la BDD) |
diff --git a/src/controller/installation.php b/src/controller/installation.php index a692618..c2b38fd 100644 --- a/src/controller/installation.php +++ b/src/controller/installation.php | |||
| @@ -76,13 +76,13 @@ HTACCESS; | |||
| 76 | // les informations ici ne sont pas demandées à l'utilisateur pour l'instant (on verra ça plus tard) | 76 | // les informations ici ne sont pas demandées à l'utilisateur pour l'instant (on verra ça plus tard) |
| 77 | function makeStartPage(EntityManager $entityManager){ | 77 | function makeStartPage(EntityManager $entityManager){ |
| 78 | /* -- table page -- */ | 78 | /* -- table page -- */ |
| 79 | // paramètres: name_page, end_of_path, reachable, in_menu, parent | 79 | // paramètres: name_page, end_of_path, reachable, in_menu, position, parent |
| 80 | $accueil = new Page('Accueil', 'accueil', true, true, NULL); | 80 | $accueil = new Page('Accueil', 'accueil', true, true, 1, NULL); |
| 81 | $connection = new Page('Connexion', 'connexion', true, false, NULL); | 81 | $connection = new Page('Connexion', 'connexion', true, false, NULL, NULL); |
| 82 | $article = new Page('Article', 'article', true, false, NULL); | 82 | $article = new Page('Article', 'article', true, false, NULL, NULL); |
| 83 | $edit_page = new Page("Modification d'une page", 'modif_page', true, false, NULL); | 83 | $edit_page = new Page("Modification d'une page", 'modif_page', true, false, NULL, NULL); |
| 84 | $new_page = new Page('Nouvelle page', 'nouvelle_page', true, false, NULL); | 84 | $new_page = new Page('Nouvelle page', 'nouvelle_page', true, false, NULL, NULL); |
| 85 | $edit_paths = new Page("Menu et chemins", 'menu_chemins', true, false, NULL); | 85 | $edit_paths = new Page("Menu et chemins", 'menu_chemins', true, false, NULL, NULL); |
| 86 | 86 | ||
| 87 | /* -- table node -- */ | 87 | /* -- table node -- */ |
| 88 | // paramètres: name_node, article_timestamp, attributes, position, parent, page, article | 88 | // paramètres: name_node, article_timestamp, attributes, position, parent, page, article |
| @@ -91,7 +91,7 @@ function makeStartPage(EntityManager $entityManager){ | |||
| 91 | $nav = new Node('nav', NULL, [], 1, $header, NULL, NULL); | 91 | $nav = new Node('nav', NULL, [], 1, $header, NULL, NULL); |
| 92 | $main = new Node('main', NULL, [], 3, NULL, NULL, NULL); | 92 | $main = new Node('main', NULL, [], 3, NULL, NULL, NULL); |
| 93 | $footer = new Node('footer', NULL, [], 4, NULL, NULL, NULL); | 93 | $footer = new Node('footer', NULL, [], 4, NULL, NULL, NULL); |
| 94 | $breadcrumb = new Node('breadcrumb', NULL, [], 1, $footer, NULL, NULL); | 94 | $breadcrumb = new Node('breadcrumb', NULL, [], 2, $header, NULL, NULL); |
| 95 | $head_login = new Node('head', NULL, ["stop" => true, 'css_array' => ['body', 'head', 'nav', 'main'], 'js_array' => ['main']], 1, NULL, $connection, NULL); | 95 | $head_login = new Node('head', NULL, ["stop" => true, 'css_array' => ['body', 'head', 'nav', 'main'], 'js_array' => ['main']], 1, NULL, $connection, NULL); |
| 96 | $login = new Node('login', NULL, [], 1, $main, $connection, NULL); | 96 | $login = new Node('login', NULL, [], 1, $main, $connection, NULL); |
| 97 | $head_article = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'main', 'foot'], 'js_array' => ['main']], 1, NULL, $article, NULL); | 97 | $head_article = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'main', 'foot'], 'js_array' => ['main']], 1, NULL, $article, NULL); |
| @@ -108,7 +108,7 @@ function makeStartPage(EntityManager $entityManager){ | |||
| 108 | // paramètres: data, node | 108 | // paramètres: data, node |
| 109 | $head_accueil_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens"], $head_accueil, new ArrayCollection([$favicon])); | 109 | $head_accueil_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens"], $head_accueil, new ArrayCollection([$favicon])); |
| 110 | $header_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens", "facebook_link" => "https://www.facebook.com/nageursbigoudens29120", "instagram_link" => "https://www.instagram.com/nageursbigoudens/"], $header, new ArrayCollection([$logo, $facebook, $instagram, $fond_piscine])); | 110 | $header_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens", "facebook_link" => "https://www.facebook.com/nageursbigoudens29120", "instagram_link" => "https://www.instagram.com/nageursbigoudens/"], $header, new ArrayCollection([$logo, $facebook, $instagram, $fond_piscine])); |
| 111 | $footer_data = new NodeData(["adresse" => "17, rue Raymonde Folgoas Guillou, 29120 Pont-l’Abbé", "contact_nom" => "Les Nageurs Bigoudens", "e_mail" => "nb.secretariat@orange.fr"], $footer); | 111 | $footer_data = new NodeData(["adresse" => "17, rue Raymonde Folgoas Guillou, 29120 Pont-l’Abbé", "contact_nom" => "Les Nageurs Bigoudens", "e_mail" => "nb.secretariat@orange.fr", "logo_footer" => "assets/logo-nb-et-ffn.png"], $footer); |
| 112 | $head_login_data = new NodeData(["description" => "Connexion", "title" => "Connexion"], $head_login, new ArrayCollection([$favicon])); | 112 | $head_login_data = new NodeData(["description" => "Connexion", "title" => "Connexion"], $head_login, new ArrayCollection([$favicon])); |
| 113 | $head_article_data = new NodeData(["description" => "", "title" => ""], $head_article, new ArrayCollection([$favicon])); | 113 | $head_article_data = new NodeData(["description" => "", "title" => ""], $head_article, new ArrayCollection([$favicon])); |
| 114 | 114 | ||
diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index d7d8098..fbf0f27 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php | |||
| @@ -32,6 +32,9 @@ class Page | |||
| 32 | #[ORM\Column(type: "boolean")] | 32 | #[ORM\Column(type: "boolean")] |
| 33 | private bool $in_menu; | 33 | private bool $in_menu; |
| 34 | 34 | ||
| 35 | #[ORM\Column(type: "integer", nullable: true)] // null si hors menu | ||
| 36 | private ?int $position; | ||
| 37 | |||
| 35 | #[ORM\ManyToOne(targetEntity: self::class)] | 38 | #[ORM\ManyToOne(targetEntity: self::class)] |
| 36 | #[ORM\JoinColumn(name: "parent_id", referencedColumnName: "id_page", onDelete: "SET NULL", nullable: true)] | 39 | #[ORM\JoinColumn(name: "parent_id", referencedColumnName: "id_page", onDelete: "SET NULL", nullable: true)] |
| 37 | private ?self $parent = null; | 40 | private ?self $parent = null; |
| @@ -42,12 +45,13 @@ class Page | |||
| 42 | /*#[ORM\Column(type: "json", nullable: true)] | 45 | /*#[ORM\Column(type: "json", nullable: true)] |
| 43 | private ?array $metadata = null;*/ | 46 | private ?array $metadata = null;*/ |
| 44 | 47 | ||
| 45 | public function __construct(string $name, string $eop, bool $reachable, bool $in_menu, ?Page $parent) | 48 | public function __construct(string $name, string $eop, bool $reachable, bool $in_menu, ?int $position, ?Page $parent) |
| 46 | { | 49 | { |
| 47 | $this->name_page = $name; | 50 | $this->name_page = $name; |
| 48 | $this->end_of_path = $eop; | 51 | $this->end_of_path = $eop; |
| 49 | $this->reachable = $reachable; | 52 | $this->reachable = $reachable; |
| 50 | $this->in_menu = $in_menu; | 53 | $this->in_menu = $in_menu; |
| 54 | $this->position = $position; | ||
| 51 | $this->parent = $parent; | 55 | $this->parent = $parent; |
| 52 | $this->children = new ArrayCollection(); | 56 | $this->children = new ArrayCollection(); |
| 53 | } | 57 | } |
| @@ -73,6 +77,10 @@ class Page | |||
| 73 | { | 77 | { |
| 74 | return $this->in_menu; | 78 | return $this->in_menu; |
| 75 | } | 79 | } |
| 80 | public function getPosition(): ?int | ||
| 81 | { | ||
| 82 | return $this->position; | ||
| 83 | } | ||
| 76 | public function getParent(): ?Page | 84 | public function getParent(): ?Page |
| 77 | { | 85 | { |
| 78 | return $this->parent; | 86 | return $this->parent; |
| @@ -93,5 +101,26 @@ class Page | |||
| 93 | public function addChild(self $child): void | 101 | public function addChild(self $child): void |
| 94 | { | 102 | { |
| 95 | $this->children[] = $child; | 103 | $this->children[] = $child; |
| 104 | $this->sortChildren(); | ||
| 105 | } | ||
| 106 | |||
| 107 | // utiliser $position pour afficher les éléments dans l'ordre | ||
| 108 | private function sortChildren(): void | ||
| 109 | { | ||
| 110 | $iteration = count($this->children); | ||
| 111 | while($iteration > 1) | ||
| 112 | { | ||
| 113 | for($i = 0; $i < $iteration - 1; $i++) | ||
| 114 | { | ||
| 115 | //echo '<br>' . $this->children[$i]->getPosition() . ' - ' . $this->children[$i + 1]->getPosition(); | ||
| 116 | if($this->children[$i]->getPosition() > $this->children[$i + 1]->getPosition()) | ||
| 117 | { | ||
| 118 | $tmp = $this->children[$i]; | ||
| 119 | $this->children[$i] = $this->children[$i + 1]; | ||
| 120 | $this->children[$i + 1] = $tmp; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | $iteration--; | ||
| 124 | } | ||
| 96 | } | 125 | } |
| 97 | } | 126 | } |
diff --git a/src/view/HeaderBuilder.php b/src/view/HeaderBuilder.php index 252958a..eef2663 100644 --- a/src/view/HeaderBuilder.php +++ b/src/view/HeaderBuilder.php | |||
| @@ -6,20 +6,24 @@ use App\Entity\Node; | |||
| 6 | class HeaderBuilder extends AbstractBuilder | 6 | class HeaderBuilder extends AbstractBuilder |
| 7 | { | 7 | { |
| 8 | private ?Node $nav = null; | 8 | private ?Node $nav = null; |
| 9 | private ?Node $breadcrumb = null; | ||
| 9 | 10 | ||
| 10 | public function __construct(Node $node) | 11 | public function __construct(Node $node) |
| 11 | { | 12 | { |
| 12 | // nav | 13 | // pas de useChildrenBuilder, il faudrait peut-être |
| 13 | // n'utilise pas useChildrenBuilder, il faudrait peut-être | ||
| 14 | $children = $node->getChildren(); | 14 | $children = $node->getChildren(); |
| 15 | foreach($children as $child) | 15 | foreach($children as $child) |
| 16 | { | 16 | { |
| 17 | if($child->getName() === 'nav') | 17 | if($child->getName() === 'nav'){ |
| 18 | { | ||
| 19 | $this->nav = $child; | 18 | $this->nav = $child; |
| 20 | $nav_builder = new NavBuilder($this->nav); | 19 | $nav_builder = new NavBuilder($this->nav); |
| 21 | $nav = $nav_builder->render(); | 20 | $nav = $nav_builder->render(); |
| 22 | } | 21 | } |
| 22 | elseif($child->getName() === 'breadcrumb'){ | ||
| 23 | $this->breadcrumb = $child; | ||
| 24 | $breadcrumb_builder = new BreadcrumbBuilder($this->breadcrumb); | ||
| 25 | $breadcrumb = $breadcrumb_builder->render(); | ||
| 26 | } | ||
| 23 | } | 27 | } |
| 24 | 28 | ||
| 25 | $viewFile = self::VIEWS_PATH . $node->getName() . '.php'; | 29 | $viewFile = self::VIEWS_PATH . $node->getName() . '.php'; |
diff --git a/src/view/templates/footer.php b/src/view/templates/footer.php index 5af7924..a4e3544 100644 --- a/src/view/templates/footer.php +++ b/src/view/templates/footer.php | |||
| @@ -1,15 +1,16 @@ | |||
| 1 | <footer> | 1 | <footer> |
| 2 | <?= $breadcrumb ?> | ||
| 2 | <div> | 3 | <div> |
| 3 | <p class="contact"><?= $contact_nom ?><br> | 4 | <p class="contact"><?= $contact_nom ?><br> |
| 4 | <?= $adresse ?><br> | 5 | <?= $adresse ?><br> |
| 5 | <a href="mailto:<?= $e_mail ?>"><?= $e_mail ?></a></p> | 6 | <a href="mailto:<?= $e_mail ?>"><?= $e_mail ?></a></p> |
| 6 | <?= $breadcrumb ?> | 7 | <p class="footer_logo"><img src="<?= $logo_footer ?>" alt="logo"><p> |
| 7 | </div> | 8 | </div> |
| 9 | </footer> | ||
| 8 | <div class="<?= $empty_admin_zone ?>"></div> | 10 | <div class="<?= $empty_admin_zone ?>"></div> |
| 9 | <div class="<?= $div_admin ?>"> | 11 | <div class="<?= $div_admin ?>"> |
| 10 | <?= $zone_admin ?> | 12 | <?= $zone_admin ?> |
| 11 | </div> | 13 | </div> |
| 12 | </footer> | ||
| 13 | </div> | 14 | </div> |
| 14 | </body> | 15 | </body> |
| 15 | </html> \ No newline at end of file | 16 | </html> \ No newline at end of file |
diff --git a/src/view/templates/header.php b/src/view/templates/header.php index fa55cea..0bf4396 100644 --- a/src/view/templates/header.php +++ b/src/view/templates/header.php | |||
| @@ -13,11 +13,14 @@ | |||
| 13 | <a href="<?= new URL ?>"><h1><?= $title ?></h1></a> | 13 | <a href="<?= new URL ?>"><h1><?= $title ?></h1></a> |
| 14 | <h2><?= $description ?></h2> | 14 | <h2><?= $description ?></h2> |
| 15 | </div> | 15 | </div> |
| 16 | <div class="social"> | 16 | <div> |
| 17 | <a href="<?= $facebook_link ?>" target="_blank" rel="noopener noreferrer"> | 17 | <div class="social"> |
| 18 | <img src="<?= $facebook ?>" alt="<?= $facebook_alt ?>"></a> | 18 | <a href="<?= $facebook_link ?>" target="_blank" rel="noopener noreferrer"> |
| 19 | <a href="<?= $instagram_link ?>" target="_blank" rel="noopener noreferrer"> | 19 | <img src="<?= $facebook ?>" alt="<?= $facebook_alt ?>"></a> |
| 20 | <img src="<?= $instagram ?>" alt="<?= $instagram_alt ?>"></a> | 20 | <a href="<?= $instagram_link ?>" target="_blank" rel="noopener noreferrer"> |
| 21 | <img src="<?= $instagram ?>" alt="<?= $instagram_alt ?>"></a> | ||
| 22 | </div> | ||
| 23 | <?= $breadcrumb ?> | ||
| 21 | </div> | 24 | </div> |
| 22 | </div> | 25 | </div> |
| 23 | </header> \ No newline at end of file | 26 | </header> \ No newline at end of file |
