aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-09-16 10:46:27 +0200
committerGravatar GitHub <noreply@github.com> 2018-09-16 10:46:27 +0200
commitb323ed084620cac2222fe1c93ec05b9773eb81e6 (patch)
treeec1057810fd3a1971f99d1ebb60b936e0c543094 /app/views
parent9fa2122d4a27de7d9a207cea3dee911541b63420 (diff)
Improve authors (#2025)
* Links for authors and multiple authors Favour ';' as a separator instead of ',' to better cope with multi-author scientific articles. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/1997 , https://github.com/FreshRSS/FreshRSS/issues/1968, https://github.com/FreshRSS/FreshRSS/pull/2023 * Change i18n authors * Update layout * Unicode-compatible search Example for `author:Loïc` * author <em> styling * Final details * Minor spacing
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/display.phtml2
-rw-r--r--app/views/helpers/export/articles.phtml2
-rw-r--r--app/views/helpers/extension/configure.phtml2
-rw-r--r--app/views/index/normal.phtml17
-rw-r--r--app/views/index/reader.phtml16
-rwxr-xr-xapp/views/index/rss.phtml18
6 files changed, 43 insertions, 14 deletions
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index 414fd2cd6..132b9536c 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -39,7 +39,7 @@
<?php } ?>
</div>
<div class="properties">
- <div><?php echo sprintf('%s — %s', $theme['name'], _t('gen.short.by_author', $theme['author'])); ?></div>
+ <div><?php echo sprintf('%s — %s %s', $theme['name'], _t('gen.short.by_author'), $theme['author']); ?></div>
<div><?php echo $theme['description'] ?></div>
<div class="page-number"><?php echo sprintf('%d/%d', $i, $slides) ?></div>
</div>
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
index 75651483a..b8958f527 100644
--- a/app/views/helpers/export/articles.phtml
+++ b/app/views/helpers/export/articles.phtml
@@ -34,7 +34,7 @@ foreach ($this->entriesRaw as $entryRaw) {
'id' => $entry->guid(),
'categories' => array_values($entry->tags()),
'title' => $entry->title(),
- 'author' => $entry->author(),
+ 'author' => $entry->authors(true), //TODO: Make an array like tags?
'published' => $entry->date(true),
'updated' => $entry->date(true),
'alternate' => array(array(
diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml
index 95d968aba..cde872aa0 100644
--- a/app/views/helpers/extension/configure.phtml
+++ b/app/views/helpers/extension/configure.phtml
@@ -5,7 +5,7 @@
: _t('admin.extensions.disabled'); ?>
</h1>
- <p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?> — <?php echo _t('gen.short.by_author', $this->extension->getAuthor()); ?></p>
+ <p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?> — <?php echo _t('gen.short.by_author'), ' ', $this->extension->getAuthor(); ?></p>
<h2><?php echo _t('gen.action.manage'); ?></h2>
<?php
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index c7cab2d3f..e659509f9 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -67,10 +67,19 @@ if (!empty($this->entries)) {
?><div class="flux_content">
<div class="content <?php echo $content_width; ?>">
<h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1>
- <?php
- $author = $this->entry->author();
- echo $author != '' ? '<div class="author">' . _t('gen.short.by_author', $author) . '</div>' : '',
- $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content();
+ <div class="author"><?php
+ $authors = $this->entry->authors();
+ if (is_array($authors)):
+ $first = true;
+ foreach ($authors as $author):
+ echo $first ? _t('gen.short.by_author') . ' ' : '· ';
+ $first = false;
+ ?>
+<em><a href="<?php echo _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))); ?>"><?php echo $author; ?></a></em>
+ <?php endforeach; ?>
+ </div><?php
+ endif;
+ echo $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content();
?>
</div><?php
diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml
index eb6613b28..a92767f1c 100644
--- a/app/views/index/reader.phtml
+++ b/app/views/index/reader.phtml
@@ -39,9 +39,19 @@ if (!empty($this->entries)) {
<h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1>
<div class="author"><?php
- $author = $item->author();
- echo $author != '' ? _t('gen.short.by_author', $author) . ' — ' : '',
- $item->date();
+ $authors = $item->authors();
+ if (is_array($authors)):
+ $first = true;
+ foreach ($authors as $author):
+ echo $first ? _t('gen.short.by_author') . ' ' : '· ';
+ $first = false;
+ ?>
+<em><a href="<?php echo _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))); ?>"><?php echo $author; ?></a></em>
+ <?php
+ endforeach;
+ echo ' — ';
+ endif;
+ echo $item->date();
?></div>
<?php echo $item->content(); ?>
diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml
index 86074517c..104e03d15 100755
--- a/app/views/index/rss.phtml
+++ b/app/views/index/rss.phtml
@@ -13,10 +13,20 @@ foreach ($this->entries as $item) {
<item>
<title><?php echo $item->title(); ?></title>
<link><?php echo $item->link(); ?></link>
- <?php $author = $item->author(); ?>
- <?php if ($author != '') { ?>
- <dc:creator><?php echo $author; ?></dc:creator>
- <?php } ?>
+ <?php
+ $authors = $item->authors();
+ if (is_array($authors)) {
+ foreach ($authors as $author) {
+ echo "\t\t\t" , '<author>', $author, '</author>', "\n";
+ }
+ }
+ $categories = $item->tags();
+ if (is_array($categories)) {
+ foreach ($categories as $category) {
+ echo "\t\t\t" , '<category>', $category, '</category>', "\n";
+ }
+ }
+ ?>
<description><![CDATA[<?php
echo $item->content();
?>]]></description>