Merge branch 'master' of git://github.com/chrislemonier/miniflux into feed-title

This commit is contained in:
Frederic Guillot 2013-07-21 11:48:44 -04:00
commit c681854e6a
7 changed files with 15 additions and 6 deletions

2
.gitignore vendored
View File

@ -29,7 +29,7 @@
# OS generated files # # OS generated files #
###################### ######################
.DS_Store? .DS_Store
ehthumbs.db ehthumbs.db
Icon? Icon?
Thumbs.db Thumbs.db

View File

@ -96,11 +96,14 @@ Router\get_action('show-help', function() {
Router\get_action('show', function() { Router\get_action('show', function() {
$id = Model\decode_item_id(Request\param('id')); $id = Model\decode_item_id(Request\param('id'));
$item = Model\get_item($id);
$feed = Model\get_feed($item['feed_id']);
Model\set_item_read($id); Model\set_item_read($id);
Response\html(Template\layout('show_item', array( Response\html(Template\layout('show_item', array(
'item' => Model\get_item($id), 'item' => $item,
'feed' => $feed,
'menu' => 'show' 'menu' => 'show'
))); )));
}); });
@ -111,12 +114,14 @@ Router\get_action('read', function() {
$id = Model\decode_item_id(Request\param('id')); $id = Model\decode_item_id(Request\param('id'));
$item = Model\get_item($id); $item = Model\get_item($id);
$feed = Model\get_feed($item['feed_id']);
$nav = Model\get_nav_item($item); // must be placed before set_item_read() $nav = Model\get_nav_item($item); // must be placed before set_item_read()
Model\set_item_read($id); Model\set_item_read($id);
Response\html(Template\layout('show_item', array( Response\html(Template\layout('show_item', array(
'item' => $item, 'item' => $item,
'feed' => $feed,
'item_nav' => $nav, 'item_nav' => $nav,
'menu' => 'read' 'menu' => 'read'
))); )));

View File

@ -327,7 +327,7 @@ function get_unread_items($offset = null, $limit = null)
{ {
return \PicoTools\singleton('db') return \PicoTools\singleton('db')
->table('items') ->table('items')
->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.content', 'items.bookmark', 'items.status', 'feeds.site_url') ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.content', 'items.bookmark', 'items.status', 'feeds.site_url', 'feeds.title AS feed_title')
->join('feeds', 'id', 'feed_id') ->join('feeds', 'id', 'feed_id')
->eq('status', 'unread') ->eq('status', 'unread')
->desc('updated') ->desc('updated')
@ -350,7 +350,7 @@ function get_read_items($offset = null, $limit = null)
{ {
return \PicoTools\singleton('db') return \PicoTools\singleton('db')
->table('items') ->table('items')
->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.bookmark', 'feeds.site_url') ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.bookmark', 'feeds.site_url', 'feeds.title AS feed_title')
->join('feeds', 'id', 'feed_id') ->join('feeds', 'id', 'feed_id')
->eq('status', 'read') ->eq('status', 'read')
->desc('updated') ->desc('updated')
@ -374,7 +374,7 @@ function get_bookmarks($offset = null, $limit = null)
{ {
return \PicoTools\singleton('db') return \PicoTools\singleton('db')
->table('items') ->table('items')
->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.status', 'feeds.site_url') ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'items.status', 'feeds.site_url', 'feeds.title AS feed_title')
->join('feeds', 'id', 'feed_id') ->join('feeds', 'id', 'feed_id')
->in('status', array('read', 'unread')) ->in('status', array('read', 'unread'))
->eq('bookmark', 1) ->eq('bookmark', 1)
@ -412,7 +412,7 @@ function get_feed_items($feed_id, $offset = null, $limit = null)
function get_item($id) function get_item($id)
{ {
return \PicoTools\singleton('db') return \PicoTools\singleton('db')
->table('items') ->table('items')
->eq('id', $id) ->eq('id', $id)
->findOne(); ->findOne();

View File

@ -22,6 +22,7 @@
</a> </a>
</h2> </h2>
<p> <p>
<?= Helper\escape($item['feed_title']) ?> |
<?= Helper\get_host_from_url($item['url']) ?> | <?= Helper\get_host_from_url($item['url']) ?> |
<?= dt('%e %B %Y %k:%M', $item['updated']) ?> | <?= dt('%e %B %Y %k:%M', $item['updated']) ?> |
<a href="?action=bookmark&amp;value=0&amp;id=<?= $item_id ?>&amp;redirect=bookmarks&amp;offset=<?= $offset ?>"><?= t('remove bookmark') ?></a> | <a href="?action=bookmark&amp;value=0&amp;id=<?= $item_id ?>&amp;redirect=bookmarks&amp;offset=<?= $offset ?>"><?= t('remove bookmark') ?></a> |

View File

@ -24,6 +24,7 @@
</a> </a>
</h2> </h2>
<p> <p>
<?= Helper\escape($item['feed_title']) ?> |
<?= Helper\get_host_from_url($item['url']) ?> | <?= Helper\get_host_from_url($item['url']) ?> |
<span class="hide-mobile"><?= dt('%e %B %Y %k:%M', $item['updated']) ?> |</span> <span class="hide-mobile"><?= dt('%e %B %Y %k:%M', $item['updated']) ?> |</span>

View File

@ -12,6 +12,7 @@
</h1> </h1>
<p class="infos"> <p class="infos">
<?= Helper\escape($feed['title']) ?> |
<?= Helper\get_host_from_url($item['url']) ?> | <?= Helper\get_host_from_url($item['url']) ?> |
<span class="hide-mobile"><?= dt('%A %e %B %Y %k:%M', $item['updated']) ?> |</span> <span class="hide-mobile"><?= dt('%A %e %B %Y %k:%M', $item['updated']) ?> |</span>
<?php if ($item['bookmark']): ?> <?php if ($item['bookmark']): ?>

View File

@ -33,6 +33,7 @@
<?= Helper\escape(Helper\summary(strip_tags($item['content']), 50, 300)) ?> <?= Helper\escape(Helper\summary(strip_tags($item['content']), 50, 300)) ?>
</p> </p>
<p> <p>
<?= Helper\escape($item['feed_title']) ?> |
<?= Helper\get_host_from_url($item['url']) ?> | <?= Helper\get_host_from_url($item['url']) ?> |
<span class="hide-mobile"><?= dt('%e %B %Y %k:%M', $item['updated']) ?> |</span> <span class="hide-mobile"><?= dt('%e %B %Y %k:%M', $item['updated']) ?> |</span>