From 58f701893e22aa1d56cf9ad4f712b2b8c485f69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Thu, 9 Oct 2025 20:28:03 +0200 Subject: [PATCH] Cleanup and such --- src/Controller/ArticleController.php | 4 ++-- src/Controller/DefaultController.php | 3 ++- templates/event/index.html.twig | 11 ++++++++--- templates/pages/latest-articles.html.twig | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/Controller/ArticleController.php b/src/Controller/ArticleController.php index e9c562c..e65b40f 100644 --- a/src/Controller/ArticleController.php +++ b/src/Controller/ArticleController.php @@ -97,10 +97,10 @@ class ArticleController extends AbstractController $cacheKey = 'article_' . $article->getEventId(); $cacheItem = $articlesCache->getItem($cacheKey); - //if (!$cacheItem->isHit()) { + if (!$cacheItem->isHit()) { $cacheItem->set($converter->convertToHTML($article->getContent())); $articlesCache->save($cacheItem); - //} + } $key = new Key(); $npub = $key->convertPublicKeyToBech32($article->getPubkey()); diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 636aab7..1335361 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -60,10 +60,10 @@ class DefaultController extends AbstractController $key = new Key(); $excludedPubkeys = [ - $key->convertToHex('npub10akm29ejpdns52ca082skmc3hr75wmv3ajv4987c9lgyrfynrmdqduqwlx'), // Discreet Log (News Bot) $key->convertToHex('npub1etsrcjz24fqewg4zmjze7t5q8c6rcwde5zdtdt4v3t3dz2navecscjjz94'), // Bitcoin Magazine (News Bot) $key->convertToHex('npub1m7szwpud3jh2k3cqe73v0fd769uzsj6rzmddh4dw67y92sw22r3sk5m3ys'), // No Bullshit Bitcoin (News Bot) $key->convertToHex('npub13wke9s6njrmugzpg6mqtvy2d49g4d6t390ng76dhxxgs9jn3f2jsmq82pk'), // TFTC (News Bot) + $key->convertToHex('npub10akm29ejpdns52ca082skmc3hr75wmv3ajv4987c9lgyrfynrmdqduqwlx'), // Discreet Log (News Bot) $key->convertToHex('npub13uvnw9qehqkds68ds76c4nfcn3y99c2rl9z8tr0p34v7ntzsmmzspwhh99'), // Batcoinz (Just annoying) $key->convertToHex('npub1fls5au5fxj6qj0t36sage857cs4tgfpla0ll8prshlhstagejtkqc9s2yl'), // AGORA Marketplace - feed 𝚋𝚘𝚝 (Just annoying) ]; @@ -92,6 +92,7 @@ class DefaultController extends AbstractController return $this->render('pages/latest-articles.html.twig', [ 'articles' => $cacheItem->get(), + 'newsBots' => array_slice($excludedPubkeys, 0, 4) ]); } diff --git a/templates/event/index.html.twig b/templates/event/index.html.twig index c15d889..4cd8012 100644 --- a/templates/event/index.html.twig +++ b/templates/event/index.html.twig @@ -115,9 +115,9 @@ -
-        {{ event|json_encode(constant('JSON_PRETTY_PRINT')) }}
-    
+
+

This is a work in progress. If your event didn't render right, we apologize. Working on it!

+
{% if nostrLinks is defined and nostrLinks|length > 0 %} @@ -153,6 +153,11 @@ {% endif %} {% if is_granted('ROLE_ADMIN') %} +

Raw Event Data

+
+            {{ event|json_encode(constant('JSON_PRETTY_PRINT')) }}
+        
+
{% if event.tags is defined and event.tags|length > 0 %}
    diff --git a/templates/pages/latest-articles.html.twig b/templates/pages/latest-articles.html.twig index 669ce24..da1174e 100644 --- a/templates/pages/latest-articles.html.twig +++ b/templates/pages/latest-articles.html.twig @@ -19,3 +19,17 @@ {% endblock %} +{% block aside %} +
    +

    News Bots

    +

    Automated news curators

    +
    + {# Use list of pubkeys in newsBots to show cards for newsbots #} + {% for bot in newsBots %} +
    +
    + +
    +
    + {% endfor %} +{% endblock %}