mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-16 21:18:15 +00:00
UI - Added "unread" view filter (#3393)
Some checks failed
Build and push containers / metadata (push) Has been cancelled
Build and push containers / build-push-containers (push) Has been cancelled
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Has been cancelled
ChangeDetection.io App Test / lint-code (push) Has been cancelled
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Test the built 📦 package works basically. (push) Has been cancelled
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-10 (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-11 (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-12 (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-13 (push) Has been cancelled
Some checks failed
Build and push containers / metadata (push) Has been cancelled
Build and push containers / build-push-containers (push) Has been cancelled
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Has been cancelled
ChangeDetection.io App Test / lint-code (push) Has been cancelled
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Test the built 📦 package works basically. (push) Has been cancelled
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-10 (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-11 (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-12 (push) Has been cancelled
ChangeDetection.io App Test / test-application-3-13 (push) Has been cancelled
This commit is contained in:
@@ -44,12 +44,16 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe
|
|||||||
# Sort by last_changed and add the uuid which is usually the key..
|
# Sort by last_changed and add the uuid which is usually the key..
|
||||||
sorted_watches = []
|
sorted_watches = []
|
||||||
with_errors = request.args.get('with_errors') == "1"
|
with_errors = request.args.get('with_errors') == "1"
|
||||||
|
unread_only = request.args.get('unread') == "1"
|
||||||
errored_count = 0
|
errored_count = 0
|
||||||
search_q = request.args.get('q').strip().lower() if request.args.get('q') else False
|
search_q = request.args.get('q').strip().lower() if request.args.get('q') else False
|
||||||
for uuid, watch in datastore.data['watching'].items():
|
for uuid, watch in datastore.data['watching'].items():
|
||||||
if with_errors and not watch.get('last_error'):
|
if with_errors and not watch.get('last_error'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if unread_only and (watch.viewed or watch.last_changed == 0) :
|
||||||
|
continue
|
||||||
|
|
||||||
if active_tag_uuid and not active_tag_uuid in watch['tags']:
|
if active_tag_uuid and not active_tag_uuid in watch['tags']:
|
||||||
continue
|
continue
|
||||||
if watch.get('last_error'):
|
if watch.get('last_error'):
|
||||||
|
|||||||
@@ -245,6 +245,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
<a href="{{url_for('ui.mark_all_viewed', tag=active_tag_uuid) }}" class="pure-button button-tag " id="mark-all-viewed">Mark all viewed in '{{active_tag.title}}'</a>
|
<a href="{{url_for('ui.mark_all_viewed', tag=active_tag_uuid) }}" class="pure-button button-tag " id="mark-all-viewed">Mark all viewed in '{{active_tag.title}}'</a>
|
||||||
</li>
|
</li>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
<li id="post-list-unread" class="{%- if has_unviewed -%}has-unviewed{%- endif -%}" style="display: none;" >
|
||||||
|
<a href="{{url_for('watchlist.index', unread=1, tag=request.args.get('tag')) }}" class="pure-button button-tag">Unread</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ url_for('ui.form_watch_checknow', tag=active_tag_uuid, with_errors=request.args.get('with_errors',0)) }}" class="pure-button button-tag" id="recheck-all">Recheck
|
<a href="{{ url_for('ui.form_watch_checknow', tag=active_tag_uuid, with_errors=request.args.get('with_errors',0)) }}" class="pure-button button-tag" id="recheck-all">Recheck
|
||||||
all {% if active_tag_uuid %} in '{{active_tag.title}}'{%endif%}</a>
|
all {% if active_tag_uuid %} in '{{active_tag.title}}'{%endif%}</a>
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
// Tabs at bottom of list
|
// Tabs at bottom of list
|
||||||
$('#post-list-mark-views').toggleClass("has-unviewed", general_stats.has_unviewed);
|
$('#post-list-mark-views').toggleClass("has-unviewed", general_stats.has_unviewed);
|
||||||
|
$('#post-list-unread').toggleClass("has-unviewed", general_stats.has_unviewed);
|
||||||
$('#post-list-with-errors').toggleClass("has-error", general_stats.count_errors !== 0)
|
$('#post-list-with-errors').toggleClass("has-error", general_stats.count_errors !== 0)
|
||||||
$('#post-list-with-errors a').text(`With errors (${ general_stats.count_errors })`);
|
$('#post-list-with-errors a').text(`With errors (${ general_stats.count_errors })`);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ body.checking-now {
|
|||||||
#post-list-mark-views.has-unviewed {
|
#post-list-mark-views.has-unviewed {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
}
|
}
|
||||||
|
#post-list-unread.has-unviewed {
|
||||||
|
display: inline-block !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user