From abdcdea1a244cbafd8a5348c6bf29d7bad46e019 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 28 Nov 2014 16:41:17 +1100 Subject: [PATCH] Adding payment methods partial to new enterprirse edit screen --- app/views/admin/enterprises/_form.html.haml | 4 +++ .../form/_payment_methods.html.haml | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 app/views/admin/enterprises/form/_payment_methods.html.haml diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 21789eb66e..aab758f0df 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -31,6 +31,10 @@ %legend Shipping Methods = render 'admin/enterprises/form/shipping_methods', f: f +%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Payment Methods'" } } + %legend Payment Methods + = render 'admin/enterprises/form/payment_methods', f: f + %fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Enterprise Fees'" } } %legend Enterprise Fees = render 'admin/enterprises/form/enterprise_fees', f: f diff --git a/app/views/admin/enterprises/form/_payment_methods.html.haml b/app/views/admin/enterprises/form/_payment_methods.html.haml new file mode 100644 index 0000000000..8857980bd9 --- /dev/null +++ b/app/views/admin/enterprises/form/_payment_methods.html.haml @@ -0,0 +1,33 @@ +- if @payment_methods.count > 0 + %table + %thead + %tr + %th Name + %th Applies? + %th + %tbody + - @payment_methods.each do |payment_method| + %tr{ ng: { controller: 'paymentMethodCtrl', init: "findPaymentMethodByID(#{payment_method.id})" } } + %td= payment_method.name + %td= f.check_box :payment_method_ids, { multiple: true, 'ng-model' => 'PaymentMethod.selected' }, payment_method.id, nil + %td= link_to "Edit", edit_admin_payment_method_path(payment_method) + %br + .row + .six.columns.alpha + %a.button{ href: "#{admin_payment_methods_path}"} + Manage Payment Methods + %i.icon-arrow-right + .five.columns.omega.text-right + %a.button{ href: "#{new_admin_payment_method_path}"} + Create New Payment Method + %i.icon-plus + +- else + %p.text-center + You don't have any payment methods yet. + + %br + .text-center + %a.button{ href: "#{new_admin_payment_method_path}"} + Create One Now + %i.icon-arrow-right \ No newline at end of file