Add admin UI for BankGateway

This commit is contained in:
Patrick Gansterer 2021-03-05 12:44:53 +01:00
parent 87fe9ccdb1
commit 79fdb4dafb
11 changed files with 99 additions and 0 deletions

View file

@ -7,6 +7,7 @@
= f.input :iban
= f.input :description, as: :text
= f.input :balance
= f.association :bank_gateway
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit class: 'btn btn-primary'

View file

@ -0,0 +1,12 @@
= simple_form_for [:admin, @bank_gateway], :validate => true, :remote => true do |f|
.modal-header
= close_button :modal
%h3= @bank_gateway.new_record? ? t('.title_new') : t('.title_edit')
.modal-body
= f.input :name
= f.input :url
= f.input :authorization
= f.association :unattended_user
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit class: 'btn btn-primary'

View file

@ -0,0 +1,2 @@
$('#modalContainer').html('#{j(render("form"))}');
$('#modalContainer').modal();

View file

@ -0,0 +1,13 @@
%table.table.table-striped
%thead
%tr
%th= heading_helper BankGateway, :name
%th
%tbody
- @bank_gateways.each do |bank_gateway|
%tr
%td= bank_gateway.name
%td
= link_to t('ui.edit'), edit_admin_bank_gateway_path(bank_gateway), remote: true, class: 'btn btn-mini'
= link_to t('ui.delete'), [:admin, bank_gateway], :method => :delete, :data => {:confirm => t('ui.confirm_delete', name: bank_gateway.name)},
remote: true, class: 'btn btn-mini btn-danger'

View file

@ -3,6 +3,7 @@
- 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'
= link_to t('.new_bank_gateway'), new_admin_bank_gateway_path, remote: true, class: 'btn'
- content_for :sidebar do
%p= t('.first_paragraph').html_safe
@ -12,3 +13,6 @@
%h2= t('.bank_accounts')
#bank_accounts_table= render 'bank_accounts'
%h2= t('.bank_gateways')
#bank_gateways_table= render 'bank_gateways'

View file

@ -0,0 +1,2 @@
$('#bank_gateways_table').html('#{escape_javascript(render("admin/finances/bank_gateways"))}');
$('#modalContainer').modal('hide');