From 009715494941d2669afc118992ada4c533a4ebef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20LIMOUZIN?= Date: Thu, 15 Oct 2020 09:58:58 +0200 Subject: [PATCH 1/4] Add visibility filter --- README.md | 14 +++++++---- .../src/bundle/Entity/RssFeedItems.php | 24 +++++++++++++++++++ .../src/bundle/Form/RssFeedItemsType.php | 10 +++++++- .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../views/Form/form_fields.html.twig | 11 +++++++++ .../src/bundle/Services/RssFeedsService.php | 4 ++++ 7 files changed, 60 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 727439edc..cc81baebf 100644 --- a/README.md +++ b/README.md @@ -94,13 +94,19 @@ bin/releaser tag +# Installation de splitsh-lite +https://github.com/splitsh/lite +Go on https://github.com/splitsh/lite/releases to chose a version +Then download and install it - - - - +``` +cd ~/Downloads +wget https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz +sudo tar -zxpf lite_linux_amd64.tar.gz --directory /usr/local/bin/ +sudo cp /usr/local/bin/splitsh-lite "$(git --exec-path)"/git-splitsh +``` diff --git a/components/RssFeedBundle/src/bundle/Entity/RssFeedItems.php b/components/RssFeedBundle/src/bundle/Entity/RssFeedItems.php index 29677e69f..a91959460 100644 --- a/components/RssFeedBundle/src/bundle/Entity/RssFeedItems.php +++ b/components/RssFeedBundle/src/bundle/Entity/RssFeedItems.php @@ -65,6 +65,13 @@ class RssFeedItems */ private $subtreePath; + /** + * @var bool + * + * @ORM\Column(name="only_visible", type="boolean") + */ + private $onlyVisible; + /** * @var string * @@ -149,6 +156,7 @@ public function toArray(): array return [ 'locationId' => $this->getSubtreePath(), 'includeSubtreePath' => $this->getIncludeSubtree(), + 'onlyVisible' => $this->getOnlyVisible(), 'contentTypeId' => $this->getContentTypeId(), 'fieldTypesIdentifier' => [ 'title' => $this->getTitle(), @@ -242,4 +250,20 @@ public function setMedia($media = null): self return $this; } + + /** + * @return bool + */ + public function getOnlyVisible(): bool + { + return $this->onlyVisible; + } + + /** + * @param bool $onlyVisible + */ + public function setOnlyVisible(bool $onlyVisible): void + { + $this->onlyVisible = $onlyVisible; + } } diff --git a/components/RssFeedBundle/src/bundle/Form/RssFeedItemsType.php b/components/RssFeedBundle/src/bundle/Form/RssFeedItemsType.php index 108519096..34b7c873e 100644 --- a/components/RssFeedBundle/src/bundle/Form/RssFeedItemsType.php +++ b/components/RssFeedBundle/src/bundle/Form/RssFeedItemsType.php @@ -79,6 +79,14 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'required' => false, ] ) + ->add( + 'only_visible', + CheckboxType::class, + [ + 'label' => 'ez_rss_feed.form.only_visible', + 'required' => false, + ] + ) ->add( 'contenttype_id', ChoiceType::class, @@ -226,7 +234,7 @@ public function getContentTypeList(): array $contentTypesMap[ucfirst($contentType->getName())] = $contentType->id; } ksort($contentTypesMap); - if (\count($contentTypesMap)) { + if (count($contentTypesMap)) { $defaultContentType = $this->contentTypeService ->loadContentType(array_values($contentTypesMap)[0]); $this->fieldTypeMap = $this->getFieldTypeByContentType($defaultContentType); diff --git a/components/RssFeedBundle/src/bundle/Resources/translations/messages.en.yml b/components/RssFeedBundle/src/bundle/Resources/translations/messages.en.yml index c1705272b..711d63ee0 100644 --- a/components/RssFeedBundle/src/bundle/Resources/translations/messages.en.yml +++ b/components/RssFeedBundle/src/bundle/Resources/translations/messages.en.yml @@ -19,6 +19,7 @@ ez_rss_feed.form.url_slug: URL ez_rss_feed.form.sources: Sources ez_rss_feed.form.subtree_path: Select location path ez_rss_feed.form.include_subtree: Include sub node +ez_rss_feed.form.only_visible: Only visible node ez_rss_feed.form.number_of_object: Number of objects ez_rss_feed.form.contenttype: Select content type ez_rss_feed.form.field.title: Title field diff --git a/components/RssFeedBundle/src/bundle/Resources/translations/messages.fr.yml b/components/RssFeedBundle/src/bundle/Resources/translations/messages.fr.yml index c220d6cf9..62061bd1b 100644 --- a/components/RssFeedBundle/src/bundle/Resources/translations/messages.fr.yml +++ b/components/RssFeedBundle/src/bundle/Resources/translations/messages.fr.yml @@ -19,6 +19,7 @@ ez_rss_feed.form.url_slug: URL ez_rss_feed.form.sources: Sources ez_rss_feed.form.subtree_path: Sélectionner un emplacement ez_rss_feed.form.include_subtree: Inclure les sous noeuds +ez_rss_feed.form.only_visible: Afficher uniquement les noeuds visibles ez_rss_feed.form.number_of_object: Nombre d'objet ez_rss_feed.form.contenttype: Sélectionner le type de contenu ez_rss_feed.form.field.title: Champ Titre diff --git a/components/RssFeedBundle/src/bundle/Resources/views/Form/form_fields.html.twig b/components/RssFeedBundle/src/bundle/Resources/views/Form/form_fields.html.twig index 42a0afe90..df78f9976 100644 --- a/components/RssFeedBundle/src/bundle/Resources/views/Form/form_fields.html.twig +++ b/components/RssFeedBundle/src/bundle/Resources/views/Form/form_fields.html.twig @@ -43,6 +43,17 @@ {% endblock _rss_feeds_feed_items_entry_include_subtree_row %} +{% block _rss_feeds_feed_items_entry_only_visible_row %} +
+ +
+ {{- form_errors(form) -}} + {{- form_widget(form) -}} +
+
+{% endblock _rss_feeds_feed_items_entry_only_visible_row %} {% block _rss_feeds_feed_items_entry_contenttype_id_row %}