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
6215e057
Commit
6215e057
authored
Apr 26, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除文章
parent
935dea64
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
index.html
Hunter_ht/hunter/templates/hunter/index.html
+1
-0
user.html
Hunter_ht/hunter/templates/hunter/user.html
+24
-3
views.py
Hunter_ht/hunter/views.py
+2
-2
No files found.
Hunter_ht/hunter/templates/hunter/index.html
View file @
6215e057
...
@@ -205,6 +205,7 @@
...
@@ -205,6 +205,7 @@
<li>
{{ art.author }}
</li>
<li>
{{ art.author }}
</li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
<li
class=
"small_text right"
>
{{ art.authorID }}
</li>
<li
class=
"small_text right"
>
{{ art.authorID }}
</li>
<li
class=
"small_text right"
><a
target=
"_blank"
download=
"{{ art.attachment }}"
href=
"{% static 'hunter/articles/' %}{{ art.attachment }}"
>
{{ art.attachment }}
</a></li>
</ul>
</ul>
{% endfor %}
{% endfor %}
...
...
Hunter_ht/hunter/templates/hunter/user.html
View file @
6215e057
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
<blockquote
><p>
{{ year }}
</p></blockquote>
<blockquote
><p>
{{ year }}
</p></blockquote>
{% if arts %}
{% if arts %}
{% for art in arts %}
{% for art in arts %}
<ul>
<ul
id=
"articleid{{ art.articleID }}"
>
<li
class=
"big_text"
>
<li
class=
"big_text"
>
<a
href=
"{% url 'hunter:article' art.articleID %}"
target=
"_blank"
>
{{ art.title }}
</a>
<a
href=
"{% url 'hunter:article' art.articleID %}"
target=
"_blank"
>
{{ art.title }}
</a>
</li>
</li>
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
{#
<li
class=
"right"
><button
onclick=
"editArt({{ art.articleID }})"
><svg
t=
"1587711451871"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"2741"
width=
"20"
height=
"20"
><path
d=
"M863.079412 351.09129a29.2569 29.2569 0 0 1 58.5138 0v555.881108a117.027602 117.027602 0 0 1-117.027601 117.027602H219.427602a117.027602 117.027602 0 0 1-117.027602-117.027602V146.292987a117.027602 117.027602 0 0 1 117.027602-117.027602h380.339706a29.2569 29.2569 0 0 1 0 58.513801H219.427602a58.513801 58.513801 0 0 0-58.513801 58.513801v760.679411a58.513801 58.513801 0 0 0 58.513801 58.513801h585.138009a58.513801 58.513801 0 0 0 58.513801-58.513801V351.09129zM855.414104 10.306913a29.2569 29.2569 0 1 1 44.587516 37.916943l-248.683654 292.569005a29.2569 29.2569 0 1 1-44.587516-37.916943l248.683654-292.569005zM307.198303 526.632692h263.312104a29.2569 29.2569 0 0 1 0 58.513801H307.198303a29.2569 29.2569 0 0 1 0-58.513801z m0 175.541403h409.596606a29.2569 29.2569 0 0 1 0 58.513801H307.198303a29.2569 29.2569 0 0 1 0-58.513801z"
p-id=
"2742"
fill=
"#6e829e"
></path></svg>
#}
{#
<li
class=
"right"
><button
onclick=
"editArt({{ art.articleID }})"
><svg
t=
"1587711451871"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"2741"
width=
"20"
height=
"20"
><path
d=
"M863.079412 351.09129a29.2569 29.2569 0 0 1 58.5138 0v555.881108a117.027602 117.027602 0 0 1-117.027601 117.027602H219.427602a117.027602 117.027602 0 0 1-117.027602-117.027602V146.292987a117.027602 117.027602 0 0 1 117.027602-117.027602h380.339706a29.2569 29.2569 0 0 1 0 58.513801H219.427602a58.513801 58.513801 0 0 0-58.513801 58.513801v760.679411a58.513801 58.513801 0 0 0 58.513801 58.513801h585.138009a58.513801 58.513801 0 0 0 58.513801-58.513801V351.09129zM855.414104 10.306913a29.2569 29.2569 0 1 1 44.587516 37.916943l-248.683654 292.569005a29.2569 29.2569 0 1 1-44.587516-37.916943l248.683654-292.569005zM307.198303 526.632692h263.312104a29.2569 29.2569 0 0 1 0 58.513801H307.198303a29.2569 29.2569 0 0 1 0-58.513801z m0 175.541403h409.596606a29.2569 29.2569 0 0 1 0 58.513801H307.198303a29.2569 29.2569 0 0 1 0-58.513801z"
p-id=
"2742"
fill=
"#6e829e"
></path></svg>
#}
{#
</button></li>
#}
{#
</button></li>
#}
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
<li
class=
"small_text right"
>
{{ art.authorID }}
</li>
<li
class=
"small_text right"
>
{{ art.authorID }}
</li>
<li
class=
"small_text right"
><a
target=
"_blank"
download=
"{{ art.attachment }}"
href=
"{% static 'hunter/articles/' %}{{ art.attachment }}"
>
{{ art.attachment }}
</a></li>
<li
class=
"small_text right"
><a
target=
"_blank"
download=
"{{ art.attachment }}"
href=
"{% static 'hunter/articles/' %}{{ art.attachment }}"
>
{{ art.attachment }}
</a></li>
</ul>
</ul>
{% endfor %}
{% endfor %}
...
@@ -321,7 +321,28 @@
...
@@ -321,7 +321,28 @@
function
deleArt
(
artid
){
function
deleArt
(
artid
){
let
is_sure
=
confirm
(
"确定要删除吗?"
);
console
.
log
(
is_sure
);
console
.
log
(
artid
);
if
(
is_sure
){
$
.
ajax
({
url
:
'/delete/article/'
,
type
:
'post'
,
data
:{
"article_id"
:
artid
,
},
success
:
function
(
response
)
{
if
(
response
[
'message'
]){
$
(
'#articleid'
+
artid
).
css
(
'display'
,
'none'
);
$
(
'#articleid'
+
artid
).
empty
();
}
},
error
:
function
(
xhr
)
{
console
.
error
(
'something went wrong...'
);
login_fail
(
"something went wrong..."
);
}
})
}
}
}
function
addCVE
(){
function
addCVE
(){
submit_what
=
'cve'
;
submit_what
=
'cve'
;
...
...
Hunter_ht/hunter/views.py
View file @
6215e057
...
@@ -272,9 +272,9 @@ def delete_cve(request):
...
@@ -272,9 +272,9 @@ def delete_cve(request):
@csrf_exempt
@csrf_exempt
def
delete_article
(
request
):
def
delete_article
(
request
):
cve_id
=
request
.
POST
[
'cv
e_id'
]
article_id
=
request
.
POST
[
'articl
e_id'
]
try
:
try
:
Bugs
.
objects
.
filter
(
identifier
=
cv
e_id
)
.
delete
()
Articles
.
objects
.
filter
(
articleID
=
articl
e_id
)
.
delete
()
response
=
JsonResponse
({
"message"
:
1
})
response
=
JsonResponse
({
"message"
:
1
})
return
response
return
response
except
ProgrammingError
as
e
:
except
ProgrammingError
as
e
:
...
...
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