diff --git a/index.php b/index.php
index 34e3273..96522ba 100644
--- a/index.php
+++ b/index.php
@@ -160,6 +160,14 @@ Router\get_action('mark-item-unread', function() {
});
+Router\get_action('mark-read-item-unread', function() {
+
+ $id = Model\decode_item_id(Request\param('id'));
+ Model\set_item_unread($id);
+ Response\Redirect('?action=history');
+});
+
+
Router\get_action('mark-item-removed', function() {
$id = Model\decode_item_id(Request\param('id'));
@@ -191,8 +199,31 @@ Router\post_action('mark-item-unread', function() {
Response\json(array('Ok'));
});
+Router\get_action('mark-read-item-starred', function() {
-Router\get_action('mark-item-starred', function() {
+ $id = Model\decode_item_id(Request\param('id'));
+ Model\set_item_starred($id);
+ Response\Redirect('?action=history');
+});
+
+
+Router\get_action('mark-read-item-unstarred', function() {
+
+ $id = Model\decode_item_id(Request\param('id'));
+ Model\set_item_unstarred($id);
+ Response\Redirect('?action=history');
+});
+
+
+Router\get_action('mark-starred-item-unstarred', function() {
+
+ $id = Model\decode_item_id(Request\param('id'));
+ Model\set_item_unstarred($id);
+ Response\Redirect('?action=starred');
+});
+
+
+Router\get_action('mark-unread-item-starred', function() {
$id = Model\decode_item_id(Request\param('id'));
Model\set_item_starred($id);
@@ -200,26 +231,11 @@ Router\get_action('mark-item-starred', function() {
});
-Router\get_action('mark-item-unstarred', function() {
+Router\get_action('mark-unread-item-unstarred', function() {
$id = Model\decode_item_id(Request\param('id'));
Model\set_item_unstarred($id);
- Response\Redirect('?action=starred');
-});
-
-Router\post_action('mark-item-starred', function() {
-
- $id = Model\decode_item_id(Request\param('id'));
- Model\set_item_starred($id);
- Response\json(array('Ok'));
-});
-
-
-Router\post_action('mark-item-unstarred', function() {
-
- $id = Model\decode_item_id(Request\param('id'));
- Model\set_item_unstarred($id);
- Response\json(array('Ok'));
+ Response\Redirect('?action=default');
});
diff --git a/model.php b/model.php
index f1662a3..1276a49 100644
--- a/model.php
+++ b/model.php
@@ -255,7 +255,7 @@ function get_unread_items()
{
return \PicoTools\singleton('db')
->table('items')
- ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'feeds.site_url', 'items.content')
+ ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'feeds.site_url', 'items.content','starred')
->join('feeds', 'id', 'feed_id')
->eq('status', 'unread')
->desc('updated')
@@ -267,11 +267,13 @@ function get_read_items()
{
return \PicoTools\singleton('db')
->table('items')
- ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'feeds.site_url')
+ ->columns('items.id', 'items.title', 'items.updated', 'items.url', 'feeds.site_url','starred')
->join('feeds', 'id', 'feed_id')
->eq('status', 'read')
->desc('updated')
->findAll();
+
+
}
@@ -359,7 +361,7 @@ function set_item_removed($id)
\PicoTools\singleton('db')
->table('items')
->eq('id', $id)
- ->save(array('status' => 'removed'));
+ ->save(array('status' => 'removed','starred' => 'unstarred'));
}
diff --git a/templates/history.php b/templates/history.php
index 6583290..61da813 100644
--- a/templates/history.php
+++ b/templates/history.php
@@ -1,5 +1,4 @@
-
= t('No history') ?>
@@ -24,10 +23,21 @@
+
= Helper\get_host_from_url($item['url']) ?> |
= dt('%A %e %B %Y %k:%M', $item['updated']) ?> |
- = t('mark as starred') ?> |
- = t('mark as unread') ?> |
+
+
+
+ = t('mark as unstarred') ?> |
+
+ = t('mark as starred') ?> |
+
+
+
+
+
+ = t('mark as unread') ?> |
= t('remove') ?> |
= t('Item not found') ?>
+
= Helper\get_host_from_url($item['url']) ?> |
= dt('%A %e %B %Y %k:%M', $item['updated']) ?> |
- = t('mark as starred') ?>
+
+ = t('mark as unstarred') ?>
+
+ = t('mark as starred') ?>
+
+
= $item['content'] ?>
diff --git a/templates/starred.php b/templates/starred.php
index 6f37dd7..0f7f488 100644
--- a/templates/starred.php
+++ b/templates/starred.php
@@ -23,7 +23,7 @@
= Helper\get_host_from_url($item['url']) ?> |
= dt('%A %e %B %Y %k:%M', $item['updated']) ?> |
- = t('mark as unstarred') ?> |
+ = t('mark as unstarred') ?> |
= t('remove') ?> |
= Helper\get_host_from_url($item['url']) ?> |
- = t('mark as starred') ?> |
+
+
+
+ = t('mark as unstarred') ?> |
+
+ = t('mark as starred') ?> |
+
+
= t('mark as read') ?> |