/ticket/create, 创建工单的前端页面雏形

This commit is contained in:
jysperm
2014-04-04 00:27:02 +08:00
parent f4465a23a9
commit b322ccb0ab
4 changed files with 39 additions and 1 deletions

View File

@@ -16,7 +16,8 @@
"ticket": "工单",
"type": "类型",
"title": "标题",
"status": "状态"
"status": "状态",
"create": "创建"
},
"view": {
"signup": {

View File

@@ -10,6 +10,9 @@ module.exports =
get:
list: (req, res) ->
Account.authenticate req.token, (account) ->
unless account
return res.redirect '/account/login/'
Ticket.find
account_id: account.id()
, (tickets) ->
@@ -17,6 +20,15 @@ module.exports =
account: account
tickets: tickets
create: (req, res) ->
Account.authenticate req.token, (account) ->
unless account
return res.redirect '/account/login/'
res.render 'ticket/create',
account: account
ticketTypes: config.ticket.availableType
post:
create: (req, res) ->
Account.authenticate req.token, (account) ->

View File

@@ -0,0 +1,3 @@
.form-group.contentarea {
padding: 6px 12px;
}

View File

@@ -0,0 +1,22 @@
extends ../layout
prepend head
title #{t('view.ticket.word.create')} | #{t('app.name')}
link(rel='stylesheet', href='/style/ticket/create.css')
block main
header= t('view.ticket.word.create')
form.form-horizontal(method='post', role='form')
.form-group
.col-sm-3
select#type.form-control(name='type')
for type in ticketTypes
option(value=type)= type
.col-sm-9
input#title.form-control(type='text', name='title', required)
.form-group.contentarea
textarea#contetn.form-control(name='content', rows='15', required)
.form-group
.col-sm-offset-3
button.btn.btn-lg.btn-primary(type='submit')= t('word.create')