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
de739b0a
Commit
de739b0a
authored
May 07, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pub排序
parent
148d4f6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
index.html
Hunter_ht/hunter/templates/hunter/index.html
+0
-1
user.html
Hunter_ht/hunter/templates/hunter/user.html
+2
-11
views.py
Hunter_ht/hunter/views.py
+8
-2
No files found.
Hunter_ht/hunter/templates/hunter/index.html
View file @
de739b0a
...
...
@@ -229,7 +229,6 @@
{% endfor %}
</ul>
</div>
</section>
<section
id=
"article"
>
...
...
Hunter_ht/hunter/templates/hunter/user.html
View file @
de739b0a
...
...
@@ -68,9 +68,9 @@
</div>
</div>
<div
class=
"wrap smaller_wrap"
>
{% for year,publications in publication_year_list.items %}
<blockquote><p>
{{ year }}
</p></blockquote>
{% if publications %}
{% for publication in publications %}
<ul
id=
"pubid{{ publication.pubID }}"
>
...
...
@@ -93,10 +93,7 @@
<li
class=
"small_text"
>
{{ publication.authors }}
</li>
</ul>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</section>
...
...
@@ -114,10 +111,7 @@
</div>
</div>
<div
class=
"wrap smaller_wrap"
>
{% for year, cves in cve_year_list.items %}
<blockquote><p>
{{ year }}
</p></blockquote>
{% if cves %}
{% for cve in cves %}
{% for cve in cve_list %}
<ul
id=
"cveid{{ cve.identifier }}"
>
<li
class=
"cve_big_text"
><a
href=
"{{ cve.url }}"
target=
"_blank"
>
{{ cve.identifier }}
</a></li>
<li
class=
"li_right"
><button
class=
"dele_img"
onclick=
"deleCVE({{ cve.identifier }})"
></button></li>
...
...
@@ -125,11 +119,8 @@
<li
class=
"li_right"
>
{{ cve.datetime }}
</li>
<li
class=
"li_right"
>
{{ cve.bugType }}
</li>
<li
class=
"li_right"
>
{{ cve.software }}
</li>
<li
class=
"li_long li_small_text"
>
{{ cve.description }}
</li>
</ul>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</section>
...
...
Hunter_ht/hunter/views.py
View file @
de739b0a
...
...
@@ -145,7 +145,7 @@ def user(request, user_id):
username
=
usr
.
name
u
=
{
'userID'
:
user_id
,
'name'
:
username
}
my_publication_year_list
=
{}
pub_ids
=
PubToUser
.
objects
.
filter
(
userID
=
user_id
)
.
all
()
.
values
(
"pubID"
)
.
order_by
(
'-date
'
)
pub_ids
=
PubToUser
.
objects
.
filter
(
userID
=
user_id
)
.
all
()
.
values
(
'pubID
'
)
for
pub_id
in
pub_ids
:
print
(
pub_id
)
pub
=
get_object_or_404
(
Publications
,
pk
=
pub_id
[
'pubID'
])
...
...
@@ -158,7 +158,12 @@ def user(request, user_id):
my_publication_year_list
[
year
]
=
[
pub
]
for
item
in
my_publication_year_list
:
my_publication_year_list
[
item
]
=
sorted
(
my_publication_year_list
[
item
],
key
=
attrgetter
(
'date'
),
reverse
=
True
)
publication_year_list
=
{}
for
k
in
sorted
(
my_publication_year_list
,
reverse
=
True
):
publication_year_list
[
k
]
=
my_publication_year_list
[
k
]
print
(
publication_year_list
)
print
(
my_publication_year_list
)
my_article_list
=
Articles
.
objects
.
filter
(
authorID
=
user_id
)
.
order_by
(
'-editDateTime'
)
my_article_year_list
=
{}
for
art
in
my_article_list
:
...
...
@@ -182,8 +187,9 @@ def user(request, user_id):
my_cve_year_list
[
year
]
=
[
cve
]
context
=
{
'user'
:
usr
,
'publication_year_list'
:
my_
publication_year_list
,
'publication_year_list'
:
publication_year_list
,
'cve_year_list'
:
my_cve_year_list
,
'cve_list'
:
my_bug_list
,
'article_year_list'
:
my_article_year_list
,
}
return
render
(
request
,
'hunter/user.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