Skip to content

Commit

Permalink
Minor web app fixes for #254.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Oct 7, 2021
1 parent 7ef2c69 commit 4278939
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/reader/_app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ def mark_as_important(data):
def mark_as_unimportant(data):
feed_url = data['feed-url']
entry_id = data['entry-id']
get_reader().mark_entry_as_unimportant((feed_url, entry_id))
# only "don't care" sets important_modified
get_reader().mark_entry_as_important((feed_url, entry_id), False, modified=None)


@form_api(really=True)
Expand Down
1 change: 1 addition & 0 deletions src/reader/_app/templates/entries.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ <h2><a href="{{ entry.link }}">
('mark-as-unread', feed.url, entry.id),
('mark-as-important', feed.url, entry.id),
('mark-as-unimportant', feed.url, entry.id),
('mark-as-dont-care', feed.url, entry.id),
) %}
<li class="error">{{ message }}
{% endfor %}
Expand Down
14 changes: 10 additions & 4 deletions src/reader/_app/templates/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,28 @@
{% set context = {'feed-url': feed.url, 'entry-id': entry.id} %}

{% if entry.read %}
{{ macros.simple_button('.form_api', 'mark-as-unread', 'unread', leave_disabled=true, next=next, context=context) }}
{{ macros.simple_button('.form_api', 'mark-as-unread', 'unread', leave_disabled=true, next=next, context=context, title=entry.read_modified or "not modified") }}
{% else %}
{{ macros.simple_button('.form_api', 'mark-as-read', 'read', leave_disabled=true, next=next, context=context) }}
{{ macros.simple_button('.form_api', 'mark-as-read', 'read', leave_disabled=true, next=next, context=context, title=entry.read_modified or "not modified") }}
{% endif %}

{% if entry.important %}
{{ macros.simple_button('.form_api', 'mark-as-unimportant', 'unimportant', leave_disabled=true, next=next, context=context) }}
{{ macros.simple_button('.form_api', 'mark-as-unimportant', 'unimportant', leave_disabled=true, next=next, context=context, title=entry.important_modified or "not modified") }}
{% else %}
{{ macros.simple_button('.form_api', 'mark-as-important', 'important', leave_disabled=true, next=next, context=context) }}
{{ macros.simple_button('.form_api', 'mark-as-important', 'important', leave_disabled=true, next=next, context=context, title=entry.important_modified or "not modified") }}
{% endif %}

{% if not (entry.read and not entry.important and entry.important_modified) %}
{{ macros.simple_button('.form_api', 'mark-as-dont-care', "don't care", leave_disabled=true, next=next, context=context) }}
{% endif %}


{% for message in get_flashed_messages_by_prefix(
('mark-as-read', feed.url, entry.id),
('mark-as-unread', feed.url, entry.id),
('mark-as-important', feed.url, entry.id),
('mark-as-unimportant', feed.url, entry.id),
('mark-as-dont-care', feed.url, entry.id),
) %}
<li class="error">{{ message }}
{% endfor %}
Expand Down

0 comments on commit 4278939

Please sign in to comment.