From 42f40f9ebe5a41da525726548dfeb4025d2f2a3d Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Fri, 26 Nov 2021 20:37:17 +0000 Subject: [PATCH] [CORE][CONTROLLER][Network] Refactor term 'network' into 'feeds' --- plugins/Favourite/Controller/Favourite.php | 4 +- plugins/Poll/templates/poll/newpoll.html.twig | 8 +- .../Poll/templates/poll/showpoll.html.twig | 8 +- src/Controller/{Network.php => Feeds.php} | 10 +- src/Routes/Main.php | 9 +- templates/cards/navigation/view.html.twig | 93 ++++++------------- templates/{network => feeds}/feed.html.twig | 0 .../{NetworkTest.php => FeedsTest.php} | 14 +-- 8 files changed, 53 insertions(+), 93 deletions(-) rename src/Controller/{Network.php => Feeds.php} (95%) rename templates/{network => feeds}/feed.html.twig (100%) rename tests/Controller/{NetworkTest.php => FeedsTest.php} (89%) diff --git a/plugins/Favourite/Controller/Favourite.php b/plugins/Favourite/Controller/Favourite.php index b23293010f..3999dcc399 100644 --- a/plugins/Favourite/Controller/Favourite.php +++ b/plugins/Favourite/Controller/Favourite.php @@ -178,7 +178,7 @@ class Favourite extends Controller Event::handle('FormatNoteList', [$notes, &$notes_out]); return [ - '_template' => 'network/feed.html.twig', + '_template' => 'feeds/feed.html.twig', 'notes' => $notes_out, 'page_title' => 'Favourites feed.', ]; @@ -212,7 +212,7 @@ class Favourite extends Controller Event::handle('FormatNoteList', [$notes, &$notes_out]); return [ - '_template' => 'network/feed.html.twig', + '_template' => 'feeds/feed.html.twig', 'notes' => $notes, 'page_title' => 'Reverse favourites feed.', ]; diff --git a/plugins/Poll/templates/poll/newpoll.html.twig b/plugins/Poll/templates/poll/newpoll.html.twig index f14f3fafd4..1520209da3 100644 --- a/plugins/Poll/templates/poll/newpoll.html.twig +++ b/plugins/Poll/templates/poll/newpoll.html.twig @@ -8,11 +8,11 @@ {% block stylesheets %} {{ parent() }} - - - @@ -40,4 +40,4 @@ {% endblock body %} -{% block javascripts %}{% endblock %} \ No newline at end of file +{% block javascripts %}{% endblock %} diff --git a/plugins/Poll/templates/poll/showpoll.html.twig b/plugins/Poll/templates/poll/showpoll.html.twig index 32319f3d30..90f3fba9a9 100644 --- a/plugins/Poll/templates/poll/showpoll.html.twig +++ b/plugins/Poll/templates/poll/showpoll.html.twig @@ -9,11 +9,11 @@ {% block stylesheets %} {{ parent() }} - - - {% endblock %} @@ -41,4 +41,4 @@ {% endblock body %} -{% block javascripts %}{% endblock %} \ No newline at end of file +{% block javascripts %}{% endblock %} diff --git a/src/Controller/Network.php b/src/Controller/Feeds.php similarity index 95% rename from src/Controller/Network.php rename to src/Controller/Feeds.php index e382845780..9ad70e3769 100644 --- a/src/Controller/Network.php +++ b/src/Controller/Feeds.php @@ -47,7 +47,7 @@ use App\Util\Exception\NotFoundException; use App\Util\Exception\NotImplementedException; use Symfony\Component\HttpFoundation\Request; -class Network extends Controller +class Feeds extends Controller { // Can't have constants inside herestring private $public_scope = VisibilityScope::PUBLIC; @@ -63,7 +63,7 @@ class Network extends Controller Event::handle('FormatNoteList', [$notes, &$notes_out]); return [ - '_template' => 'network/feed.html.twig', + '_template' => 'feeds/feed.html.twig', 'notes' => $notes_out, 'page_title' => 'Public feed', ]; @@ -108,7 +108,7 @@ class Network extends Controller Event::handle('FormatNoteList', [$notes, &$notes_out]); return [ - '_template' => 'network/feed.html.twig', + '_template' => 'feeds/feed.html.twig', 'notes' => $notes_out, 'page_title' => 'Home feed', ]; @@ -122,7 +122,7 @@ class Network extends Controller Event::handle('FormatNoteList', [$notes, &$notes_out]); return [ - '_template' => 'network/feed.html.twig', + '_template' => 'feeds/feed.html.twig', 'notes' => $notes_out, 'page_title' => 'Network feed', ]; @@ -141,7 +141,7 @@ class Network extends Controller Event::handle('FormatNoteList', [$notes, &$notes_out]); return [ - '_template' => 'network/feed.html.twig', + '_template' => 'feeds/feed.html.twig', 'notes' => $notes_out, 'page_title' => 'Replies feed', ]; diff --git a/src/Routes/Main.php b/src/Routes/Main.php index 79537f6a60..ab3d70f0dd 100644 --- a/src/Routes/Main.php +++ b/src/Routes/Main.php @@ -55,10 +55,11 @@ abstract class Main $r->connect('security_recover_password_token', '/main/recover-password/{token?}', [C\ResetPassword::class, 'reset']); $r->connect('root', '/', RedirectController::class, ['defaults' => ['route' => 'main_all']]); - $r->connect('main_public', '/main/public', [C\Network::class, 'public']); - $r->connect('main_all', '/main/all', [C\Network::class, 'network']); - $r->connect('home_all', '/@{nickname<' . Nickname::DISPLAY_FMT . '>}/all', [C\Network::class, 'home']); - $r->connect('replies', '/@{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [C\Network::class, 'replies']); + $r->connect('main_public', '/main/public', [C\Feeds::class, 'public']); + $r->connect('main_all', '/main/all', [C\Feeds::class, 'network']); + $r->connect('home_all', '/@{nickname<' . Nickname::DISPLAY_FMT . '>}/all', [C\Feeds::class, 'home']); + $r->connect('replies', '/@{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [C\Feeds::class, 'replies']); + $r->connect('edit_feeds', '/edit-feeds', [C\Feeds::class, 'replies']); $r->connect('panel', '/panel', [C\AdminPanel::class, 'site']); $r->connect('panel_site', '/panel/site', [C\AdminPanel::class, 'site']); diff --git a/templates/cards/navigation/view.html.twig b/templates/cards/navigation/view.html.twig index e3d11e47bc..678dd115f7 100644 --- a/templates/cards/navigation/view.html.twig +++ b/templates/cards/navigation/view.html.twig @@ -1,77 +1,36 @@ {% block feeds %} -
-

{{ icon('logo', 'icon icon-logo') | raw }} {{ 'Feeds' | trans }}

+
+

{{ icon('logo', 'icon icon-logo') | raw }} {{ 'Feeds' | trans }}

-
+
{% endblock feeds %} -{% block group %} -
-

{{ icon('logo', 'icon icon-logo') | raw }} Group

- -
-{% endblock group %} - {% block profile_current_actor %}