mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-28 07:28:57 +08:00
工单页面
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
"type": "类型",
|
||||
"title": "标题",
|
||||
"status": "状态",
|
||||
"create": "创建"
|
||||
"create": "创建",
|
||||
"reply": "回复",
|
||||
"create_reply": "创建回复"
|
||||
},
|
||||
"view": {
|
||||
"signup": {
|
||||
|
||||
@@ -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')
|
||||
|
||||
33
core/view/ticket/view.jade
Normal file
33
core/view/ticket/view.jade
Normal 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')
|
||||
Reference in New Issue
Block a user