From 84642037350393625f0a4866ed74f564ef37973b Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 5 Dec 2024 16:19:27 +0100 Subject: Rework UI authors (#7054) Add separators, and mutualise code fix https://github.com/FreshRSS/FreshRSS/issues/7032 --- app/views/helpers/index/article.phtml | 36 ++++++-------------- app/views/helpers/index/authors.phtml | 17 ++++++++++ app/views/helpers/index/normal/entry_header.phtml | 13 ++----- app/views/index/normal.phtml | 41 +++++++---------------- 4 files changed, 42 insertions(+), 65 deletions(-) create mode 100644 app/views/helpers/index/authors.phtml (limited to 'app') diff --git a/app/views/helpers/index/article.phtml b/app/views/helpers/index/article.phtml index 0a9c75bcd..54a8cbf56 100644 --- a/app/views/helpers/index/article.phtml +++ b/app/views/helpers/index/article.phtml @@ -77,18 +77,13 @@ ✇name() ?> authors(); - if (!empty($authors) && is_array($authors)) { ?> -
- - 'author:"' . htmlspecialchars_decode($author, ENT_QUOTES) . '"'])); - ?> - - -
- + if (!empty($entry->authors())) { + $this->renderHelper('index/authors'); + if ($this->feed === null || $this->entry === null) { + throw new Exception('Unexpected side effect!'); // Should never occur. Only for PHPStan + } + } + ?>
@@ -120,20 +115,9 @@ show_favicons): ?> ✇name() ?>
- -
authors(); - if (is_array($authors)) { - foreach ($authors as $author) { - ?> - - - - -
+ renderHelper('index/authors'); + ?>
diff --git a/app/views/helpers/index/authors.phtml b/app/views/helpers/index/authors.phtml new file mode 100644 index 000000000..27cba9452 --- /dev/null +++ b/app/views/helpers/index/authors.phtml @@ -0,0 +1,17 @@ +entry === null) { + return; + } +?> +
+entry->authors() as $author) { + $href = Minz_Url::display(Minz_Request::modifiedCurrentRequest(['search' => 'author:"' . htmlspecialchars_decode($author, ENT_QUOTES) . '"'])); + ?> +
diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml index 7aa752835..459e4d180 100644 --- a/app/views/helpers/index/normal/entry_header.phtml +++ b/app/views/helpers/index/normal/entry_header.phtml @@ -15,7 +15,7 @@ if ($this->feed === null || $this->entry === null) { return; } -?>