sh_branch
liangliangyy 7 years ago
parent 8197a37c86
commit 4a8aaaa274

@ -148,9 +148,9 @@ def load_sidebar(user, linktype):
tags = Tag.objects.all()
sidebar_tags = None
if tags and len(tags) > 0:
s = list(map(lambda t: (t, t.get_article_count()), tags))
count = sum(map(lambda t: t[1], s))
dd = 1 if (count == 0 and not len(tags)) else count / len(tags)
s = [t for t in [(t, t.get_article_count()) for t in tags] if t[1] > 0]
count = sum([t[1] for t in s])
dd = 1 if (count == 0 or not len(tags)) else count / len(tags)
import random
sidebar_tags = list(map(lambda x: (x[0], x[1], (x[1] / dd) * increment + 10), s))
random.shuffle(sidebar_tags)

@ -58,7 +58,8 @@
{% else %}
<div class="comments-area">
<h3 class="comment-meta">您还没有登录请您<a
href="{% url "account:login" %}?next={{ request.get_full_path }}">登录</a>后发表评论</h3>
href="{% url "account:login" %}?next={{ request.get_full_path }}" rel="nofollow">登录</a>后发表评论
</h3>
{% load oauth_tags %}
{% load_oauth_applications request %}

@ -9,7 +9,7 @@
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<meta name="robots" content="noindex">
<title>{{ SITE_NAME }} | {{ SITE_DESCRIPTION }}</title>
{% load compress %}
{% compress css %}

Loading…
Cancel
Save