diff --git a/blog/static/css/new.css b/blog/static/css/new.css index 8e00cd7..4187179 100644 --- a/blog/static/css/new.css +++ b/blog/static/css/new.css @@ -1,4 +1,5 @@ -a { + + a { color: #4a809a; } body{ @@ -223,10 +224,16 @@ a { background-color: rgba(41, 128, 185, 0.1); } - + #plus {display: none;} @media screen and (max-width: 900px) { #posts {padding: 0} - #header {width: 98%;} + #header {width: 100%;} //.sidemenu {background: #F7F7F8;} #search, .sidemenu {display: none} - } \ No newline at end of file + #plus {color: #FFF; float: right; + font-size: 25px; + display: block; + //height: 30px; + margin: 12px; + } + } diff --git a/blog/templates/blog/base.html b/blog/templates/blog/base.html index 6005fca..a7271ce 100644 --- a/blog/templates/blog/base.html +++ b/blog/templates/blog/base.html @@ -3,10 +3,10 @@ BLOG + + - - @@ -18,6 +18,8 @@ + +
@@ -42,13 +44,13 @@ {% endfor %}
-
+

Теги

- +
diff --git a/blog/views.py b/blog/views.py index 74e0dbc..865961c 100644 --- a/blog/views.py +++ b/blog/views.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.shortcuts import render from .models import Post -from django.db.models import Count, Q +from django.db.models import Count, Max, Min, Q from django.utils import timezone from django.shortcuts import render, get_object_or_404, render_to_response from django.shortcuts import redirect @@ -20,7 +20,7 @@ def post_list(request, page='1', tag=None): paginator = Paginator(post_list, 5) page = request.GET.get('page') latest = Post.objects.filter(published_date__lte=timezone.now()).order_by('-published_date')[0:9] - tags = Tag.objects.all().annotate(c = Count('post')) + tags = Tag.objects.all().annotate(c = Count('post'), f=Count('post')**(1/1.05)+12).filter(c__gt = 0).order_by('name') try: posts = paginator.page(page) except PageNotAnInteger: # If page is not an integer, deliver first page.