reply ticket

This commit is contained in:
Yudong
2014-04-26 18:37:21 +08:00
parent 8f4de96650
commit a53cc4aa58
2 changed files with 26 additions and 3 deletions

View 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

View File

@@ -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')