Add refresh link to the feed page items

This commit is contained in:
Frédéric Guillot 2014-12-10 21:26:07 -05:00
parent 04749a4aba
commit 5e0e079afa
2 changed files with 8 additions and 2 deletions

View File

@ -83,8 +83,11 @@ Router\get_action('remove-feed', function() {
// Refresh one feed and redirect to unread items
Router\get_action('refresh-feed', function() {
Model\Feed\refresh(Request\int_param('feed_id'));
Response\redirect('?action=unread');
$feed_id = Request\int_param('feed_id');
$redirect = Request\param('redirect', 'unread');
Model\Feed\refresh($feed_id);
Response\redirect('?action='.$redirect.'&feed_id='.$feed_id);
});
// Ajax call to refresh one feed

View File

@ -7,6 +7,9 @@
<div class="page-header">
<h2><?= Helper\escape($feed['title']) ?><span id="page-counter"><?= isset($nb_items) ? $nb_items : '' ?></span></h2>
<ul>
<li>
<a href="?action=refresh-feed&amp;feed_id=<?= $feed['id'] ?>&amp;redirect=feed-items"><?= t('refresh') ?></a>
</li>
<li>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>&amp;order=updated&amp;direction=<?= $direction == 'asc' ? 'desc' : 'asc' ?>"><?= tne('sort by date<span class="hide-mobile"> (%s)</span>', $direction == 'desc' ? t('older first') : t('most recent first')) ?></a>
</li>