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
c006d47f
Commit
c006d47f
authored
Apr 22, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页成员样式
parent
45990dd4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
27 deletions
+78
-27
models.py
Hunter_ht/hunter/models.py
+7
-1
index.html
Hunter_ht/hunter/templates/hunter/index.html
+44
-22
views.py
Hunter_ht/hunter/views.py
+27
-4
No files found.
Hunter_ht/hunter/models.py
View file @
c006d47f
...
@@ -3,16 +3,22 @@ from django.utils import timezone
...
@@ -3,16 +3,22 @@ from django.utils import timezone
# Create your models here.
# Create your models here.
# isCurrent=1 是当前成员, 0 旧成员;
# member_type = 0 academic 老师, 1 engineer, 2 研究生 Master, 3 博士生PHD;
class
User
(
models
.
Model
):
class
User
(
models
.
Model
):
userID
=
models
.
BigIntegerField
(
primary_key
=
True
)
userID
=
models
.
BigIntegerField
(
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
50
)
name
=
models
.
CharField
(
max_length
=
50
)
pwd
=
models
.
CharField
(
max_length
=
100
)
pwd
=
models
.
CharField
(
max_length
=
100
)
nake_name
=
models
.
CharField
(
max_length
=
100
)
name_hanzi
=
models
.
CharField
(
max_length
=
100
)
member_type
=
models
.
IntegerField
(
default
=
2
)
isCurrent
=
models
.
IntegerField
(
default
=
1
)
identity
=
models
.
CharField
(
max_length
=
1
,
default
=
'0'
)
identity
=
models
.
CharField
(
max_length
=
1
,
default
=
'0'
)
introduction
=
models
.
TextField
(
default
=
"No Information"
)
introduction
=
models
.
TextField
(
default
=
"No Information"
)
score
=
models
.
IntegerField
(
default
=
0
)
score
=
models
.
IntegerField
(
default
=
0
)
scoreUsed
=
models
.
IntegerField
(
default
=
0
)
scoreUsed
=
models
.
IntegerField
(
default
=
0
)
mailAddress
=
models
.
CharField
(
max_length
=
100
,
default
=
'mail@example.com'
)
def
is_admin
(
self
):
def
is_admin
(
self
):
return
self
.
identity
return
self
.
identity
...
...
Hunter_ht/hunter/templates/hunter/index.html
View file @
c006d47f
...
@@ -30,22 +30,30 @@
...
@@ -30,22 +30,30 @@
<section
id=
"home"
>
<section
id=
"home"
>
<div
class=
"box"
></div>
<div
class=
"box"
></div>
<div
class=
"
staff_tag
"
>
<div
class=
"
left-bar
"
>
<span>
Academic STAFF
</span>
<span>
<span>
Engineer STAFF
</span>
小组成员
<
span>
Student
<
/span>
</span>
</div>
</div>
<div
class=
"content"
>
<div
class=
"wrap"
>
{% if user_list %}
{% for tp,users in user_type_list.items %}
<ul>
<div
class=
"member_type"
>
{% for user in user_list %}
<p>
{{ tp }}
</p>
<li><a
href=
"{% url 'hunter:user' user.userID %}"
>
{{ user.name }}
</a></li>
{% if users %}
{% endfor %}
{% for user in users %}
</ul>
<ul>
<li>
{% endif %}
<a
href=
"{% url 'hunter:user' user.userID %}"
target=
"_blank"
>
{{ user.name_hanzi }}
</a>
</li>
<li
class=
"user_mail"
>
{{ user.mailAddress }}
</li>
</ul>
{% endfor %}
{% endif %}
</div>
{% endfor %}
</div>
</div>
</section>
</section>
<section
id=
"project"
>
<section
id=
"project"
>
...
@@ -59,9 +67,7 @@
...
@@ -59,9 +67,7 @@
<div>
<div>
<div>
<div>
<div
class=
"proj_name"
>
<div
class=
"proj_name"
>
<a
href=
"https://github.com/hunter-ht-2018/ptfuzzer"
target=
"_blank"
>
PTFUZZER
</a>
<a
href=
"https://github.com/hunter-ht-2018/ptfuzzer"
target=
"_blank"
>
PTFUZZER
</a>
</div>
</div>
<div
class=
"proj_description"
>
<div
class=
"proj_description"
>
Fuzzing using the Intel PT support.
Fuzzing using the Intel PT support.
...
@@ -160,14 +166,30 @@
...
@@ -160,14 +166,30 @@
<section
id=
"article"
>
<section
id=
"article"
>
<div
class=
"box"
></div>
<div
class=
"box"
></div>
{% if article_list %}
<div
class=
"left-bar"
>
<ul>
<span>
{% for article in article_list %}
文章随笔
<li><a
href=
"{% url 'hunter:article' article.articleID %}"
>
{{ article.title }}
</a></li>
</span>
<li>
{{ article.author }}
</li>
</div>
<div
class=
"wrap"
>
{% for year, arts in article_year_list.items %}
<blockquote
><p>
{{ year }}
</p></blockquote>
{% if arts %}
{% for art in arts %}
<ul>
<li
class=
"big_text"
>
<a
href=
"{% url 'hunter:article' art.articleID %}"
target=
"_blank"
>
{{ art.title }}
</a>
</li>
<li>
{{ art.author }}
</li>
<li
class=
"small_text"
>
{{ art.author }}
</li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
</ul>
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
</ul
>
</div
>
{% endif %}
</section>
</section>
...
...
Hunter_ht/hunter/views.py
View file @
c006d47f
...
@@ -8,9 +8,23 @@ from django.db.models import Count
...
@@ -8,9 +8,23 @@ from django.db.models import Count
def
index
(
request
):
def
index
(
request
):
user_list
=
User
.
objects
.
values
(
'userID'
,
'name'
)
user_list
=
User
.
objects
.
filter
(
isCurrent
=
1
)
.
all
()
publication_list
=
Publications
.
objects
.
order_by
(
'-date'
)
user_type_list
=
{}
for
u
in
user_list
:
if
u
.
member_type
==
0
:
u
.
member_type
=
"Academic STAFF"
else
:
if
u
.
member_type
==
1
:
u
.
member_type
=
"Engineer STAFF"
else
:
u
.
member_type
=
"Phd & Master"
member_type
=
u
.
member_type
if
member_type
in
user_type_list
.
keys
():
user_type_list
[
member_type
]
.
append
(
u
)
else
:
user_type_list
[
member_type
]
=
[
u
]
publication_list
=
Publications
.
objects
.
order_by
(
'-date'
)
publication_year_list
=
{}
publication_year_list
=
{}
for
pub
in
publication_list
:
for
pub
in
publication_list
:
year
=
str
(
pub
.
date
)[
0
:
4
]
year
=
str
(
pub
.
date
)[
0
:
4
]
...
@@ -32,12 +46,21 @@ def index(request):
...
@@ -32,12 +46,21 @@ def index(request):
cve_year_list
[
year
]
.
append
(
cve
)
cve_year_list
[
year
]
.
append
(
cve
)
else
:
else
:
cve_year_list
[
year
]
=
[
cve
]
cve_year_list
[
year
]
=
[
cve
]
article_list
=
Articles
.
objects
.
order_by
(
'-editDateTime'
)
article_list
=
Articles
.
objects
.
order_by
(
'-editDateTime'
)
article_year_list
=
{}
for
art
in
article_list
:
year
=
str
(
art
.
editDateTime
)[
0
:
4
]
art
.
editDateTime
=
str
(
art
.
editDateTime
)[
5
:
10
]
if
year
in
article_year_list
.
keys
():
article_year_list
[
year
]
=
[
art
]
else
:
article_year_list
[
year
]
=
[
art
]
context
=
{
context
=
{
'user_
list'
:
user
_list
,
'user_
type_list'
:
user_type
_list
,
'publication_year_list'
:
publication_year_list
,
'publication_year_list'
:
publication_year_list
,
'cve_year_list'
:
cve_year_list
,
'cve_year_list'
:
cve_year_list
,
'article_
list'
:
article
_list
,
'article_
year_list'
:
article_year
_list
,
}
}
return
render
(
request
,
'hunter/index.html'
,
context
)
return
render
(
request
,
'hunter/index.html'
,
context
)
...
...
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