mirror of
https://github.com/moparisthebest/wallabag
synced 2025-01-12 06:08:29 -05:00
Add ability to mark all articles from a tag as read
This commit is contained in:
parent
7667694cc8
commit
4b5c8a61f5
@ -240,8 +240,21 @@ class Poche
|
||||
}
|
||||
break;
|
||||
case 'toggle_archive' :
|
||||
$this->store->archiveById($id, $this->user->getId());
|
||||
Tools::logm('archive link #' . $id);
|
||||
if (isset($_GET['tag_id'])) {
|
||||
//when we want to archive a whole tag
|
||||
$tag_id = $_GET['tag_id'];
|
||||
$allentry_ids = $this->store->retrieveEntriesByTag($tag_id, $this->user->getId());
|
||||
$entry_ids = array();
|
||||
foreach ($allentry_ids as $eachentry) {
|
||||
$entry_ids[] = $eachentry[0];
|
||||
}
|
||||
} else { //archive a single article
|
||||
$entry_ids = array($id);
|
||||
}
|
||||
foreach($entry_ids as $id) {
|
||||
$this->store->archiveById($id, $this->user->getId());
|
||||
Tools::logm('archive link #' . $id);
|
||||
}
|
||||
if ( Tools::isAjaxRequest() ) {
|
||||
echo 1;
|
||||
exit;
|
||||
|
@ -64,6 +64,8 @@
|
||||
|
||||
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">
|
||||
{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}
|
||||
|
||||
{% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a>{% endif %}
|
||||
|
||||
{% if tag %}<p><a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</p></a>
|
||||
{% elseif search_term is defined %}<p><a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&method=search&value={{ search_term }}">{% trans "Download the articles from this search in an epub" %}</p></a>
|
||||
|
@ -57,6 +57,8 @@
|
||||
|
||||
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}
|
||||
|
||||
{% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a>{% endif %}
|
||||
|
||||
{% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a>
|
||||
{% elseif searchterm is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&method=search&value={{ searchterm }}">{% trans "Download the articles from this search in an epub" %}</a>
|
||||
{% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&method=category&value={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %}
|
||||
|
@ -66,6 +66,8 @@
|
||||
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">
|
||||
{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}
|
||||
|
||||
{% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a>{% endif %}
|
||||
|
||||
{% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a>
|
||||
{% elseif searchterm is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&method=search&value={{ searchterm }}">{% trans "Download the articles from this search in an epub" %}</a>
|
||||
{% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&method=category&value={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user