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
fcf50492
Commit
fcf50492
authored
Apr 27, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
News板块完成
parent
0e2e28c8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
187 additions
and
5 deletions
+187
-5
style.css
Hunter_ht/hunter/static/hunter/style.css
+69
-1
index.html
Hunter_ht/hunter/templates/hunter/index.html
+68
-2
user.html
Hunter_ht/hunter/templates/hunter/user.html
+3
-1
views.py
Hunter_ht/hunter/views.py
+47
-1
No files found.
Hunter_ht/hunter/static/hunter/style.css
View file @
fcf50492
...
...
@@ -200,7 +200,33 @@ nav>div{
font-size
:
18px
;
color
:
black
;
}
.former
{
width
:
200px
;
}
.former
>
#show_btn
,
#close_btn
{
width
:
80px
;
height
:
30px
;
border-radius
:
0
;
margin
:
5px
;
float
:
left
;
font-size
:
14px
;
cursor
:
pointer
;
}
.former
>
#show_btn
{
border
:
none
;
background-color
:
rgb
(
97
,
152
,
232
);
color
:
white
;
}
.former
>
#close_btn
{
border
:
solid
1px
#f1f1f1
;
background-color
:
white
;
color
:
dimgrey
;
}
#former_member
{
margin-top
:
30px
;
padding-top
:
20px
;
border-top
:
solid
1px
#f1f1f1
;
}
.left-bar
{
width
:
100%
;
...
...
@@ -213,6 +239,7 @@ nav>div{
line-height
:
40px
;
font-size
:
22px
;
color
:
black
;
float
:
left
;
font-weight
:
400
;
font-family
:
"Roboto Condensed"
,
Helvetica
,
Arial
,
sans-serif
;
;
}
...
...
@@ -222,6 +249,47 @@ nav>div{
width
:
100%
;
padding-left
:
20px
;
}
.new_wrap
{
width
:
100%
;
padding-left
:
20px
;
}
.list_wrap
{
padding
:
20px
70px
;
}
.list_wrap
>
p
{
font-size
:
14px
;
height
:
25px
;
background
:
#6e829e
;
width
:
100px
;
color
:
white
;
padding
:
2px
10px
0
;
margin
:
0
0
10px
;
}
.new_list
{
width
:
100%
;
height
:
30px
;
padding
:
0
20px
;
}
.new_list
span
{
display
:
block
;
float
:
left
;
color
:
dimgray
;
font-size
:
14px
;
}
.new_list
span
:first-child
{
width
:
100px
;
}
.new_list
a
{
color
:
rgb
(
52
,
133
,
251
);
}
.new_list
a
:hover
{
text-decoration
:
underline
;
}
.new_list
>
span
:last-child
{
/*float: right !important;*/
}
.wrap
ul
:hover
{
background
:
#ddd
;
border-radius
:
5px
;
...
...
Hunter_ht/hunter/templates/hunter/index.html
View file @
fcf50492
...
...
@@ -40,6 +40,7 @@
<a
href=
"#cve"
class=
"main_bar"
>
漏洞成果
</a>
<a
href=
"#project"
class=
"main_bar"
>
项目研究
</a>
<a
href=
"#publish"
class=
"main_bar"
>
出版物
</a>
<a
href=
"#member"
class=
"main_bar"
>
成员
</a>
<a
href=
"#"
class=
"main_bar active"
>
首页
</a>
</div>
</div>
...
...
@@ -49,8 +50,46 @@
<div
class=
"box"
></div>
<div
class=
"left-bar"
>
<span>
最新动态
</span>
</div>
<div
class=
"new_wrap"
>
<div
class=
"list_wrap"
>
{% for key, item in newest_post_list.items %}
{% if item %}
<p>
{{ key }}
</p>
{% for it in item %}
<div
class=
"new_list"
>
<span>
{{ it.date }}
</span>
{% if key == 'publication' %}
<span>
{{ it.author }}在{{ it.journame }}上发表了{{ it.publishType }}
</span>
{% else %}
<span>
{{ it.author }}发布了
</span>
{% endif %}
{% if key == 'cve' %}
<span><a
href=
"{{ it.url }}"
>
{{ it.title }}
</a></span>
{% else %}
<span><a
href=
"{{ it.url }}"
>
《{{ it.title }}》
</a></span>
{% endif %}
</div>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
</section>
<section
id=
"member"
>
<div
class=
"box"
></div>
<div
class=
"left-bar"
>
<span>
小组成员
</span>
<span
class=
"former"
>
<button
id=
"show_btn"
onclick=
"show_former()"
>
显示前成员
</button>
<button
style=
"display: none"
id=
"close_btn"
onclick=
"close_former()"
>
隐藏
</button>
</span>
</div>
<div
class=
"wrap"
>
{% for tp,users in user_type_list.items %}
...
...
@@ -69,7 +108,23 @@
</div>
{% endfor %}
</div>
<div
class=
"wrap"
id=
"former_member"
style=
"display: none;"
>
{% for tp,users in user_type_list_former.items %}
<div
class=
"member_type"
>
<p>
{{ tp }}
</p>
{% if users %}
{% for user in users %}
<ul>
<li>
<a
href=
"{% url 'hunter:detail' user.userID %}"
target=
"_blank"
>
{{ user.name_hanzi }}
</a>
</li>
<li
class=
"user_mail"
>
{{ user.mailAddress }}
</li>
</ul>
{% endfor %}
{% endif %}
</div>
{% endfor %}
</div>
</section>
...
...
@@ -237,7 +292,7 @@
</footer>
<script>
var
pre_clicked
=
4
;
var
pre_clicked
=
5
;
window
.
onload
=
function
(){
$
(
".bottom>a"
).
click
(
function
(){
let
i
=
$
(
".bottom>a"
).
index
(
this
);
...
...
@@ -251,6 +306,17 @@
}
};
function
show_former
(){
$
(
'#show_btn'
).
css
(
'display'
,
'none'
);
$
(
'#close_btn'
).
css
(
'display'
,
'block'
);
$
(
'#former_member'
).
css
(
'display'
,
'block'
);
}
function
close_former
(){
$
(
'#show_btn'
).
css
(
'display'
,
'block'
);
$
(
'#close_btn'
).
css
(
'display'
,
'none'
);
$
(
'#former_member'
).
css
(
'display'
,
'none'
);
}
function
logout
(){
let
storage
=
window
.
localStorage
;
...
...
Hunter_ht/hunter/templates/hunter/user.html
View file @
fcf50492
...
...
@@ -231,7 +231,8 @@
let
date
=
$
(
'#date_input'
).
val
();
let
type
=
$
(
'select[name="type"] option:selected'
).
val
();
let
myfile
=
$
(
"input[name='myfile']"
)[
0
].
files
[
0
];
let
storage
=
window
.
localStorage
;
let
username
=
storage
.
username
;
let
formatData
=
new
FormData
();
formatData
.
append
(
"myfile"
,
myfile
);
formatData
.
append
(
"title"
,
title
);
...
...
@@ -239,6 +240,7 @@
formatData
.
append
(
"journalname"
,
journalname
);
formatData
.
append
(
"date"
,
date
);
formatData
.
append
(
"type"
,
type
);
formatData
.
append
(
"username"
,
username
);
$
.
ajax
({
url
:
"{% url 'hunter:add_publication' %} "
,
...
...
Hunter_ht/hunter/views.py
View file @
fcf50492
...
...
@@ -36,6 +36,25 @@ def index(request):
else
:
user_type_list
[
member_type
]
=
[
u
]
user_list_former
=
User
.
objects
.
filter
(
isCurrent
=
0
,
identity
=
'0'
)
.
all
()
user_type_list_former
=
{
"Academic STAFF"
:
[],
"Phd"
:
[],
"Master"
:
[],
"Engineer STAFF"
:
[]}
for
u
in
user_list_former
:
if
u
.
member_type
==
0
:
u
.
member_type
=
"Academic STAFF"
else
:
if
u
.
member_type
==
1
:
u
.
member_type
=
"Engineer STAFF"
else
:
if
u
.
member_type
==
2
:
u
.
member_type
=
"Phd"
else
:
u
.
member_type
=
"Master"
member_type
=
u
.
member_type
if
member_type
in
user_type_list
.
keys
():
user_type_list_former
[
member_type
]
.
append
(
u
)
else
:
user_type_list_former
[
member_type
]
=
[
u
]
publication_list
=
Publications
.
objects
.
order_by
(
'-date'
)
publication_year_list
=
{}
for
pub
in
publication_list
:
...
...
@@ -70,11 +89,37 @@ def index(request):
article_year_list
[
year
]
.
append
(
art
)
else
:
article_year_list
[
year
]
=
[
art
]
newest_post_list
=
{}
start
=
datetime
.
datetime
.
now
()
.
date
()
-
datetime
.
timedelta
(
hours
=
23
*
7
,
minutes
=
59
,
seconds
=
59
)
newest_publication
=
Publications
.
objects
.
filter
(
date__gte
=
start
)
.
order_by
(
'-date'
)
for
pub
in
newest_publication
:
pub
.
author
=
pub
.
uploadByUser
pub
.
url
=
'/static/hunter/publications/'
+
pub
.
link
pub
.
date
=
str
(
pub
.
date
)[
5
:
10
]
newest_article
=
Articles
.
objects
.
filter
(
editDateTime__gte
=
start
)
.
order_by
(
'-editDateTime'
)
for
art
in
newest_article
:
users
=
User
.
objects
.
filter
(
userID
=
art
.
authorID
)
.
values
(
'name'
)
art
.
author
=
users
[
0
][
'name'
]
art
.
url
=
'/article/'
+
str
(
art
.
articleID
)
art
.
date
=
str
(
art
.
editDateTime
)[
5
:
10
]
newest_cve
=
Bugs
.
objects
.
filter
(
datetime__gte
=
start
)
.
order_by
(
'-datetime'
)
for
cve
in
newest_cve
:
cve
.
title
=
cve
.
identifier
cve
.
author
=
cve
.
owner
cve
.
date
=
str
(
cve
.
datetime
)[
5
:
10
]
newest_post_list
[
'publication'
]
=
newest_publication
newest_post_list
[
'article'
]
=
newest_article
newest_post_list
[
'cve'
]
=
newest_cve
context
=
{
'user_type_list'
:
user_type_list
,
'user_type_list_former'
:
user_type_list_former
,
'publication_year_list'
:
publication_year_list
,
'cve_year_list'
:
cve_year_list
,
'article_year_list'
:
article_year_list
,
'newest_post_list'
:
newest_post_list
,
}
return
render
(
request
,
'hunter/index.html'
,
context
)
...
...
@@ -287,6 +332,7 @@ def add_publication(request):
title
=
request
.
POST
[
'title'
]
print
(
title
)
authors
=
request
.
POST
[
'authors'
]
uploadby
=
request
.
POST
[
'username'
]
myfile
=
request
.
FILES
[
'myfile'
]
print
(
authors
)
s
=
','
...
...
@@ -312,7 +358,7 @@ def add_publication(request):
dest
.
close
()
link
=
myfile
.
name
try
:
Publications
.
objects
.
create
(
pubID
=
pubID
,
title
=
title
,
link
=
link
,
messages
=
'kidding'
,
authors
=
authors
,
journalname
=
journalname
,
date
=
date
,)
Publications
.
objects
.
create
(
pubID
=
pubID
,
title
=
title
,
link
=
link
,
messages
=
'kidding'
,
authors
=
authors
,
journalname
=
journalname
,
uploadByUser
=
uploadby
,
date
=
date
,)
except
ProgrammingError
as
e
:
return
JsonResponse
({
"message"
:
0
})
authorArr
=
authors
.
split
(
','
)
...
...
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