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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
index.html
Hunter_ht/hunter/templates/hunter/index.html
+1
-0
user.html
Hunter_ht/hunter/templates/hunter/user.html
+23
-2
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 @@
<li>
{{ art.author }}
</li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</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>
{% endfor %}
...
...
Hunter_ht/hunter/templates/hunter/user.html
View file @
6215e057
...
...
@@ -130,7 +130,7 @@
<blockquote
><p>
{{ year }}
</p></blockquote>
{% if arts %}
{% for art in arts %}
<ul>
<ul
id=
"articleid{{ art.articleID }}"
>
<li
class=
"big_text"
>
<a
href=
"{% url 'hunter:article' art.articleID %}"
target=
"_blank"
>
{{ art.title }}
</a>
</li>
...
...
@@ -321,7 +321,28 @@
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
(){
submit_what
=
'cve'
;
...
...
Hunter_ht/hunter/views.py
View file @
6215e057
...
...
@@ -272,9 +272,9 @@ def delete_cve(request):
@csrf_exempt
def
delete_article
(
request
):
cve_id
=
request
.
POST
[
'cv
e_id'
]
article_id
=
request
.
POST
[
'articl
e_id'
]
try
:
Bugs
.
objects
.
filter
(
identifier
=
cv
e_id
)
.
delete
()
Articles
.
objects
.
filter
(
articleID
=
articl
e_id
)
.
delete
()
response
=
JsonResponse
({
"message"
:
1
})
return
response
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