mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-23 15:38:08 +00:00
Issue-3187: addressing review comments
This commit is contained in:
parent
1a682753c0
commit
5ef104b802
2 changed files with 9 additions and 5 deletions
|
@ -33,7 +33,7 @@
|
||||||
<span data-poll="stream/{{ tab.key }}"></span>
|
<span data-poll="stream/{{ tab.key }}"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% if request.user.show_goal and not goal and tab.key == 'home' and has_read_throughs %}
|
{% if request.user.show_goal and not goal and tab.key == 'home' %}
|
||||||
{% now 'Y' as year %}
|
{% now 'Y' as year %}
|
||||||
<section class="block">
|
<section class="block">
|
||||||
{% include 'feed/goal_card.html' with year=year %}
|
{% include 'feed/goal_card.html' with year=year %}
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if annual_summary_year and tab.key == 'home' %}
|
{% if annual_summary_year and tab.key == 'home' and has_read_throughs %}
|
||||||
<section class="block is-hidden" data-hide="hide_annual_summary_{{ annual_summary_year }}">
|
<section class="block is-hidden" data-hide="hide_annual_summary_{{ annual_summary_year }}">
|
||||||
{% include 'feed/summary_card.html' with year=annual_summary_year %}
|
{% include 'feed/summary_card.html' with year=annual_summary_year %}
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" non-interactive pages """
|
""" non-interactive pages """
|
||||||
|
from datetime import date
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
@ -51,8 +52,11 @@ class Feed(View):
|
||||||
paginated = Paginator(filtered_activities, PAGE_LENGTH)
|
paginated = Paginator(filtered_activities, PAGE_LENGTH)
|
||||||
|
|
||||||
suggestions = suggested_users.get_suggestions(request.user)
|
suggestions = suggested_users.get_suggestions(request.user)
|
||||||
|
cutoff = date(get_annual_summary_year(), 12, 31)
|
||||||
readthroughs = models.ReadThrough.objects.filter(user=request.user)
|
readthroughs = models.ReadThrough.objects.filter(
|
||||||
|
user=request.user,
|
||||||
|
finish_date__lte=cutoff
|
||||||
|
)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
**feed_page_data(request.user),
|
**feed_page_data(request.user),
|
||||||
|
@ -68,7 +72,7 @@ class Feed(View):
|
||||||
"path": f"/{tab['key']}",
|
"path": f"/{tab['key']}",
|
||||||
"annual_summary_year": get_annual_summary_year(),
|
"annual_summary_year": get_annual_summary_year(),
|
||||||
"has_tour": True,
|
"has_tour": True,
|
||||||
"has_read_throughs": True if len(readthroughs) else False,
|
"has_read_throughs": len(readthroughs) > 0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "feed/feed.html", data)
|
return TemplateResponse(request, "feed/feed.html", data)
|
||||||
|
|
Loading…
Reference in a new issue