UI: 创建充值记录

This commit is contained in:
jysperm
2014-05-28 10:17:23 +08:00
parent 0cf91df071
commit 8467edef3a
4 changed files with 45 additions and 5 deletions

View File

@@ -1,12 +1,16 @@
## Admin API
### POST /admin/update_account/
### POST /admin/create_payment/
Request:
{
"account_id": "525284cc2cebb6d0008b4567",
"amount_inc": -1
"type": "taobao",
"amount": "10",
"order_id": "560097131641814"
}
No Response.
Response:
{}

View File

@@ -1,12 +1,12 @@
express = require 'express'
{requestAdminAuthenticate} = require './middleware'
{requestAdminAuthenticate, renderAccount} = require './middleware'
mAccount = require '../model/account'
module.exports = exports = express.Router()
exports.get '/', requestAdminAuthenticate, (req, res) ->
exports.get '/', requestAdminAuthenticate, renderAccount, (req, res) ->
mAccount.find {}, {}, (accounts) ->
res.render 'admin/index',
accounts: accounts

View File

@@ -5,16 +5,51 @@ prepend head
block main
header= t('admin.admin_panel')
.modal.fade#crate_payment
.modal-dialog
.modal-content
.modal-header
button.close(type='button', data-dismiss='modal', aria-hidden='true') ×
h4.modal-title 创建充值记录
.modal-body
form.form-horizontal(method='post', role='form')
.form-group
label.col-sm-2.col-md-offset-1.control-label(for='amont') 金额
.col-sm-5
input#amont.form-control(type='text', name='amont', required)
.form-group
label.col-sm-2.col-md-offset-1.control-label(for='order_id') 订单号
.col-sm-5
input#order_id.form-control(type='order_id', name='order_id', required)
.modal-footer
button.btn.btn-danger(type='button', data-dismiss='modal') 关闭
button.btn.btn-success(type='button') 创建
table.table.table-hover
thead
tr
th= t('account.username')
th= t('account.email')
th 套餐
th 余额
th 操作
tbody
for account in accounts
tr
td= account.username
td= account.email
td= account.attribute.plans.join(', ')
td= account.attribute.balance.toFixed(2)
td
.btn-group
button(type='button', data-toggle='dropdown').btn.btn-info.btn-sm.dropdown-toggle
| 操作
spann.caret
ul.dropdown-menu
li
a(href='#', data-toggle='modal', data-target='#crate_payment') 创建充值记录
prepend sidebar
.row

View File

@@ -24,6 +24,7 @@ table.table.table-hover
span.glyphicon.glyphicon-edit
button.btn.btn-danger.btn-xs
span.glyphicon.glyphicon-remove-sign
.modal.fade#nginxModal(tabindex='-1', role='dialog', aria-hidden='true', aria-labelledby='nginxModalLabel')
.modal-dialog
.modal-content