mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-29 20:16:08 +08:00
/ticket/create, 创建工单的前端页面雏形
This commit is contained in:
@@ -16,7 +16,8 @@
|
|||||||
"ticket": "工单",
|
"ticket": "工单",
|
||||||
"type": "类型",
|
"type": "类型",
|
||||||
"title": "标题",
|
"title": "标题",
|
||||||
"status": "状态"
|
"status": "状态",
|
||||||
|
"create": "创建"
|
||||||
},
|
},
|
||||||
"view": {
|
"view": {
|
||||||
"signup": {
|
"signup": {
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ module.exports =
|
|||||||
get:
|
get:
|
||||||
list: (req, res) ->
|
list: (req, res) ->
|
||||||
Account.authenticate req.token, (account) ->
|
Account.authenticate req.token, (account) ->
|
||||||
|
unless account
|
||||||
|
return res.redirect '/account/login/'
|
||||||
|
|
||||||
Ticket.find
|
Ticket.find
|
||||||
account_id: account.id()
|
account_id: account.id()
|
||||||
, (tickets) ->
|
, (tickets) ->
|
||||||
@@ -17,6 +20,15 @@ module.exports =
|
|||||||
account: account
|
account: account
|
||||||
tickets: tickets
|
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:
|
post:
|
||||||
create: (req, res) ->
|
create: (req, res) ->
|
||||||
Account.authenticate req.token, (account) ->
|
Account.authenticate req.token, (account) ->
|
||||||
|
|||||||
3
core/static/style/ticket/create.less
Normal file
3
core/static/style/ticket/create.less
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.form-group.contentarea {
|
||||||
|
padding: 6px 12px;
|
||||||
|
}
|
||||||
22
core/view/ticket/create.jade
Normal file
22
core/view/ticket/create.jade
Normal 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')
|
||||||
Reference in New Issue
Block a user