Browse Source

Signed-off-by: zry <admin@z-touhou.org>

zry 8 years ago
parent
commit
ca490c8c9f
2 changed files with 8 additions and 1 deletions
  1. 1 1
      templates/home/post.list.html
  2. 7 0
      views/posts.py

+ 1 - 1
templates/home/post.list.html

@@ -8,7 +8,7 @@
 {% ifequal ctname "*" %}
 	全部文章 - 丘丘塔台
 {% else %}
-	分类浏览:{{ctname}} - 丘丘塔台
+	分类浏览:{{cttitle}} - 丘丘塔台
 {% endifequal %}
 {% endblock %}
 

+ 7 - 0
views/posts.py

@@ -98,8 +98,14 @@ def PostList(request,ctname):
 		ltcl = stcl.split(',')
 		itcl = map(lambda x:str2int(x), ltcl)
 		toplist = BlogPost.objects.filter(id__in=itcl)
+		cttitle = "*"
 	else:
 		bpo = bpo.filter(category__engname=ctname)
+		try:
+			cto = BlogCategoty.objects.get(engname=ctname)
+			cttitle = cto.title
+		except:
+			cttitle = "?"
 		try:
 			cato = BlogCategoty.objects.get(engname=ctname)
 			stcl = cato.topli
@@ -124,6 +130,7 @@ def PostList(request,ctname):
 	kwvars = {
 		"request":request,
 		"ctname":ctname,
+		"cttitle":cttitle,
 		"TopList":toplist,
 		"lPage":lpg,
 		"ctlist":BlogCategoty.objects.all().order_by('order'),