diff --git a/assets/styles/02-layout/layout.css b/assets/styles/02-layout/layout.css index 70128ed..01b7047 100644 --- a/assets/styles/02-layout/layout.css +++ b/assets/styles/02-layout/layout.css @@ -148,6 +148,16 @@ aside header { display: none; } +/* Responsive adjustments */ +@media (max-width: 1200px) { + .layout { + grid-template-columns: 240px auto; + } + aside { + display: none; /* Hide the sidebars on small screens */ + } +} + /* Responsive adjustments */ @media (max-width: 768px) { .layout { diff --git a/assets/styles/05-utilities/utilities.css b/assets/styles/05-utilities/utilities.css index 9c0ecfc..f550f07 100644 --- a/assets/styles/05-utilities/utilities.css +++ b/assets/styles/05-utilities/utilities.css @@ -14,6 +14,13 @@ .mx-0{margin-left:0!important;margin-right:0!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-3{margin-left:1rem!important;margin-right:1rem!important}.mx-4{margin-left:1.5rem!important;margin-right:1.5rem!important}.mx-5{margin-left:3rem!important;margin-right:3rem!important} .my-0{margin-top:0!important;margin-bottom:0!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important} .mx-auto{margin-left:auto!important;margin-right:auto!important} +.p-0{padding:0!important;}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important} +.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important} +.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important} +.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important} +.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important} +.px-0{padding-left:0!important;padding-right:0!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:1rem!important;padding-right:1rem!important}.px-4{padding-left:1.5rem!important;padding-right:1.5rem!important}.px-5{padding-left:3rem!important;padding-right:3rem!important} +.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important} /* Display & layout */ .d-flex{display:flex!important;flex-direction:column} diff --git a/src/Controller/AuthorController.php b/src/Controller/AuthorController.php index 109ed48..a43c5c2 100644 --- a/src/Controller/AuthorController.php +++ b/src/Controller/AuthorController.php @@ -33,7 +33,55 @@ class AuthorController extends AbstractController { /** - * Lists + * Reading List Index + */ + #[Route('/p/{npub}/lists', name: 'author-reading-lists')] + public function readingLists($npub, + EntityManagerInterface $em, + NostrKeyUtil $keyUtil, + LoggerInterface $logger): Response + { + // Convert npub to hex pubkey + $pubkey = $keyUtil->npubToHex($npub); + $logger->info(sprintf('Reading list: pubkey=%s', $pubkey)); + // Find reading lists by pubkey, kind 30040 directly from database + $repo = $em->getRepository(Event::class); + $lists = $repo->findBy(['pubkey' => $pubkey, 'kind' => KindsEnum::PUBLICATION_INDEX], ['created_at' => 'DESC']); + // Filter to ensure they have a 'type:reading-list' tag + $filteredLists = []; + $seenSlugs = []; + foreach ($lists as $ev) { + if (!$ev instanceof Event) continue; + $tags = $ev->getTags(); + $isReadingList = false; + $title = null; $slug = null; $summary = null; + foreach ($tags as $t) { + if (is_array($t)) { + if (($t[0] ?? null) === 'type' && ($t[1] ?? null) === 'reading-list') { $isReadingList = true; } + if (($t[0] ?? null) === 'title') { $title = (string)$t[1]; } + if (($t[0] ?? null) === 'summary') { $summary = (string)$t[1]; } + if (($t[0] ?? null) === 'd') { $slug = (string)$t[1]; } + } + } + if ($isReadingList) { + // Collapse by slug: keep only newest per slug + $keySlug = $slug ?: ('__no_slug__:' . $ev->getId()); + if (isset($seenSlugs[$slug ?? $keySlug])) { + continue; + } + $seenSlugs[$slug ?? $keySlug] = true; + $filteredLists[] = $ev; + } + } + + return $this->render('profile/author-lists.html.twig', [ + 'lists' => $filteredLists, + 'npub' => $npub, + ]); + } + + /** + * List * @throws Exception */ #[Route('/p/{npub}/list/{slug}', name: 'reading-list')] @@ -128,7 +176,7 @@ class AuthorController extends AbstractController $event->noteId = $nip19->encodeNote($event->id); } - return $this->render('pages/author-media.html.twig', [ + return $this->render('profile/author-media.html.twig', [ 'author' => $author, 'npub' => $npub, 'pictureEvents' => $mediaEvents, @@ -210,7 +258,7 @@ class AuthorController extends AbstractController } - return $this->render('pages/author.html.twig', [ + return $this->render('profile/author.html.twig', [ 'author' => $author, 'npub' => $npub, 'pubkey' => $pubkey, diff --git a/src/Controller/ReadingListController.php b/src/Controller/ReadingListController.php index a13644f..4ddea2b 100644 --- a/src/Controller/ReadingListController.php +++ b/src/Controller/ReadingListController.php @@ -18,6 +18,9 @@ use Symfony\Component\Routing\Attribute\Route; class ReadingListController extends AbstractController { + /** + * Display the user's reading lists. + */ #[Route('/reading-list', name: 'reading_list_index')] public function index(EntityManagerInterface $em): Response { diff --git a/templates/components/Organisms/ReadingListList.html.twig b/templates/components/Organisms/ReadingListList.html.twig index 6197c35..c8cd3a7 100644 --- a/templates/components/Organisms/ReadingListList.html.twig +++ b/templates/components/Organisms/ReadingListList.html.twig @@ -2,14 +2,13 @@ {% set items = this.lists %} {% if items is not empty %} {% for item in items %} -
-

{{ item.title }}

-

by

- {{ item.createdAt|date('Y-m-d') }} +
+

{{ item.title }}

{% if item.summary is defined and item.summary %}

{{ item.summary }}

{% endif %} -
+

by

+ {% endfor %} {% else %}

No reading lists yet.

diff --git a/templates/components/Organisms/ZineList.html.twig b/templates/components/Organisms/ZineList.html.twig index 191201b..d448d8d 100644 --- a/templates/components/Organisms/ZineList.html.twig +++ b/templates/components/Organisms/ZineList.html.twig @@ -1,7 +1,7 @@
{% if nzines is not empty %} {% for item in nzines %} -
+ -
{% endfor %} {% else %}

No magazines yet.

diff --git a/templates/components/UserMenu.html.twig b/templates/components/UserMenu.html.twig index 25ac226..28cdf13 100644 --- a/templates/components/UserMenu.html.twig +++ b/templates/components/UserMenu.html.twig @@ -11,10 +11,14 @@ {% endif %}