WIP
This commit is contained in:
parent
040758c833
commit
b5153f3df1
6 changed files with 154 additions and 8 deletions
|
@ -1,11 +1,14 @@
|
|||
""" What's up locally """
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models import Q
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views import View
|
||||
|
||||
from bookwyrm import forms
|
||||
from . import helpers
|
||||
from bookwyrm import models
|
||||
from bookwyrm.settings import PAGE_LENGTH
|
||||
from .helpers import privacy_filter
|
||||
|
||||
|
||||
# pylint: disable= no-self-use
|
||||
|
@ -15,9 +18,19 @@ class Discover(View):
|
|||
|
||||
def get(self, request):
|
||||
"""tiled book activity page"""
|
||||
activities = privacy_filter(
|
||||
request.user,
|
||||
models.Status.objects.select_subclasses().filter(
|
||||
Q(comment__isnull=False)
|
||||
| Q(review__isnull=False)
|
||||
| Q(quotation__isnull=False),
|
||||
user__local=True
|
||||
),
|
||||
#privacy_levels=["public"]
|
||||
)
|
||||
#paginated = Paginator(activities, PAGE_LENGTH)
|
||||
data = {
|
||||
"register_form": forms.RegisterForm(),
|
||||
"request_form": forms.InviteRequestForm(),
|
||||
"books": helpers.get_landing_books(),
|
||||
"large": activities.filter(~Q(review__isnull=True, review__content=None))[:2],
|
||||
"small": activities.filter(~Q(content=None))[:4],
|
||||
}
|
||||
return TemplateResponse(request, "landing/landing.html", data)
|
||||
return TemplateResponse(request, "discover/discover.html", data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue