diff --git a/blog/views.py b/blog/views.py index 23c8e35..5bdaf10 100644 --- a/blog/views.py +++ b/blog/views.py @@ -10,7 +10,8 @@ def listing(request, tag, year, month, day, page): kwargs = {} kwargs['draft'] = False - view = index + view = 'index' + if (tag == None): view = "index" else: @@ -36,7 +37,10 @@ def listing(request, tag, year, month, day, page): except EmptyPage: posts = paginator.page(paginator.num_pages) - return render(request, 'blog/listing.html', { 'posts': posts, 'view': "blog:" + view }) + if paginator.num_pages > 1: + view = view + 'page' + + return render(request, 'blog/listing.html', { 'posts': posts, 'tag': tag, 'view': "blog:" + view }) def index(request): return listing(request, None, None, None, None, 1) diff --git a/gergelypolonkaiweb/templates/paginator.html b/gergelypolonkaiweb/templates/paginator.html index 14d689b..10ea27b 100644 --- a/gergelypolonkaiweb/templates/paginator.html +++ b/gergelypolonkaiweb/templates/paginator.html @@ -1,19 +1,39 @@ {% if list.paginator.num_pages > 1 %}