diff --git a/app/views/admin/enterprises/_sidebar.html.haml b/app/views/admin/enterprises/_sidebar.html.haml index 7bd228c4c7..c59bb2086d 100644 --- a/app/views/admin/enterprises/_sidebar.html.haml +++ b/app/views/admin/enterprises/_sidebar.html.haml @@ -1,61 +1,3 @@ -.sidebar_item.four.columns.alpha#payment_methods{ ng: { show: 'Enterprise.is_distributor' } } - .four.columns.alpha.header{ ng: { class: "paymentMethodsColor()" } } - %span.four.columns.alpha.centered Payment Methods - .four.columns.alpha.list{ ng: { class: "paymentMethodsColor()" } } - - if @payment_methods.count > 0 - -# = hidden_field_tag "enterprise[payment_method_ids][]", [] - - @payment_methods.each do |payment_method| - %span.four.columns.alpha.list-item{ class: "#{cycle('odd','even')}", ng: { controller: 'paymentMethodCtrl', init: "findPaymentMethodByID(#{payment_method.id})" } } - %a.three.columns.alpha{ href: "#{edit_admin_payment_method_path(payment_method)}" } - = payment_method.name - %span.one.column.omega - = f.check_box :payment_method_ids, { multiple: true, 'ng-model' => 'PaymentMethod.selected' }, payment_method.id, nil - - else - .four.columns.alpha.list-item - %span.three.columns.alpha None Available - %span.one.column.omega - %span.icon-remove-sign - %a.four.columns.alpha.button{ href: "#{new_admin_payment_method_path}", ng: { class: "paymentMethodsColor()" } } - CREATE NEW - %span.icon-arrow-right - -.sidebar_item.four.columns.alpha#shipping_methods{ ng: { show: 'Enterprise.is_distributor' } } - .four.columns.alpha.header{ ng: { class: "shippingMethodsColor()" } } - %span.four.columns.alpha.centered Shipping Methods - .four.columns.alpha.list{ ng: { class: "shippingMethodsColor()" } } - - if @shipping_methods.count > 0 - - @shipping_methods.each do |shipping_method| - %span.four.columns.alpha.list-item{ class: "#{cycle('odd','even')}", ng: { controller: 'shippingMethodCtrl', init: "findShippingMethodByID(#{shipping_method.id})" } } - %a.three.columns.alpha{ href: "#{edit_admin_shipping_method_path(shipping_method)}" } - = shipping_method.name - %span.one.column.omega - = f.check_box :shipping_method_ids, { :multiple => true, 'ng-model' => 'ShippingMethod.selected' }, shipping_method.id, nil - - else - .four.columns.alpha.list-item - %span.three.columns.alpha None Available - %span.one.column.omega - %span.icon-remove-sign - %a.four.columns.alpha.button{ href: "#{new_admin_shipping_method_path}", ng: { class: "shippingMethodsColor()" } } - CREATE NEW - %span.icon-arrow-right - -- enterprise_fees_color = @enterprise_fees.count > 0 ? "blue" : "red" -.sidebar_item.four.columns.alpha#enterprise_fees{ ng: { show: 'Enterprise.is_distributor' } } - .four.columns.alpha.header{ class: "#{enterprise_fees_color}" } - %span.four.columns.alpha.centered Enterprise Fees - .four.columns.alpha.list{ class: "#{enterprise_fees_color}" } - - if @enterprise_fees.count > 0 - - @enterprise_fees.each do |enterprise_fee| - %a.four.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.admin_enterprise_fees_path}" } - %span.three.columns.alpha - = enterprise_fee.name - %span.one.column.omega -   - - else - .four.columns.alpha.list-item.red - %span.three.columns.alpha None Available - %span.one.column.omega - %span.icon-remove-sign - %a.four.columns.alpha.button{ href: "#{main_app.admin_enterprise_fees_path}", class: "#{enterprise_fees_color}" } - CREATE NEW - %span.icon-arrow-right \ No newline at end of file += render 'sidebar_payment_methods', f: f += render 'sidebar_shipping_methods', f: f += render 'sidebar_enterprise_fees', f: f diff --git a/app/views/admin/enterprises/_sidebar_enterprise_fees.html.haml b/app/views/admin/enterprises/_sidebar_enterprise_fees.html.haml new file mode 100644 index 0000000000..50de7e07d9 --- /dev/null +++ b/app/views/admin/enterprises/_sidebar_enterprise_fees.html.haml @@ -0,0 +1,20 @@ +- enterprise_fees_color = @enterprise_fees.count > 0 ? "blue" : "red" +.sidebar_item.four.columns.alpha#enterprise_fees{ ng: { show: 'Enterprise.is_distributor' } } + .four.columns.alpha.header{ class: "#{enterprise_fees_color}" } + %span.four.columns.alpha.centered Enterprise Fees + .four.columns.alpha.list{ class: "#{enterprise_fees_color}" } + - if @enterprise_fees.count > 0 + - @enterprise_fees.each do |enterprise_fee| + %a.four.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.admin_enterprise_fees_path}" } + %span.three.columns.alpha + = enterprise_fee.name + %span.one.column.omega +   + - else + .four.columns.alpha.list-item.red + %span.three.columns.alpha None Available + %span.one.column.omega + %span.icon-remove-sign + %a.four.columns.alpha.button{ href: "#{main_app.admin_enterprise_fees_path}", class: "#{enterprise_fees_color}" } + CREATE NEW + %span.icon-arrow-right diff --git a/app/views/admin/enterprises/_sidebar_payment_methods.html.haml b/app/views/admin/enterprises/_sidebar_payment_methods.html.haml new file mode 100644 index 0000000000..8994c60be5 --- /dev/null +++ b/app/views/admin/enterprises/_sidebar_payment_methods.html.haml @@ -0,0 +1,21 @@ +.sidebar_item.four.columns.alpha#payment_methods{ ng: { show: 'Enterprise.is_distributor' } } + .four.columns.alpha.header{ ng: { class: "paymentMethodsColor()" } } + %span.four.columns.alpha.centered Payment Methods + .four.columns.alpha.list{ ng: { class: "paymentMethodsColor()" } } + - if @payment_methods.count > 0 + -# = hidden_field_tag "enterprise[payment_method_ids][]", [] + - @payment_methods.each do |payment_method| + %span.four.columns.alpha.list-item{ class: "#{cycle('odd','even')}", ng: { controller: 'paymentMethodCtrl', init: "findPaymentMethodByID(#{payment_method.id})" } } + %a.three.columns.alpha{ href: "#{edit_admin_payment_method_path(payment_method)}" } + = payment_method.name + %span.one.column.omega + = f.check_box :payment_method_ids, { multiple: true, 'ng-model' => 'PaymentMethod.selected' }, payment_method.id, nil + - else + .four.columns.alpha.list-item + %span.three.columns.alpha None Available + %span.one.column.omega + %span.icon-remove-sign + %a.four.columns.alpha.button{ href: "#{new_admin_payment_method_path}", ng: { class: "paymentMethodsColor()" } } + CREATE NEW + %span.icon-arrow-right + diff --git a/app/views/admin/enterprises/_sidebar_shipping_methods.html.haml b/app/views/admin/enterprises/_sidebar_shipping_methods.html.haml new file mode 100644 index 0000000000..6d4a858366 --- /dev/null +++ b/app/views/admin/enterprises/_sidebar_shipping_methods.html.haml @@ -0,0 +1,20 @@ +.sidebar_item.four.columns.alpha#shipping_methods{ ng: { show: 'Enterprise.is_distributor' } } + .four.columns.alpha.header{ ng: { class: "shippingMethodsColor()" } } + %span.four.columns.alpha.centered Shipping Methods + .four.columns.alpha.list{ ng: { class: "shippingMethodsColor()" } } + - if @shipping_methods.count > 0 + - @shipping_methods.each do |shipping_method| + %span.four.columns.alpha.list-item{ class: "#{cycle('odd','even')}", ng: { controller: 'shippingMethodCtrl', init: "findShippingMethodByID(#{shipping_method.id})" } } + %a.three.columns.alpha{ href: "#{edit_admin_shipping_method_path(shipping_method)}" } + = shipping_method.name + %span.one.column.omega + = f.check_box :shipping_method_ids, { :multiple => true, 'ng-model' => 'ShippingMethod.selected' }, shipping_method.id, nil + - else + .four.columns.alpha.list-item + %span.three.columns.alpha None Available + %span.one.column.omega + %span.icon-remove-sign + %a.four.columns.alpha.button{ href: "#{new_admin_shipping_method_path}", ng: { class: "shippingMethodsColor()" } } + CREATE NEW + %span.icon-arrow-right +