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
9fbad193
Commit
9fbad193
authored
Apr 28, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一上午都没搞完一个
parent
777382f8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
13 deletions
+73
-13
models.py
Hunter_ht/hunter/models.py
+1
-0
bootstrap-datetimepicker.js
Hunter_ht/hunter/static/hunter/bootstrap-datetimepicker.js
+0
-0
bootstrap-datetimepicker.zh-CN.js
...ht/hunter/static/hunter/bootstrap-datetimepicker.zh-CN.js
+16
-0
delete.png
Hunter_ht/hunter/static/hunter/images/delete.png
+0
-0
jquery.form.js
Hunter_ht/hunter/static/hunter/jquery.form.js
+0
-0
style.css
Hunter_ht/hunter/static/hunter/style.css
+7
-2
detail.html
Hunter_ht/hunter/templates/hunter/detail.html
+9
-3
user.html
Hunter_ht/hunter/templates/hunter/user.html
+0
-0
views.py
Hunter_ht/hunter/views.py
+40
-8
No files found.
Hunter_ht/hunter/models.py
View file @
9fbad193
...
@@ -43,6 +43,7 @@ class Publications(models.Model):
...
@@ -43,6 +43,7 @@ class Publications(models.Model):
class
PubToUser
(
models
.
Model
):
class
PubToUser
(
models
.
Model
):
pubID
=
models
.
BigIntegerField
()
pubID
=
models
.
BigIntegerField
()
username
=
models
.
CharField
(
max_length
=
50
)
username
=
models
.
CharField
(
max_length
=
50
)
userID
=
models
.
IntegerField
(
default
=
0
)
class
Articles
(
models
.
Model
):
class
Articles
(
models
.
Model
):
...
...
Hunter_ht/hunter/static/hunter/bootstrap-datetimepicker.js
0 → 100644
View file @
9fbad193
This diff is collapsed.
Click to expand it.
Hunter_ht/hunter/static/hunter/bootstrap-datetimepicker.zh-CN.js
0 → 100644
View file @
9fbad193
/**
* Simplified Chinese translation for bootstrap-datetimepicker
* Yuan Cheung <advanimal@gmail.com>
*/
;(
function
(
$
){
$
.
fn
.
datetimepicker
.
dates
[
'zh-CN'
]
=
{
days
:
[
"星期日"
,
"星期一"
,
"星期二"
,
"星期三"
,
"星期四"
,
"星期五"
,
"星期六"
,
"星期日"
],
daysShort
:
[
"周日"
,
"周一"
,
"周二"
,
"周三"
,
"周四"
,
"周五"
,
"周六"
,
"周日"
],
daysMin
:
[
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
,
"日"
],
months
:
[
"01"
,
"02"
,
"03"
,
"04"
,
"05"
,
"06"
,
"07"
,
"08"
,
"09"
,
"10"
,
"11"
,
"12"
],
monthsShort
:
[
"01"
,
"02"
,
"03"
,
"04"
,
"05"
,
"06"
,
"07"
,
"08"
,
"09"
,
"10"
,
"11"
,
"12"
],
today
:
"今天"
,
suffix
:
[],
meridiem
:
[
"上午"
,
"下午"
]
};
}(
jQuery
));
Hunter_ht/hunter/static/hunter/images/delete.png
0 → 100644
View file @
9fbad193
308 Bytes
Hunter_ht/hunter/static/hunter/jquery.form.js
0 → 100644
View file @
9fbad193
This diff is collapsed.
Click to expand it.
Hunter_ht/hunter/static/hunter/style.css
View file @
9fbad193
...
@@ -656,8 +656,13 @@ section > .smaller_box{
...
@@ -656,8 +656,13 @@ section > .smaller_box{
li
svg
{
li
svg
{
margin
:
10px
5px
;
margin
:
10px
5px
;
}
}
.right
button
,
.li_right
button
{
background
:
transparent
;
.dele_img
{
width
:
20px
;
height
:
20px
;
margin
:
5px
0
;
background-image
:
url("/static/hunter/images/delete.png")
;
}
}
.add_one
button
svg
{
.add_one
button
svg
{
margin
:
8px
5px
;
margin
:
8px
5px
;
...
...
Hunter_ht/hunter/templates/hunter/detail.html
View file @
9fbad193
...
@@ -17,11 +17,12 @@
...
@@ -17,11 +17,12 @@
<span>
{{ user.mailAddress }}
</span>
<span>
{{ user.mailAddress }}
</span>
{% endif %}
{% endif %}
{% if user.personal_website %}
{% if user.personal_website %}
<a
href=
"
{{ user.personal_website }}
"
target=
"_blank"
>
{{ user.personal_website }}
</a>
<a
href=
"
javascript:goUrl({{ user.personal_website }})
"
target=
"_blank"
>
{{ user.personal_website }}
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
{% if publications %}
<div
class=
"section"
>
<div
class=
"section"
>
<span>
PUBLICATIONS
</span>
<span>
PUBLICATIONS
</span>
{% for year,publications in publication_year_list.items %}
{% for year,publications in publication_year_list.items %}
...
@@ -31,7 +32,6 @@
...
@@ -31,7 +32,6 @@
{{ year }}
{{ year }}
</span>
</span>
</div>
</div>
{% if publications %}
{% for publication in publications %}
{% for publication in publications %}
<ul>
<ul>
<li>
<li>
...
@@ -45,10 +45,10 @@
...
@@ -45,10 +45,10 @@
</li>
</li>
</ul>
</ul>
{% endfor %}
{% endfor %}
{% endif %}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
{% if cve_year_list.items %}
{% if cve_year_list.items %}
<div
class=
"section"
>
<div
class=
"section"
>
<span>
MY-CVE
</span>
<span>
MY-CVE
</span>
...
@@ -79,5 +79,10 @@
...
@@ -79,5 +79,10 @@
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
<script>
function
goUrl
(
url
){
window
.
open
(
url
);
}
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
Hunter_ht/hunter/templates/hunter/user.html
View file @
9fbad193
This diff is collapsed.
Click to expand it.
Hunter_ht/hunter/views.py
View file @
9fbad193
...
@@ -149,7 +149,7 @@ def user(request, user_id):
...
@@ -149,7 +149,7 @@ def user(request, user_id):
username
=
usr
.
name
username
=
usr
.
name
u
=
{
'userID'
:
user_id
,
'name'
:
username
}
u
=
{
'userID'
:
user_id
,
'name'
:
username
}
my_publication_year_list
=
{}
my_publication_year_list
=
{}
pub_ids
=
PubToUser
.
objects
.
filter
(
user
name
=
username
)
.
all
()
.
values
(
"pubID"
)
pub_ids
=
PubToUser
.
objects
.
filter
(
user
ID
=
user_id
)
.
all
()
.
values
(
"pubID"
)
for
pub_id
in
pub_ids
:
for
pub_id
in
pub_ids
:
print
(
pub_id
)
print
(
pub_id
)
pub
=
get_object_or_404
(
Publications
,
pk
=
pub_id
[
'pubID'
])
pub
=
get_object_or_404
(
Publications
,
pk
=
pub_id
[
'pubID'
])
...
@@ -195,7 +195,7 @@ def detail(request, user_id):
...
@@ -195,7 +195,7 @@ def detail(request, user_id):
usr
=
get_object_or_404
(
User
,
pk
=
user_id
)
usr
=
get_object_or_404
(
User
,
pk
=
user_id
)
username
=
usr
.
name
username
=
usr
.
name
my_publication_year_list
=
{}
my_publication_year_list
=
{}
pub_ids
=
PubToUser
.
objects
.
filter
(
user
name
=
username
)
.
all
()
.
values
(
"pubID"
)
pub_ids
=
PubToUser
.
objects
.
filter
(
user
ID
=
user_id
)
.
all
()
.
values
(
"pubID"
)
for
pub_id
in
pub_ids
:
for
pub_id
in
pub_ids
:
pub
=
get_object_or_404
(
Publications
,
pk
=
pub_id
[
'pubID'
])
pub
=
get_object_or_404
(
Publications
,
pk
=
pub_id
[
'pubID'
])
year
=
str
(
pub
.
date
)[
0
:
4
]
year
=
str
(
pub
.
date
)[
0
:
4
]
...
@@ -228,7 +228,7 @@ def detail(request, user_id):
...
@@ -228,7 +228,7 @@ def detail(request, user_id):
my_article_year_list
[
year
]
=
[
art
]
my_article_year_list
[
year
]
=
[
art
]
context
=
{
context
=
{
'user'
:
usr
,
'user'
:
usr
,
'art_year_list'
:
my_article_year_list
,
'art_year_list'
:
my_article_year_list
,
'publication_year_list'
:
my_publication_year_list
,
'publication_year_list'
:
my_publication_year_list
,
'cve_year_list'
:
my_cve_year_list
,
'cve_year_list'
:
my_cve_year_list
,
}
}
...
@@ -376,11 +376,43 @@ def add_publication(request):
...
@@ -376,11 +376,43 @@ def add_publication(request):
authorArr
=
authors
.
split
(
','
)
authorArr
=
authors
.
split
(
','
)
print
(
authorArr
)
print
(
authorArr
)
for
author
in
authorArr
:
for
author
in
authorArr
:
try
:
users_list
=
User
.
objects
.
all
()
.
values
(
'name'
)
PubToUser
.
objects
.
create
(
pubID
=
pubID
,
username
=
author
)
user_list
=
[]
response
=
JsonResponse
({
"message"
:
1
,
'pubID'
:
pubID
})
for
user
in
users_list
:
except
ProgrammingError
as
e
:
user_list
.
append
(
user
[
'name'
])
return
JsonResponse
({
"message"
:
0
})
author
=
str
(
author
)
.
lower
()
.
strip
()
if
' '
in
author
:
author_version1
=
author
.
replace
(
' '
,
''
)
author_version2
=
author
.
split
(
' '
)[
1
]
+
str
(
author
)
.
lower
()
.
strip
()
.
split
(
' '
)[
0
]
else
:
author_version1
=
author
.
replace
(
' '
,
''
)
author_version2
=
author
print
(
user_list
)
print
(
author_version1
)
print
(
author_version2
)
if
author_version1
in
user_list
:
userID
=
User
.
objects
.
filter
(
name
=
author_version1
)
.
values
(
'userID'
)[
0
][
'userID'
]
try
:
print
(
"测试:LIU Yingying"
)
PubToUser
.
objects
.
create
(
pubID
=
pubID
,
username
=
author
,
userID
=
userID
)
response
=
JsonResponse
({
"message"
:
1
,
'pubID'
:
pubID
})
except
ProgrammingError
as
e
:
return
JsonResponse
({
"message"
:
0
})
else
:
if
author_version2
in
user_list
:
print
(
"测试:Yingying LIU"
)
userID
=
User
.
objects
.
filter
(
name
=
author_version2
)
.
values
(
'userID'
)[
0
][
'userID'
]
try
:
PubToUser
.
objects
.
create
(
pubID
=
pubID
,
username
=
author
,
userID
=
userID
)
response
=
JsonResponse
({
"message"
:
1
,
'pubID'
:
pubID
})
except
ProgrammingError
as
e
:
return
JsonResponse
({
"message"
:
0
})
else
:
try
:
PubToUser
.
objects
.
create
(
pubID
=
pubID
,
username
=
author
)
response
=
JsonResponse
({
"message"
:
1
,
'pubID'
:
pubID
})
except
ProgrammingError
as
e
:
return
JsonResponse
({
"message"
:
0
})
# message["warning"] = "上传成功"
# message["warning"] = "上传成功"
# return HttpResponse(json.dumps(message), content_type='application/json')
# return HttpResponse(json.dumps(message), content_type='application/json')
return
response
return
response
...
...
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