Add model and views for bank accounts
This commit is contained in:
parent
4b1e9a6f53
commit
f0a55fb951
24 changed files with 351 additions and 1 deletions
12
app/views/admin/bank_accounts/_form.html.haml
Normal file
12
app/views/admin/bank_accounts/_form.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
= simple_form_for [:admin, @bank_account], :validate => true, :remote => true do |f|
|
||||
.modal-header
|
||||
= close_button :modal
|
||||
%h3= @bank_account.new_record? ? t('.title_new') : t('.title_edit')
|
||||
.modal-body
|
||||
= f.input :name
|
||||
= f.input :iban
|
||||
= f.input :description, as: :text
|
||||
= f.input :balance
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit class: 'btn btn-primary'
|
||||
2
app/views/admin/bank_accounts/new.js.haml
Normal file
2
app/views/admin/bank_accounts/new.js.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$('#modalContainer').html('#{j(render("form"))}');
|
||||
$('#modalContainer').modal();
|
||||
17
app/views/admin/finances/_bank_accounts.html.haml
Normal file
17
app/views/admin/finances/_bank_accounts.html.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= heading_helper BankAccount, :name
|
||||
%th= heading_helper BankAccount, :iban
|
||||
%th= heading_helper BankAccount, :description
|
||||
%th
|
||||
%tbody
|
||||
- @bank_accounts.each do |bank_account|
|
||||
%tr
|
||||
%td= bank_account.name
|
||||
%td= bank_account.iban
|
||||
%td= truncate bank_account.description, length: 50
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_admin_bank_account_path(bank_account), remote: true, class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), [:admin, bank_account], :method => :delete, :data => {:confirm => t('ui.confirm_delete', name: bank_account.name)},
|
||||
remote: true, class: 'btn btn-mini btn-danger'
|
||||
|
|
@ -2,8 +2,13 @@
|
|||
|
||||
- content_for :actionbar do
|
||||
= link_to t('.new_financial_transaction_class'), new_admin_financial_transaction_class_path, remote: true, class: 'btn btn-primary'
|
||||
= link_to t('.new_bank_account'), new_admin_bank_account_path, remote: true, class: 'btn'
|
||||
|
||||
- content_for :sidebar do
|
||||
%p= t('.first_paragraph').html_safe
|
||||
|
||||
%h2= t('.transaction_types')
|
||||
#transaction_types_table= render 'transaction_types'
|
||||
|
||||
%h2= t('.bank_accounts')
|
||||
#bank_accounts_table= render 'bank_accounts'
|
||||
|
|
|
|||
2
app/views/admin/finances/update_bank_accounts.js.haml
Normal file
2
app/views/admin/finances/update_bank_accounts.js.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$('#bank_accounts_table').html('#{escape_javascript(render("admin/finances/bank_accounts"))}');
|
||||
$('#modalContainer').modal('hide');
|
||||
Loading…
Add table
Add a link
Reference in a new issue