From d9c3f2aa783b1a0807def9b084a285d5e5c92137 Mon Sep 17 00:00:00 2001
From: vgreb
Hormis la conférence "Cessons les estimations" de Frédéric Leguédois, qui n'était pas captée à sa demande, tous les talks sont disponibles sur notre page "vidéos". Faites passer à vos voisins et collègues, visionnez les sujets que vous avez manqués, revoyez ce talk qui vous a fasciné, et surtout, surtout, imaginez le plaisir de les voir en live : venez nous voir en octobre au Forum PHP 2019 ou en mai à l'AFUP Day !
+Fidèle à notre mission de diffusion du savoir auprès des développeurs PHP, nous mettons en ligne les captations vidéo des conférences données il y a à peine trois semaines lors du Forum PHP 2018. + +Hormis la conférence "Cessons les estimations" de Frédéric Leguédois, qui n'était pas captée [à sa demande](https://www.leguedois.fr/pourquoi-les-conferences-ne-sont-pas-filmees/), tous les talks sont disponibles sur notre page "[vidéos](../../talks/)". Faites passer à vos voisins et collègues, visionnez les sujets que vous avez manqués, revoyez ce talk qui vous a fasciné, et surtout, surtout, imaginez le plaisir de les voir en live : **venez nous voir en octobre au Forum PHP 2019 ou en mai à l'AFUP Day !** EOF; $data = [ @@ -36,7 +37,6 @@ public function run(): void ]; $data[] = $this->createMarkdownArticle(); - $data[] = $this->createHTMLArticle(); $slugger = Slugify::create(); $faker = Factory::create(); @@ -75,6 +75,7 @@ private function createMarkdownArticle(): array Et un peu *de texte en italic*. ### Une dernière section + Un texte avec un lien [commodi delectus](https://afup.org) et encore un peu de texte. MARKDOWN; @@ -90,35 +91,4 @@ private function createMarkdownArticle(): array 'type_contenu' => ArticleContentType::Markdown->value, ]; } - - private function createHTMLArticle(): array - { - $contenu = <<Un premier titre ! -Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam aperiam dolor, eligendi expedita nisi quibusdam repellendus repudiandae!
- -Un peu de texte en gras.
-
-Et un peu de texte en italic.
Un texte avec un lien commodi delectus et encore un peu de texte.
-
-Un peu de gras
-avec un saut de ligne en base
Lorem ipsum dolor si amet.
", - 'contenu' => $contenu, - 'raccourci' => 'un-article-en-html', - 'id_site_rubrique' => Rubrique::ID_RUBRIQUE_ACTUALITES, - 'date' => 1761858722, - 'id_forum' => Event::ID_FORUM, - 'etat' => 1, - 'type_contenu' => ArticleContentType::Html->value, - ]; - } } diff --git a/sources/AppBundle/Site/Form/ArticleType.php b/sources/AppBundle/Site/Form/ArticleType.php index f6f572497..a0b7aeb76 100644 --- a/sources/AppBundle/Site/Form/ArticleType.php +++ b/sources/AppBundle/Site/Form/ArticleType.php @@ -44,9 +44,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void /** @var \AppBundle\Site\Model\Article|null $article */ $article = $builder->getData(); $textareaCssClass = 'simplemde'; - if ($article !== null && $article->isContentTypeMarkdown() === false) { - $textareaCssClass = 'tinymce'; - } + $builder ->add('title', TextType::class, [ diff --git a/sources/AppBundle/Site/Form/RubriqueType.php b/sources/AppBundle/Site/Form/RubriqueType.php index ec4e9c256..5ec5f200b 100644 --- a/sources/AppBundle/Site/Form/RubriqueType.php +++ b/sources/AppBundle/Site/Form/RubriqueType.php @@ -67,7 +67,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'maxlength' => 255, 'cols' => 42, 'rows' => 10, - 'class' => 'tinymce', + 'class' => 'simplemde', ], 'constraints' => [ new Assert\Length(max: 255), @@ -80,7 +80,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'attr' => [ 'cols' => 42, 'rows' => 20, - 'class' => 'tinymce', + 'class' => 'simplemde', ], 'constraints' => [ new Assert\NotBlank(), diff --git a/sources/AppBundle/Site/Model/Article.php b/sources/AppBundle/Site/Model/Article.php index 7af1e6f0c..95e7f70c2 100644 --- a/sources/AppBundle/Site/Model/Article.php +++ b/sources/AppBundle/Site/Model/Article.php @@ -153,12 +153,8 @@ public function setPath($path): self */ public function getFormatedLeadParagraph() { - $leadParagraph = $this->leadParagraph; - - if ($this->isContentTypeMarkdown()) { - $parseDown = new \Parsedown(); - $leadParagraph = $parseDown->parse($leadParagraph); - } + $parseDown = new \Parsedown(); + $leadParagraph = $parseDown->parse($this->leadParagraph); return $leadParagraph; } @@ -191,12 +187,8 @@ public function getContent() public function getFormatedContent() { - $content = $this->content; - - if ($this->isContentTypeMarkdown()) { - $parseDown = new \Parsedown(); - $content = $parseDown->parse($content); - } + $parseDown = new \Parsedown(); + $content = $parseDown->parse($this->content); return $content; } diff --git a/templates/admin/base.html.twig b/templates/admin/base.html.twig index 96bca899f..f61f23677 100644 --- a/templates/admin/base.html.twig +++ b/templates/admin/base.html.twig @@ -14,8 +14,6 @@ - - diff --git a/tests/behat/features/Admin/Site/AdminSiteArticles.feature b/tests/behat/features/Admin/Site/AdminSiteArticles.feature index 6ac7a526e..ea459d87f 100644 --- a/tests/behat/features/Admin/Site/AdminSiteArticles.feature +++ b/tests/behat/features/Admin/Site/AdminSiteArticles.feature @@ -39,7 +39,7 @@ Feature: Administration - Partie Site When I should see "Liste des articles" Then the ".content table" element should contain "Le titre de l'article" # vérification de l'article sur le site publique - When I go to "/news/18-url-article" + When I go to "/news/17-url-article" Then I should see "Le titre de l'article" Then I should see "Le chapeau de l'article" Then I should see "Le contenu de l'article" @@ -106,7 +106,7 @@ Feature: Administration - Partie Site And I follow "Articles" # Vérification du markdown inchangé dans le formulaire - Then I follow "modifier_18" + Then I follow "modifier_17" And I should see "Modifier un article" And the "article[title]" field should contain "Le titre markdown" And the "article[leadParagraph]" field should contain "Le *chapeau* markdown" diff --git a/tests/behat/features/PublicSite/News.feature b/tests/behat/features/PublicSite/News.feature index 0bd5a9984..69efd5586 100644 --- a/tests/behat/features/PublicSite/News.feature +++ b/tests/behat/features/PublicSite/News.feature @@ -41,16 +41,3 @@ Feature: Site Public - News """ commodi delectus """ - - @reloadDbWithTestData - Scenario: Affichage d'un article HTML - Given I am on the homepage - When I follow "Actualités" - And I follow "Lire l'article: Un article en HTML" - And the response should contain the html "