Restructured pages
This commit is contained in:
@@ -32,8 +32,7 @@ def _strip_markdown(text, max_length=100):
|
||||
|
||||
@login_required
|
||||
def index(request):
|
||||
"""Home page with boxes and tags."""
|
||||
boxes = Box.objects.select_related('box_type').all().order_by('id')
|
||||
"""Home page with search and tags."""
|
||||
facets = Facet.objects.all().prefetch_related('tags')
|
||||
|
||||
facet_tag_counts = {}
|
||||
@@ -46,7 +45,6 @@ def index(request):
|
||||
facet_tag_counts[facet].append((tag, count))
|
||||
|
||||
return render(request, 'boxes/index.html', {
|
||||
'boxes': boxes,
|
||||
'facets': facets,
|
||||
'facet_tag_counts': facet_tag_counts,
|
||||
})
|
||||
@@ -192,9 +190,12 @@ def edit_thing(request, thing_id):
|
||||
|
||||
|
||||
@login_required
|
||||
def search(request):
|
||||
"""Search page for things."""
|
||||
return render(request, 'boxes/search.html')
|
||||
def boxes_list(request):
|
||||
"""Boxes list page showing all boxes with contents."""
|
||||
boxes = Box.objects.select_related('box_type').prefetch_related('things').all().order_by('id')
|
||||
return render(request, 'boxes/boxes_list.html', {
|
||||
'boxes': boxes,
|
||||
})
|
||||
|
||||
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user