工单页面

This commit is contained in:
jysperm
2014-04-16 01:11:33 +08:00
parent 04f462f43e
commit 065c39cab4
6 changed files with 56 additions and 4 deletions

View File

@@ -8,8 +8,15 @@ exports.bind = (app) ->
else
return "/#{item}/#{name}/"
buildGetController = (controller) ->
return (req, res) ->
if req.method == 'GET'
req.body = req.query
return controller req, res
for name, controller of apiModule.get
app.get generateUrl(name), controller
app.get generateUrl(name), buildGetController controller
for name, controller of apiModule.post
app.post generateUrl(name), controller

View File

@@ -30,6 +30,16 @@ module.exports =
account: account
ticketTypes: config.ticket.availableType
view: (req, res) ->
mAccount.authenticate req.token, (account) ->
unless account
return res.redirect '/account/login/'
mTicket.findId req.body.id, (ticket) ->
res.render 'ticket/view',
account: account
ticket: ticket
post:
create: (req, res) ->
mAccount.authenticate req.token, (account) ->

View File

@@ -17,7 +17,9 @@
"type": "类型",
"title": "标题",
"status": "状态",
"create": "创建"
"create": "创建",
"reply": "回复",
"create_reply": "创建回复"
},
"view": {
"signup": {

View File

@@ -2,7 +2,7 @@ extends ../layout
prepend head
title #{t('view.ticket.word.create')} | #{t('app.name')}
link(rel='stylesheet', href='/style/ticket/create.css')
link(rel='stylesheet', href='/style/ticket.css')
block main
header= t('view.ticket.word.create')
@@ -23,4 +23,4 @@ block main
append footer
script(src='/script/ticket/create.js')
script(src='/script/ticket/create.js')

View File

@@ -0,0 +1,33 @@
extends ../layout
prepend head
title #{ticket.title} | #{t('app.name')}
link(rel='stylesheet', href='/style/ticket.css')
block main
.row
header= ticket.title
p!= ticket.content_html
.row
header= t('word.reply')
ul.list-group
for reply in ticket.replys
li.list-group-item
a(href='/member/')
img(src='http://ruby-china.org/avatar/efcc15b92617a95a09f514a9bff9e6c3?s=58')
.list-content
p!= reply.content_html
.row
header= t('word.create_reply')
form.form-horizontal(method='post', role='form')
.form-group.contentarea
textarea#contetn.form-control(name='content', rows='5', required)
.form-group
.col-sm-offset-1
button.btn.btn-lg.btn-primary(type='submit')= t('word.create_reply')
prepend sidebar
.row
a.btn.btn-lg.btn-success(href='/ticket/list/')= t('view.ticket.list.title')