Commit fef29c46 by Xu Zhou

score record page OK.

parent 84c38d21
......@@ -883,4 +883,10 @@ li svg{
}
.change_open:hover{
color:dimgrey;
}
.list_head,.list_score_body,.list_records_body{
width:100%;
height:45px;
line-height: 45px;
}
\ No newline at end of file
......@@ -56,7 +56,9 @@
<input type="hidden" name="user_id" value="{{ user.userID }}"/>
</form>
{% endif %}
<span> (<a href="/get_user_scores"> {{user.score}} </a> 分)</span>
<a href="{% url 'hunter:detail' user.userID %}" id="username" class="main_bar" >{{ usr.name }}</a>
</div>
</div>
</div>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>个人中心-积分纪录 </title>
{% load static %}
<link rel="icon" href="{% static 'hunter/images/logo.ico' %}" type="text/icon">
<link rel="stylesheet" type="text/css" href="{% static 'hunter/style.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'hunter/detail.css' %}">
<script src="{% static 'hunter/jquery-1.9.1.min.js' %}"></script>
<script src="{% static 'hunter/jquery.form.js' %}"></script>
<style type="text/css">
ul li{
display: block;
float: left;
width:30%;
text-align: center;
}
.list_head>ul{
background: black;
color:white;
}
</style>
</head>
<body>
<div id="resume">
<div class="user_score_List">
<div class="list_head">
<ul>
<li>总分</li>
<li>已使用</li>
<li>可用积分</li>
</ul>
</div>
{% for record in records %}
<ul class="list_records_body">
<li> {{ record.reason }} </li>
<li> {{ record.editDate }} </li>
<li> {{ record.score }} </li>
</ul>
{% endfor %}
</div>
</div>
</body>
\ No newline at end of file
......@@ -36,4 +36,5 @@ urlpatterns = [
path('add_user/', views.add_user, name='add_user'),
path('update_article/', views.update_article, name='update_article'),
path('add_sub_score/', views.add_sub_score, name='add_sub_score'),
path('get_user_scores/', views.user_score_records, name='get_user_scores'),
]
\ No newline at end of file
......@@ -779,6 +779,16 @@ def admin(request):
print(users)
return render(request,"hunter/admin.html", locals())
def user_score_records(request):
user_id = None
if request.method == 'POST':
user_id = request.POST.get('user_id')
if user_id == None:
user_id = request.session.get('user_id')
if user_id != None:
records = ScoreRecords.objects.filter(userID = user_id);
return render(request,"hunter/user_score.html", locals())
@csrf_exempt
def operator(request):
message = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment