添加了题目列表每个题目前边状态指示标志:ac /没有/正在进行,因为数据是存在用户表里的所以缓存的时候可以做到与题目数据分开
This commit is contained in:
@@ -8,7 +8,16 @@ def get_problem_accepted_radio(problem):
|
||||
return "0%"
|
||||
|
||||
|
||||
def get_problem_status(problems_status, problem_id):
|
||||
|
||||
if str(problem_id) in problems_status:
|
||||
if problems_status[str(problem_id)] == 1:
|
||||
return "glyphicon glyphicon-ok ac-flag"
|
||||
return "glyphicon glyphicon-minus dealing-flag"
|
||||
return ""
|
||||
|
||||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
register.filter("accepted_radio", get_problem_accepted_radio)
|
||||
register.simple_tag(get_problem_status, name="get_problem_status")
|
||||
|
||||
Reference in New Issue
Block a user