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 @@
-
- +
+ +
{% if error %} diff --git a/templates/reading_list/compose.html.twig b/templates/reading_list/compose.html.twig index 20c0f3c..8eb26a1 100644 --- a/templates/reading_list/compose.html.twig +++ b/templates/reading_list/compose.html.twig @@ -15,61 +15,18 @@
{% endif %} -
- {# Left sidebar - Reading List Preview #} -
-
- +
+
+
Quick Add Articles
+

Paste article links below (one per line)

+
- {# Main content - Simple tabbed interface #} -
- {# List Selector #} -
-
- -
-
- - {# Tabbed content #} - - -
- {# Paste tab #} -
-
-
-
Quick Add Articles
-

Paste article links below (one per line)

- -
-
-
- - {# Search tab #} - -
-
-
{% endblock %} + +{% block aside %} + {# Future sidebar content can go here #} + +{% endblock %} diff --git a/templates/reading_list/index.html.twig b/templates/reading_list/index.html.twig index d6fb7b4..b67458e 100644 --- a/templates/reading_list/index.html.twig +++ b/templates/reading_list/index.html.twig @@ -23,7 +23,7 @@ slug: {{ item.slug ?: '—' }} • created: {{ item.createdAt|date('Y-m-d H:i') }}
- Open Composer + Open Composer {% if item.slug %} View diff --git a/templates/reading_list/reading_articles.html.twig b/templates/reading_list/reading_articles.html.twig index 051524f..2d91932 100644 --- a/templates/reading_list/reading_articles.html.twig +++ b/templates/reading_list/reading_articles.html.twig @@ -15,12 +15,14 @@ {{ stimulus_controller('form-collection') }} data-form-collection-index-value="{{ form.articles|length > 0 ? form.articles|last.vars.name + 1 : 0 }}" data-form-collection-prototype-value="{{ form_widget(form.articles.vars.prototype)|e('html_attr') }}"> - - + +
+ +
diff --git a/templates/reading_list/reading_review.html.twig b/templates/reading_list/reading_review.html.twig index 4a6ceaf..45b2f9f 100644 --- a/templates/reading_list/reading_review.html.twig +++ b/templates/reading_list/reading_review.html.twig @@ -4,7 +4,10 @@

Review & Sign Reading 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.

@@ -18,27 +21,22 @@ {% if draft.articles is defined and draft.articles|length %}
- Articles: -
    - {% for a in draft.articles %} -
  • {{ a }}
  • - {% endfor %} -
+ Articles: {{ draft.articles|length }} + {% if draft.articles|length > 0 %} +
    + {% for a in draft.articles %} +
  • {{ a }}
  • + {% endfor %} +
+ {% else %} +
No articles yet.
+ {% endif %}
{% else %}
No articles yet.
{% endif %}
-
-
- Show event preview (JSON) -
-
{{ eventJson }}
-
-
-
-
-
-

Final event (with your pubkey)

-

-    
-
Cancel
- -
+
+
+

Event preview

+

+    
{% endblock %}