mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-01 10:43:02 +08:00
reply ticket
This commit is contained in:
20
core/static/script/ticket/reply.coffee
Normal file
20
core/static/script/ticket/reply.coffee
Normal file
@@ -0,0 +1,20 @@
|
||||
$ ->
|
||||
$('#reply').on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
data = {
|
||||
id: $('#ticketid').data 'id'
|
||||
content: $('#reply-content').val()
|
||||
}
|
||||
|
||||
$.ajax {
|
||||
method: 'post'
|
||||
url: '/ticket/reply/'
|
||||
data: data
|
||||
}
|
||||
|
||||
.done (r) ->
|
||||
location.reload true
|
||||
.fail (r) ->
|
||||
if reply.status is 400
|
||||
error = reply.responseJSON.error
|
||||
ErrorHandle.flushError error
|
||||
@@ -5,7 +5,7 @@ prepend head
|
||||
link(rel='stylesheet', href='/style/ticket.css')
|
||||
|
||||
block main
|
||||
.row
|
||||
.row#ticketid(data-id= ticket._id)
|
||||
header= ticket.title
|
||||
p!= ticket.content_html
|
||||
|
||||
@@ -23,10 +23,13 @@ block main
|
||||
header= t('word.create_reply')
|
||||
form.form-horizontal(method='post', role='form')
|
||||
.form-group.contentarea
|
||||
textarea#contetn.form-control(name='content', rows='5', required)
|
||||
textarea.form-control#reply-content(name='content', rows='5', required)
|
||||
.form-group
|
||||
button.btn.btn-lg.btn-primary(type='submit')= t('ticket.create_reply')
|
||||
button.btn.btn-lg.btn-primary#reply(type='submit')= t('ticket.create_reply')
|
||||
|
||||
prepend sidebar
|
||||
.row
|
||||
a.btn.btn-lg.btn-success(href='/ticket/list/')= t('ticket.ticket_list')
|
||||
|
||||
append footer
|
||||
script(src='/script/ticket/reply.js')
|
||||
Reference in New Issue
Block a user