Add admin UI for SupplierCategories
This commit is contained in:
parent
7e8c1d041d
commit
708f85a839
10 changed files with 108 additions and 0 deletions
13
app/views/admin/finances/_supplier_categories.html.haml
Normal file
13
app/views/admin/finances/_supplier_categories.html.haml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= heading_helper SupplierCategory, :name
|
||||
%th
|
||||
%tbody
|
||||
- @supplier_categories.each do |supplier_category|
|
||||
%tr
|
||||
%td= supplier_category.name
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_admin_supplier_category_path(supplier_category), remote: true, class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), [:admin, supplier_category], :method => :delete, :data => {:confirm => t('ui.confirm_delete', name: supplier_category.name)},
|
||||
remote: true, class: 'btn btn-mini btn-danger'
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
= 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'
|
||||
= link_to t('.new_supplier_category'), new_admin_supplier_category_path, remote: true, class: 'btn'
|
||||
|
||||
- content_for :sidebar do
|
||||
%p= t('.first_paragraph').html_safe
|
||||
|
|
@ -16,3 +17,6 @@
|
|||
|
||||
%h2= t('.bank_gateways')
|
||||
#bank_gateways_table= render 'bank_gateways'
|
||||
|
||||
%h2= t('.supplier_categories')
|
||||
#supplier_categories_table= render 'supplier_categories'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
$('#supplier_categories_table').html('#{escape_javascript(render("admin/finances/supplier_categories"))}');
|
||||
$('#modalContainer').modal('hide');
|
||||
12
app/views/admin/supplier_categories/_form.html.haml
Normal file
12
app/views/admin/supplier_categories/_form.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
= simple_form_for [:admin, @supplier_category], :validate => true, :remote => true do |f|
|
||||
.modal-header
|
||||
= close_button :modal
|
||||
%h3= @supplier_category.new_record? ? t('.title_new') : t('.title_edit')
|
||||
.modal-body
|
||||
= f.input :name
|
||||
= f.input :description
|
||||
= f.association :financial_transaction_class, :include_blank => false
|
||||
= f.association :bank_account, :include_blank => false
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit class: 'btn btn-primary'
|
||||
2
app/views/admin/supplier_categories/new.js.haml
Normal file
2
app/views/admin/supplier_categories/new.js.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$('#modalContainer').html('#{j(render("form"))}');
|
||||
$('#modalContainer').modal();
|
||||
Loading…
Add table
Add a link
Reference in a new issue