mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-22 23:56:29 +00:00
Add ability to mark all articles from a tag as read
This commit is contained in:
parent
512e5e5bd1
commit
13c7f9a462
3 changed files with 20 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
|
||||
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}<br />
|
||||
|
||||
{% 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><br />{% endif %}
|
||||
|
||||
{% if tag %}
|
||||
{% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
|
||||
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
|
||||
{% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}<br />
|
||||
|
||||
{% 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><br />{% endif %}
|
||||
|
||||
{% if tag %}
|
||||
{% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
|
||||
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
||||
|
@ -75,6 +77,6 @@
|
|||
{% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this category in a mobi file" %}" href="./?mobi&method=category&value={{ view }}">{% trans "Download as Mobi" %}</a>{% endif %}
|
||||
{% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this category in a pdf file" %}" href="./?pdf&method=category&value={{ view }}">{% trans "Download as PDF" %}</a>{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue