/ticket/list, 工单列表前端页面雏形

This commit is contained in:
jysperm
2014-04-03 22:57:04 +08:00
parent 9ec6b696aa
commit e60000827b
3 changed files with 38 additions and 2 deletions

View File

@@ -13,7 +13,10 @@
"error": "错误",
"logout": "注销",
"panel": "管理面板",
"ticket": "工单"
"ticket": "工单",
"type": "类型",
"title": "标题",
"status": "状态"
},
"view": {
"signup": {
@@ -22,6 +25,11 @@
},
"login": {
"noAccount": "还没有账户?"
},
"ticket": {
"list": {
"title": "工单列表"
}
}
}
}

View File

@@ -7,7 +7,15 @@ Account = require '../model/Account'
Ticket = require '../model/Ticket'
module.exports =
get: {}
get:
list: (req, res) ->
Account.authenticate req.token, (account) ->
Ticket.find
account_id: account.id()
, (tickets) ->
res.render 'ticket/list',
account: account
tickets: tickets
post:
create: (req, res) ->

View File

@@ -0,0 +1,20 @@
extends ../layout
prepend head
title #{t('view.ticket.list.title')} | #{t('app.name')}
block main
header= t('view.ticket.list.title')
table.table.table-hover
thead
tr
td= t('word.type')
td= t('word.title')
td= t('word.status')
tbody
for ticket in tickets
tr
td= ticket.data.type
td= ticket.data.title
td= ticket.data.status