forked from hpyhacking/peatio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bank deposit user view and admin list
- Loading branch information
hpyhacking
committed
Mar 31, 2014
1 parent
2e6b99f
commit d0921e5
Showing
24 changed files
with
170 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module Admin | ||
class DepositsController < BaseController | ||
def index | ||
@admin_deposits_grid = Admin::DepositsGrid.new \ | ||
params[:admin_deposits_grid] | ||
@assets = @admin_deposits_grid.assets.page(params[:page]).per(10) | ||
end | ||
|
||
def show | ||
@deposit = Deposit.find(params[:id]) | ||
end | ||
|
||
def update | ||
@deposit = Deposit.find(params[:id]) | ||
|
||
ActiveRecord::Base.transaction do | ||
if @deposit.update_attributes(destroy_params) \ | ||
&& @deposit.accept! | ||
redirect_to admin_deposits_path, notice: t('.notice') | ||
else | ||
redirect_to admin_deposit_path(@deposit), alert: t('.alert') | ||
end | ||
end | ||
end | ||
|
||
def destroy | ||
@deposit = Deposit.find(params[:id]) | ||
|
||
ActiveRecord::Base.transaction do | ||
if @deposit.update_attributes(destroy_params) \ | ||
&& @deposit.reject! | ||
redirect_to admin_deposits_path, notice: t('.notice') | ||
else | ||
redirect_to admin_deposit_path(@deposit), alert: t('.alert') | ||
end | ||
end | ||
end | ||
|
||
def destroy_params | ||
params.require(:deposit).permit(:memo) | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Admin | ||
class DepositsGrid | ||
include Datagrid | ||
include Datagrid::Naming | ||
include Datagrid::ColumnI18n | ||
|
||
scope do |m| | ||
Deposit.order('id DESC') | ||
end | ||
|
||
column :sn | ||
column_i18n :created_at | ||
column :full_name | ||
column :channel_key_text | ||
column :fund_extra_text do |o| | ||
o.try(:fund_extra_text) || o.try(:fund_extra) | ||
end | ||
column :fund_uid | ||
column :currency_text | ||
column :aasm_state_text | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.row: .col-md-12 | ||
= datagrid_table(@admin_deposits_grid, @assets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
= simple_form_for @deposit, defaults: {readonly: true}, url: deposit_path(@deposit) do |f| | ||
= f.input :fund_extra_text, as: :string | ||
= f.input :fund_uid | ||
= f.input :receive_fund_holder_text | ||
= f.input :receive_fund_uid_text | ||
= f.input :receive_fund_extra_text | ||
= f.input :amount | ||
= f.input :member_sn | ||
hr.split | ||
= f.button :wrapped do | ||
= link_to t('actions.cancel'), @deposit, method: :delete, class: 'btn btn-info btn-lg pull-right' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ zh-CN: | |
operating: 运营管理 | ||
items: | ||
operating: | ||
deposits: 充值管理 | ||
documents: 文档管理 | ||
withdraws: 提现管理 | ||
deposits: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters