| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <?php
- $this->partial('aside_feed');
- $this->partial('nav_menu');
- if (!empty($this->entries)) {
- $display_today = true;
- $display_yesterday = true;
- $display_others = true;
- if (FreshRSS_Auth::hasAccess()) {
- $sharing = FreshRSS_Context::$conf->sharing;
- } else {
- $sharing = array();
- }
- $hidePosts = !FreshRSS_Context::$conf->display_posts;
- $lazyload = FreshRSS_Context::$conf->lazyload;
- $topline_read = FreshRSS_Context::$conf->topline_read;
- $topline_favorite = FreshRSS_Context::$conf->topline_favorite;
- $topline_date = FreshRSS_Context::$conf->topline_date;
- $topline_link = FreshRSS_Context::$conf->topline_link;
- $bottomline_read = FreshRSS_Context::$conf->bottomline_read;
- $bottomline_favorite = FreshRSS_Context::$conf->bottomline_favorite;
- $bottomline_sharing = FreshRSS_Context::$conf->bottomline_sharing && (count($sharing));
- $bottomline_tags = FreshRSS_Context::$conf->bottomline_tags;
- $bottomline_date = FreshRSS_Context::$conf->bottomline_date;
- $bottomline_link = FreshRSS_Context::$conf->bottomline_link;
- $content_width = FreshRSS_Context::$conf->content_width;
- $today = @strtotime('today');
- ?>
- <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
- ?><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) {
- if ($display_today && $item->isDay(FreshRSS_Days::TODAY, $today)) {
- ?><div class="day" id="day_today"><?php
- echo _t('gen.date.today');
- ?><span class="date"> — <?php echo timestamptodate(time(), false); ?></span><?php
- ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php
- ?></div><?php
- $display_today = false;
- }
- if ($display_yesterday && $item->isDay(FreshRSS_Days::YESTERDAY, $today)) {
- ?><div class="day" id="day_yesterday"><?php
- echo _t('gen.date.yesterday');
- ?><span class="date"> — <?php echo timestamptodate(time() - 86400, false); ?></span><?php
- ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php
- ?></div><?php
- $display_yesterday = false;
- }
- if ($display_others && $item->isDay(FreshRSS_Days::BEFORE_YESTERDAY, $today)) {
- ?><div class="day" id="day_before_yesterday"><?php
- echo _t('gen.date.before_yesterday');
- ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php
- ?></div><?php
- $display_others = false;
- }
- ?><div class="flux<?php echo !$item->isRead() ? ' not_read' : ''; ?><?php echo $item->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id(); ?>">
- <ul class="horizontal-list flux_header"><?php
- if (FreshRSS_Auth::hasAccess()) {
- if ($topline_read) {
- ?><li class="item manage"><?php
- $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
- if ($item->isRead()) {
- $arUrl['params']['is_read'] = 0;
- }
- ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
- echo _i($item->isRead() ? 'read' : 'unread'); ?></a><?php
- ?></li><?php
- }
- if ($topline_favorite) {
- ?><li class="item manage"><?php
- $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id()));
- if ($item->isFavorite()) {
- $arUrl['params']['is_favorite'] = 0;
- }
- ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
- echo _i($item->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
- ?></li><?php
- }
- }
- $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache
- if ($feed == null) {
- $feed = $item->feed(true);
- if ($feed == null) {
- $feed = FreshRSS_Feed::example();
- }
- }
- ?><li class="item website"><a href="<?php echo _url('index', 'index', 'get', 'f_' . $feed->id()); ?>"><img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
- <li class="item title"><a target="_blank" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></li>
- <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date(); ?> </li><?php } ?>
- <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?>
- </ul>
- <div class="flux_content">
- <div class="content <?php echo $content_width; ?>">
- <h1 class="title"><a target="_blank" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1>
- <?php
- $author = $item->author();
- echo $author != '' ? '<div class="author">' . _t('gen.short.by_author', $author) . '</div>' : '',
- $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content();
- ?>
- </div>
- <ul class="horizontal-list bottom"><?php
- if (FreshRSS_Auth::hasAccess()) {
- if ($bottomline_read) {
- ?><li class="item manage"><?php
- $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
- if ($item->isRead()) {
- $arUrl['params']['is_read'] = 0;
- }
- ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
- echo _i($item->isRead() ? 'read' : 'unread'); ?></a><?php
- ?></li><?php
- }
- if ($bottomline_favorite) {
- ?><li class="item manage"><?php
- $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id()));
- if ($item->isFavorite()) {
- $arUrl['params']['is_favorite'] = 0;
- }
- ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
- echo _i($item->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
- ?></li><?php
- }
- } ?>
- <li class="item"><?php
- if ($bottomline_sharing) {
- $link = urlencode($item->link());
- $title = urlencode($item->title() . ' · ' . $feed->name());
- ?><div class="dropdown">
- <div id="dropdown-share-<?php echo $item->id();?>" class="dropdown-target"></div>
- <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id();?>">
- <?php echo _i('share'); ?>
- <?php echo _t('index.share'); ?>
- </a>
- <ul class="dropdown-menu">
- <li class="dropdown-close"><a href="#close">❌</a></li>
- <?php
- foreach ($sharing as $share) :
- $type_share = FreshRSS_Context::$conf->shares[$share['type']];
- $has_specific_title = ($type_share['form'] === 'advanced');
- ?>
- <li class="item share">
- <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl(FreshRSS_Context::$conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>">
- <?php echo $has_specific_title ? $share['name'] : _t('index.share.' . $share['name']); ?>
- </a>
- </li>
- <?php endforeach;?>
- </ul>
- </div>
- <?php } ?>
- </li><?php
- $tags = $bottomline_tags ? $item->tags() : null;
- if (!empty($tags)) {
- ?><li class="item">
- <div class="dropdown">
- <div id="dropdown-tags-<?php echo $item->id();?>" class="dropdown-target"></div>
- <?php echo _i('tag'); ?>
- <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id();?>"><?php
- echo _t('index.tag.related');
- ?></a>
- <ul class="dropdown-menu">
- <li class="dropdown-close"><a href="#close">❌</a></li><?php
- foreach($tags as $tag) {
- ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', urlencode('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php
- } ?>
- </ul>
- </div>
- </li><?php
- }
- if ($bottomline_date) {
- ?><li class="item date"><?php echo $item->date(); ?></li><?php
- }
- if ($bottomline_link) {
- ?><li class="item link"><a target="_blank" href="<?php echo $item->link(); ?>"><?php echo _i('link'); ?></a></li><?php
- } ?>
- </ul>
- </div>
- </div>
- <?php } ?>
- <?php $this->renderHelper('pagination'); ?>
- </div>
- <?php $this->partial('nav_entries'); ?>
- <?php } else { ?>
- <div id="stream" class="prompt alert alert-warn normal">
- <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 } ?>
|