Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hunter-ht.cn
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘莹莹
hunter-ht.cn
Commits
fef29c46
Commit
fef29c46
authored
May 19, 2020
by
Xu Zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
score record page OK.
parent
84c38d21
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
0 deletions
+71
-0
style.css
hunter/static/hunter/style.css
+7
-0
user.html
hunter/templates/hunter/user.html
+2
-0
user_score.html
hunter/templates/hunter/user_score.html
+50
-0
urls.py
hunter/urls.py
+2
-0
views.py
hunter/views.py
+10
-0
No files found.
hunter/static/hunter/style.css
View file @
fef29c46
...
...
@@ -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
hunter/templates/hunter/user.html
View file @
fef29c46
...
...
@@ -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>
...
...
hunter/templates/hunter/user_score.html
0 → 100644
View file @
fef29c46
<!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
hunter/urls.py
View file @
fef29c46
...
...
@@ -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
hunter/views.py
View file @
fef29c46
...
...
@@ -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
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment