diff --git a/assets/styles/reading-lists.css b/assets/styles/reading-lists.css index eeebb5e..308bdaa 100644 --- a/assets/styles/reading-lists.css +++ b/assets/styles/reading-lists.css @@ -117,3 +117,7 @@ .workflow-status-card .badge:hover { transform: scale(1.05); } + +#aCollection li>div { + width: 100%; +} diff --git a/src/Controller/ReadingListWizardController.php b/src/Controller/ReadingListWizardController.php index b3e59f8..82b5850 100644 --- a/src/Controller/ReadingListWizardController.php +++ b/src/Controller/ReadingListWizardController.php @@ -40,10 +40,15 @@ class ReadingListWizardController extends AbstractController } #[Route('/reading-list/wizard/articles', name: 'read_wizard_articles')] - public function articles(Request $request): Response + public function articles(Request $request, ReadingListManager $readingListManager): Response { $draft = $this->getDraft($request); - if (!$draft) { + + $loadSlug = $request->query->get('load'); + if ($loadSlug) { + $draft = $readingListManager->loadPublishedListIntoDraft($loadSlug); + $this->saveDraft($request, $draft); + } elseif (!$draft) { return $this->redirectToRoute('read_wizard_setup'); } @@ -61,6 +66,11 @@ class ReadingListWizardController extends AbstractController if (!$draft->slug) { $draft->slug = $this->slugifyWithRandom($draft->title); } + // If draft articles is still empty, remove the empty string we added + if (count($draft->articles) === 1 && $draft->articles[0] === '') { + $draft->articles = []; + } + $this->saveDraft($request, $draft); return $this->redirectToRoute('read_wizard_review'); } diff --git a/src/Form/CategoryArticlesType.php b/src/Form/CategoryArticlesType.php index 69cf5be..a91c892 100644 --- a/src/Form/CategoryArticlesType.php +++ b/src/Form/CategoryArticlesType.php @@ -24,6 +24,7 @@ class CategoryArticlesType extends AbstractType ->add('articles', CollectionType::class, [ 'entry_type' => TextType::class, 'entry_options' => [ + 'required' => false, 'attr' => [ 'placeholder' => '30023:pubkey:slug' ], diff --git a/templates/components/ReadingListQuickInputComponent.html.twig b/templates/components/ReadingListQuickInputComponent.html.twig index 18b2802..aea5f60 100644 --- a/templates/components/ReadingListQuickInputComponent.html.twig +++ b/templates/components/ReadingListQuickInputComponent.html.twig @@ -1,7 +1,7 @@
Paste article links below (one per line)
+Paste article links below (one per line)
-Find articles and add them to your list
-Review your reading list. When ready, click Sign & Publish. Your NIP-07 extension will be used to sign the event.
+ {% if not is_granted('ROLE_USER') %} +A Nostr identity is required so publish the list.
+ {% endif %} +Review your reading list. When ready, click Sign & Publish. Your NIP-07 extension or signer will be used to sign the event.
{{ a }}{{ a }}{{ eventJson }}
-