Files
FreshRSS/app/views/index/reader.phtml
Alexandre Alapetite 2374374ba9 Less jQuery (#2234)
* Less jQuery

Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2199

* Even less jQuery + global view unread title fix

* Even less jQuery

* Yet even less jQuery

* Even less jQuery

* Reduce some events

* Even less jQuery

* jQuery gone from main view

+Fixed English i18n

* Fix feed folded view

* Remove Firefox 64 workaround

Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox
65

* Split to extra.js

Avoid loading unneeded JavaScript code for the main view.
+ several adjustements

* Improve CSS transition fold category

* Rewrite shortcuts

Remove library. Much faster, shorter, one listener instead of many.
Control of the shortcut context.
Fix https://github.com/FreshRSS/FreshRSS/issues/2215

* Remove debug

* Minor syntax

* Filter out unwanted shortcut modifiers

* Menu overflow fix

* Typo

* Fix unfolding in mobile view

* Remove jQuery from category.js

* Remove jQuery from Global view
2019-02-13 15:06:28 +01:00

81 lines
3.0 KiB
PHTML

<?php
$this->partial('aside_feed');
$this->partial('nav_menu');
flush();
if (isset($this->callbackBeforeEntries)) {
call_user_func($this->callbackBeforeEntries, $this);
}
if (!empty($this->entries)) {
$lazyload = FreshRSS_Context::$user_conf->lazyload;
$content_width = FreshRSS_Context::$user_conf->content_width;
?>
<div id="stream" class="reader">
<div id="new-article">
<a href="<?php echo Minz_Url::display(Minz_Request::currentRequest()); ?>"><?php echo _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a>
</div>
<?php foreach ($this->entries as $item) {
$item = Minz_ExtensionManager::callHook('entry_before_display', $item);
if (is_null($item)) {
continue;
}
?><div class="flux<?php echo !$item->isRead() ? ' not_read' : ''; ?><?php echo $item->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id(); ?>">
<div class="flux_content">
<div class="content <?php echo $content_width; ?>">
<?php
$feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache
if (empty($feed)) $feed = $item->feed(true);
$favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id()));
if ($item->isFavorite()) {
$favoriteUrl['params']['is_favorite'] = 0;
}
$readUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
if ($item->isRead()) {
$readUrl['params']['is_read'] = 0;
}
?>
<a class="read" href="<?php echo Minz_Url::display($readUrl); ?>">
<?php echo _i($item->isRead() ? 'read' : 'unread'); ?>
</a>
<a class="bookmark" href="<?php echo Minz_Url::display($favoriteUrl); ?>">
<?php echo _i($item->isFavorite() ? 'starred' : 'non-starred'); ?>
</a>
<a class="website" href="<?php echo _url('index', 'reader', 'get', 'f_' . $feed->id()); ?>">
<img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span>
</a>
<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
$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(); ?>
</div>
</div>
</div>
<?php } ?>
<?php $this->renderHelper('pagination'); ?>
</div>
<?php } else { ?>
<div id="stream" class="prompt alert alert-warn reader">
<h2><?php echo _t('index.feed.empty'); ?></h2>
<a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.feed.add'); ?></a><br /><br />
</div>
<?php } ?>